Introduction to Components With LittleBits

Hands-on IoT with - Littlebits Intro

Cybersecurity First Principles in this lesson

Introduction

In this lesson, we will explore a cool hands-on technology called Littlebits. Littlebits follows a component-based design paradigm using GPIO (or general purpose input/output) to let you easily make apps. We will learn how to plug and play bits together to make some simple inventions. Littlebits will be the central platform for the rest of camp and you will be using them in other lessons.

Goals

By the end of this tutorial, you will be able to:

Materials Required

Prerequisite lessons

None

Table of Contents

Step 1: Unbox it!

First, open your Littlebits box. Take a second to look at the different components you have. Littlebits is organized around three colors:

Look over each module. Your box should include a helpful component diagram fold-out poster that shows off each of your modules. Read about some of them.

unbox

Step 2: Gotta start somewhere

No time like the present. Lets make a simple invention:

Lets make a simple circuit:

unbox

Press the button and the light turns on. That was easy!

This is GPIO in a nutshell. Each module has a general purpose input and output, with a standard interface, and doesn’t need to understand or know anything about what they are connected to. These modules also need to protect themselves from invalid input. This is a great example of the modularity cybersecurity first principle.

Step 3: Count all the things!

Ok, we’ve made our first circuit - but it’s pretty simple. Let’s add some more modules:

Time to extend your previous circuit to count

Press the button!

Pretty simple. Notice we can chain the output modules together (bright led and a counter in this case). Any number of output modules can be chained together.

Now, lets switch up our circuit a bit.

Lets swap some components around.

Press the button. Everything still works!

Press the button. Does it work? How about if you cover up the light sensor?

This shows you that you can also chain multiple input modules together and their total behavior is a combination of their input designs. In this case, our counter only worked if the light was detected AND the button was pressed.

Lets try one more combo:

Snap your fingers or tap the table near your device.

unbox

Step 4: The world is more than True or False - Variable Inputs

So far, we have outputs and inputs that result in an on (True) or off (False) behavior.

grey.

The world is not always on or off

We are going to make a circuit that shows off variable voltage.

You should see the current temperature in the room near the device. temperature

You should see that the more light it gets, the more voltage it outputs.

You should notice the light dimming and brightening depending on the voltage it receives.

Ok, last part!

So, what did we learn? The thresholder can set a voltage tolerance and output a 1 (True) if its input is greater than the threshold*. This can be helpful if you want to do sound, light, or temperature detection, but you only want to output True if the value is greater than some value.

Step 5: Hey, Listen - Audio

navi

Photo Credit: CmOrigins@deviantart http://cmorigins.deviantart.com/art/Navi-Hey-Listen-322389835

Sometimes you want your inventions to have some sound. The next design we will explore involves using audio.

Lets play a sound when a button is pressed:

Press the button. This plays all of the tracks. If you move the mp3 player switch to next, it will allow you to press the button to switch tracks. You can also use the buttons on the mp3 player board.

mp3-player

By default, the mp3 player comes loaded with stock Littlebits tutorial audio. You can replace it using the sdcard in the board to load it with your own audio.

Step 6: Turning on an outlet with the IR transmitter

The next module to explore is the ir transmitter and power outlet combo.

Lets wire this up so that when you press the button the outlet comes on.

Pressing the button should turn on the device. The first time you press it, you will see the outlet light blink. It is pairing up. Once its paired, press the button a few times. You can see the red light turn on and off as you do.

Note: Since it is IR, the IR transmitter needs line-of-sight to the IR sensor on the outlet.

Step 7: Motoring onward

The last module we will explore is the servo which can bring actual movement into your inventions!

Note you don’t need to use the screw, but hang onto it for later - it should be used in production to secure the turner down

When you press the button, it should rotate the arm 90 degrees.

This can be used for all kinds of purposes!

Self Exploration

Try some different designs yourself.

Test Your Bits, err… Wits!

Quiz

Additional Resources

For more information, investigate the following:

Acknowledgements

Special thanks to Dr. Robin Gandhi for reviewing and editing this lesson.

License

Nebraska GenCyber Creative Commons License
is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Overall content: Copyright (C) 2017-2018 Dr. Matthew L. Hale, Dr. Robin Gandhi, and Doug Rausch.

Lesson content: Copyright (C) Dr. Matthew L. Hale 2017-2018.
Creative Commons License
This lesson is licensed by the author under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.