micro:bit Dog Door Opener

​Do your pets trap themselves in rooms? Do you wish you could make your home more accessible for your furry* friends?? Now you can, hooray!!

This project uses a micro:bit microcontroller to pull open a door when a (pet-friendly) switch is pushed. We’ll need a micro:bit (probably helpful), a high-torque motor, and some mechanical parts and pieces to mount the motor and connect the motor to the door.

Read Time: ~15 min

Build time: ~30-45 min

Cost: ~$60

*This project can be used as a low-cast way to improve home, workplace, or other physical space accessibility for humans, too! Yay!!

 

Materials

  • ​micro:​bit 
  • microUSB cable (3ft or more)
  • ​Binary Bots Planet Totem Spider Kit​
    • If this is your first robotics project, I’d highly recommended to use this kit and follow the tutorial as-is. If you’ve done a few projects before, feel free to make adjustments and modifications. Here are two things to keep in mind:
      • This project requires a high torque motor to pull open our door. The motor control system and high torque mini DC motor from this kit were super helpful in building this project.
      • The assorted boards, nuts, and bolts were also handy, but could be replaced with similar mechanical parts from another robotics kit or directly from a manufacturer.
  • 2 lengths of 24 gauge stranded wire, 3 – 4ft (1 – 1.3m)
  • Fishing line, 4′ (1.3m)
  • Aluminum, 2″x3″ rectangle (5 – 7cm)
  • 8 small nails
  • 6 push pins
  • Wall sticky putty

Tools

  • ​Driver kit
    • Note: the Binary Bots kit does come with an M3 driver (and it’s magnetic, wooo!!!) and a tiny screwdriver.
  • Hammer
  • Wire Strippers
  • Hot Glue Dispenser (not pictured)
  • Scissors
  • Measuring Tape
  • Pencil

Prep and Aluminum Latch Cover

​1. Measure and record the width of your door (the inside part).

2. At a 45 deg angle, measure the distance from the door latch to the wall perpendicular to the door hinges.

Note: your particular room setup is likely different than mine. The key thing to keep in mind is that torque is the lowest when it is applied perpendicular. In other words, try to attach the motor as close to perpendicular as possible. A 45 deg angle is likely the smallest angle you’ll want, larger angles will be easier for the motor to pull open the door.

3. Cut a 2″x3″ piece of aluminum (e.g. from a recycled can).

 

Build it: Door Connection Mechanism!

Materials

To build this part, you’ll need the following pieces from the Binary Bots Kit:

  • 3 100x30cm boards
  • 2 2-hole 90deg brackets
  • 4 6mm M3 bolts
  • 4 lock nuts
  • 2 8mm M3 bolts
  • 2 M3 nuts

Procedure

1. Grab one of the boards. From the left edge, measure and mark the width of the door.

2. Grab a second board. Connect the second board to the first perpendicularly to each other, so that the second board is just to the right of the door width line.

To do this, use both brackets, 4 6mm M3 bolts, and 4 lock nuts.

3. Grab the third board and connect it to the second in a straight line using the longer (8mm) M3 bolts and rectangular M3 nuts.

Set aside and move on to the next part, woo!

Build it: Pet-Friendly Switch!

​Materials

To build this part, you’ll need the following pieces from the Binary Bots Kit:

  • 2 100x30cm boards
  • 4 6mm M3 bolts
  • 4 M3 nuts
  • 2 8mm nylon standoffs

You’ll also need:

  • 2 3-4ft (1-1.3m) of stranded 24 gauge wire
    • Remove about 1in (2.5cm) of the insulation from both ends​
  • 3 push pins

Procedure

1. Grab one of your boards and attach the nylon standoffs to the left side using two (2) M3 nuts.

2. Grab the second board and use two (2) M3 bolts to secure the second board to the first via the nylon standoffs.

3. Grab one of the M3 bolts and push it through a hole on the far right end of the top board. Wrap one end of the wire around the base of the bolt. 

4. Use an M3 nut to secure the bolt in place.

5. Repeat steps 3 and 4 for the bottom board, making sure that the second bolt is directly below the first.

When you close the switch (aka push the boards together), the top and bottom bolts should press together and make full contact.

Build it: Motor Mount!

Materials

​To build this part, you’ll need the following pieces from the Binary Bots Kit:

  • 1 100×100 cm board
  • 1 Tiny Motor with 2 tiny screws (so cute and yet so powerful!)
  • 1 Motor Mount (“web launcher”)
  • 1 reel set (“web reel”)
  • 6 6mm M3 bolts
  • 6 M3 nuts

You’ll also need:

  • 6 small nails
  • 1 pushpin​
  • 4ft (1.3m) of fishing line (or equally strong line)

Procedure


1. Insert and secure the motor into the motor mount with the two tiny screws (highly recommended to use a larger screwdriver if you have one..)

2. Grab the 100x100cm board and use the 6 M3 bolts and nuts to attach the motor on the left side in (roughly) the middle.

3. Grab the reel and fishing line. Thread one end of the fishing line through the middle of the reel, then wrap around the teeth. Secure with a dab of hot glue.

4. Push the two reel pieces together (pinching the thread between the two pieces), and insert into the motor drive shaft so that the web part faces outward. Secure with a dab of hot glue on the outside.

Connect it: Electronics!

Materials

  • micro:bit
  • microUSB cable
  • Binary Bots motor driver board
  • 3 AAA batteries

Procedure

1. Grab the Motor Mount setup you just put together, and plug in the motor to the motor driver board.

Connect the red motor wire to the left header pin labeled “Motor1”. Connect the black motor wire to the right header pin labeled “Motor1”.

2. Connect the pet-friendly switch! Connect one of the switch wires to the micro:bit P0 pin, and the other to the micro:bit GND pin (doesn’t matter which switch wire goes where).

3. Insert the micro:bit into the motor driver board so that the pushbuttons are facing outwards (away from the motor driver).

4. Insert the batteries into the motor driver board. Locate the power switch and move to “off”.

Code it: Motor Control!

Navigate to the Make Code website: www.MakeCode.org and select the micro:bit option, then “New Project”. It is recommended to rename your project to help you identify what it is doing, like “DogDoorOpener”.

Some background info: 

When Pin P0 is triggered (via the switch closing), we want to turn the motor so that it pulls open the door by spooling (aka reeling in) the fishing line. We also want to unspool the fishing line so we can shut the door again. It is also helpful to have a manual way to spool and unspool the motor, as well as to cut power to the motor.. just in case!

Since we are dealing with a DC motor, when we give power to one of the motor leads and ground the other, the motor will rotate in one direction. When we switch power to the motor leads, the motor will rotate in the other direction. Cutting power to both motor leads turns off the motor.

Let’s get started!

First Code Function: Motor Triggered by Doggo Switch

1. Pull out a “when pin is pressed” (input blocks) and make sure it is set to pin P0.

2. Inside the pin P0 block, use the digital write blocks to turn on micro:bit pin P13 (set to 1) and turn off micro:bit pin P14. This turns the motor on in one direction. 

The digital write blocks are found under Advanced –> Pins. Select the appropriate pins by clicking on the down arrow.

3. Add a pause for about 7s (7000 ms), then turn the motor off by setting P13 and P14 to 0.

Note: 7 seconds worked well for my setup and my doggo’s needs, but definitely check that this is enough (slash not too much) time to adequately open your door for your needs.

4. Unspool the motor (aka rotate it in the reverse direction) by using a digital write block to turn on P14 and turn off P13. Be sure to unspool the same amount of time as you spool.

5. Optional: use the LEDs to include a countdown/count-up timer to let you know when the motor will be turned on. Also recommended to add a pause between when the switch is pressed as well as when before the motor unspools.

Second Code Function: Manual Open

1. To make a manual switch, drag out a “On Button A pressed” (input blocks).

2.  Inside this block, use the digital write blocks to turn on micro:bit pin P13 (set to 1), and turn off micro:bit pin P14 (set to 0).

3. Add a pause block for ~3s (3000 ms).

4. Turn off the motor! (by setting the digital write blocks to 0)

5. Optional: Show an icon before you turn the motor on so you know which way the motor will be turning.

For mine, I chose a rectangle outline so indicate “open door”, choose something that makes sense to you and your brain.

Third Code Function: Manual Close

1. To make a manual switch, drag out a “On Button B pressed” (input blocks).

2.  Inside this block, use the digital write blocks to turn on micro:bit pin P13 (set to 0), and turn off micro:bit pin P14 (set to 1). 

3. Add a pause block for ~3s (3000 ms). 

4. Turn off the motor! (by setting both digital write blocks to 0)

5. Optional: Show an icon before you turn the motor on so you know which way the motor will be turning.

Fourth Code Function: Turn Off Motor

1. Pull out a “On Button A+B pressed” block.

2. Use two digital write blocks to set both P13 and P14 to 0.

Install it!

1. Use some of the wall sticky putty to wrap the aluminum around the door latch.

Bend the aluminum around the latch so that the door is able to fully close, but prevents it from sticking.

2. Using your hot glue dispenser, glue the short end of the door mechanism piece to the door width, just below the latch. Glue the longer piece to the door to provide extra stability.

3. Attach the motor mount and the motor controller board to the wall. Use the push pins temporarily to hold the pieces in place, then use 6 nails to secure the motor controller, and 2 to secure the motor controller board.

4. Use the wall sticky putty to attach the switch in a place that is convenient for whoever will be triggering the door to open. Since my dog is fairly large, I installed it about 1.5ft (0.5m) up from the floor so that doggo could press the switch with his nose.

I preferred to sticky putty so I could adjust the switch and remove things as necessary, but if you want to make this permanent you can use nails or hot glue.

5. Use the pushpins to secure the switch wires to the wall and prevent them from getting disconnected.

6. Attach the fishing line between the motor reel and the door mechanism. Close the door fully, then wrap the fishing line around the door mechanism a few times so that it is taught, then secure with hot glue.

Test & Deploy! And make your home more accessible, hooray!

​Huzzah!! Ready for the testing phase! Power up the micro:bit (via the microUSB cable) and turn on the motor controller board.

Trigger the switch and check that the motor pulls open the door enough for your furry friend to escape! And also that the motor unspools so you can close the door again.

Very likely something will need to be adjusted/fixed, so check all of the buttons, make sure the system is secure to the wall and does not block anything.

Once you’ve tested your Doggo Door Opener, show it to your pet! … And maybe train them, ha. I did this by using treats on top of the switch, so that my dog accidentally triggered the switch, then he saw that door opened. It took a few tries (I also ended up giving it a command of “get the switch”), but eventually he figured it out! And now I can leave my lovely but oh-so-anxious dog home alone without worrying he will trap himself (on purpose? I have no idea).

Hooray for using tech to make our own lives and the lives of others easier and better!

Let me know if you have any questions, run into any issues, or have other ideas for this project, I’d lovelovelove to see what you make so please share your creations!

Happy making, friends!

micro:bit magic wand (intermediate)

 

“Any sufficiently advanced technology is indistinguishable from magic.” (Arthur C. Clarke). Heck yes it is! What are we waiting for, let’s use technology to create our own kind of magic!!

This project uses two micro:bit microcontrollers, a household cooling fan, and a few small electronic parts to create our very own magical wand. I chose to use the Wingardium Leviosa gesture, but you can most certainly adapt this project to cast other spells!

Please note that this is an intermediate project because it involves high voltage and current. Use proper safety protocols and always have another adult nearby.

Difficulty: Intermediate

Read Time: 15 min

Build Time: ~ 1 hr

Cost: ~ $40

Materials

  • Wand!
    • You can purchase custom wands or get creative and make your own!
  • Feather (for floating!)
  • Glove (for hiding the micro:bit wand controller)
  • One (1) household cooling fan (4A or less)
    • We do not modify the cooling fan so grab one you have around the house or borrow one from a favorite human.
  • One (1) extension cord
    • We WILL modify the extension cord, so use an extra one you don’t need or buy a cheap one.
  • Two (2) micro:bits
  • Two (2) micro:bit battery packs and two (2) AAA batteries
    • If you get the micro:bit Go bundle, it comes with a battery pack and batteries 🙂
  • Two (2) microUSB cables
  • One (1) PCB
    • Mine is 2cm x 8cm, any similar or larger PCB will work (but definitely do NOT use a breadboard as it cannot handle the high current)
  • One (1) solid state relay (JZC-11F)
    • Rated for 5Vdc input and 220/250 Vac and 5A output. You can use a different relay as long as it can switch

Magic? What! How??

One of my favorite scenes from the first Harry Potter book was when Hermoine makes a feather float with the spell Wingardium Leviosa. This simple spell captures the essence of why we love magic: that literally at the flick of our wrist and a few choice words, we can instantly make surprising (and impressive) things happen.

Although we don’t have exactly that kind of magic, we do have technology that sometimes seems miraculous. So that sort of counts! To mimic my fav scene, I wanted to levitate a feather. How can we move feathers from afar in real life? With wind!!

After building a beginner version of this project, I wasn’t 100% satisfied. I wanted to reach Hermione-level wizard status! So I designed a second version that can switch power for a large household fan.

This version uses a solid state relay to switch AC power with a DC trigger. You can imitate my design or, better yet, create your own! There are TONS of variations for this project that you can make with this basic framework, find a spell that inspires you and bring it to life!

This tutorial will show you how to do the following:

1. Write a simple block-based code for a micro:bit wand controller

2. Build a circuit to switch power for a 12V, 4A hosuehold fan.

3. Write a simple block-based code for a magical receiver that is triggered with a radio signal (aka bluetooth)

Code it: Wand Controller!

Let’s start with our magic wand!
We are using block-based coding via the Make Code website, but if you have experience w/ coding you can also program the micro:bit using micropython or C++ in your fav coding environment (e.g. Idle, Visual Studio Code, etc.).

Step 1: In the On Start block, set the Radio Group number. We’ll use the same number for the magical receiver micro:bit.

Step 2: Decide how you want your wand to trigger action.

The micro:bit has a 3-axis accelerometer, we will use this to set a gesture trigger.

Quick solution: Use the “on shake” block!

 

More complex, gesture-based solution:

Explore how the accelerometer works by printing to the Serial port with the “Serial write value” blocks (under the Advanced section). Open the Arduino IDE Serial Monitor to observe the micro:bit output as you make gestures. Use your observations to set triggers. (Code No. 2)

The example in Code No. 2 is my attempt at a Wingardium Leviosa gesture: swish-and-flick! (down in the z-direction and left in the x-direction). Use as-is or as a starting point for your own fav magical gesture!

Helpful Tips:

(1) Since microcontrollers process information super quickly, the pause block gives us time to finish the first part of the gesture before the micro:bit checks for the second part. 

(2) I added axes labels on the micro:bit so I could more easily figure out how to get the right motion for Wingardium Leviosa spell — definitely recommend this!

Step 3: Use the gesture to send a radio number (or string, just be consistent).

The “radio send string” and “radio send number” blocks are found in the “radio” block set.

Step 4: Download and save the code onto the micro:bit!

Build it: Magical Receiver!

Grab your second micro:bit, your PCB, your soldering iron, and all of the electronic parts!

Quick overview: We are using the micro:bit 3.3V power out to trigger the DC side of the relay. The circuit is completed when the micro:bit P0 pin switches on the NPN transistor.

Step 1: Solder the relay and transistor to your PCB board.

Step 2: Solder the diode across the relay DC power pins to protect the micro:bit from stray voltage when the relay coils switch. The negative side of the diode (grey line) should connect to the relay DC positive power in pin.

Step 3: Solder one jumper wire to the relay DC positive power in pin. Connect an alligator clip between this wire and the micro:bit 3.3V output pad.

Step 4: Solder another jumper wire between relay DC power out (GND) pin and the transistor collector pin.

Step 5: Solder the third jumper wire to the transistor emitter pin. Connect an alligator clip between this wire and the micro:bit GND pad.

Step 6: Solder your resistor to the transistor base pin. Connect an alligator clip between the other end of the resistor and the micro:bit P0 pad.

Step 7: Remove 1/2″ (2 cm) of insulation from the 14 gauge wire on both sides. Solder one wire to the relay NO (normally open) pin and the other wire to the relay COM (or coil 2) pin.

Step 8: Cut the extension cord on one side only, and remove ~ 1/2″ (2cm) of insulation from side of the cut wire.

Step 9: Grab the 14 gauge wire and slide a piece of heat shrink tube onto each wire.

Step 10: Line up one end of the 14 gauge wire with one end of the extension cord wire, then twist the metal together. Secure the heat shrink tube with your fav. heat source (e.g. lighter, hair dryer, etc.). Repeat for the other wires and heat shrink tube.

Note: Orientation of the AC wires does not matter.

Code it: Magical Receiver!

Time to code our magical receiver!

Step 1: Set Radio Group to the same number as for the Wand Controller.

Step 2: Pull out a “on radio received” block and set it to “receivedNumber” (or “receivedString” if you used that for your Wand Controller).

Step 3: Drag a repeat block into the “on radio received” block and switch it to repeat 2 – 4 times.

Step 4: (Optional but recommended) Show an icon on the micro:bit to let you know if it received the string.

This is super duper helpful if/when you are debugging.

Step 5: Turn on Digital Pin 0! (aka “digital write pin P0” to 1)

This block is found under the “Pins” block under the Advanced tab.

Step 6: Pause for a few seconds.

I chose 2 seconds, you can keep this or adjust as desired.

Step 7: Turn off Digital Pin 0 (“digital write pin P0” to 0) and the micro:bit display.

Step 8: (Optional but recommended) Add a back-up trigger using micro:bit button A for testing and debugging purposes 🙂

Voila! Download the code onto your Magical Receiver micro:bit and we’re ready for the magical prop!

Test & Debug!

And now, for our favorite part: testing!!

Power up your micro:bits (via battery or microUSB), plug in the extension cord and plug the fan into the extension cord, then move your wand controller to check that the magical receiver turns on the fan.

When you are done testing, coat the magical receiver connections in hot glue to hold them in place. If you want an ultra-permanent solution, use epoxy (waterproof is a nice bonus feature). Recommended to avoid covering the micro:bit in glue so you can use it for future projects.

Not working as expected?

1. Power is the most common issue for makers of all experience levels. Double check that all the things are plugged in. Use the micro:bit controller quick trigger to test that the receiver shows the “got message” icon.

2. Fan not moving? When the relay switches, you will hear an audible click. Use the micro:bit controller quick trigger and listen for the sound.

I did notice that the micro:bit 2xAAA battery pack was insufficient power to trigger the relay. I ended up just using the microUSB cable but a 3xAAA battery pack should also do the trick.

3. Use a multimeter to check continuity of your solder joints and, if necessary, voltage across the relay DC coils.

Build your magical prop!

Now that you’ve tested and practiced your magical tech abilities, you’re ready to build your magical prop! Use gloves to hide the micro:bit wand controller + battery pack.

For the magical receiver: Where do you want to put the feather and how can you hide the fan?

For my demo, I just hid the fan off camera (shhhhh don’t tell!!), but if you are doing your magical performance in-person you can build an enclosure to hide the fan. I found that window screen mesh worked great to help hide the parts while still letting air flow through.

Want to do other kinds of magic? You can build different types of props! This same setup will work to turn on any low-power AC device like speakers or a screen! Just be sure that the maximum current draw is less than 5A.

Go forth and be magical!

Heck yes, wizard level: intermediate!! Practice your gesture so you can really impress all the people. And of course, teach others how to do this technological magic!

Leave a comment if you need some help, have any questions, or to show off your creations!

Happy making, friends!

micro:bit magic wand (Beginner)

 

While it is a bit tricky for us non-magical humans to levitate objects with our minds, words, or wands, we can use technology to do (basically) the same things!

This project uses two micro:bits, a few small electronic parts, and some everyday objects from around the house to create our very own magical wand.

I went for the Wingardium Leviosa spell, but you can most certainly adapt this project to cast other spells 🙂

Difficulty: Beginner+ (a lil’ bit of experience w/ coding and circuits is helpful)

Read Time: 10 min

Build Time: ~ 2 hrs

Cost: ~ $35

Materials

  • Wand!
    • You can purchase custom wands or make your own! Find a suitable stick and add some flair (or leave it bare!), or get creative and make one out of things you can find around the house!
  • Feather (for floating!)
  • Glove (for hiding the micro:bit wand controller)
  • Aluminum can
  • Small piece of cardboard (~ 2″ x 2″/5cm x 5cm)

What are we doing??

One of my favorite scenes from the first Harry Potter book was when, after all of the other students are struggling, Hermoine makes a feather float with the spell Wingardium Leviosa. This simple spell captures the essence of why we love magic: that literally at the flick of our wrist and a few choice words, we can instantly make surprising (and impressive) things happen.

Although we don’t have exactly that kind of magic, we do have technology that sometimes seems miraculous. So that sort of counts!

By now you’ve probably guessed: To mimic my fav scene, I wanted to levitate a feather. For that, we can use the power of wind! For this beginner-friendly tutorial, I chose to use a small 5V DC motor with fan blades made from an aluminum can. You can imitate my design or, better yet, create your own!

This tutorial will show you how to do the following:

1. Write a simple block-based code for a micro:bit wand controller

2. Build a circuit to control a small, 5V DC motor

3. Write a simple block-based code for a magical receiver that is triggered with a radio signal (aka bluetooth)

4. Build a setup to make our tech really look like magic!

 

Code it: Wand Controller!

Let’s start with our magic wand!

Since this is a beginner-friendly project, we are using block-based coding on the Make Code website. If you have more experience w/ coding you can also program the micro:bit using micropython or C++ in your fav coding environment (e.g. Idle, Visual Studio Code, etc.).

Alright, let’s get blockin’!

Step 1: In the On Start block, set the Radio Group number. 

Pick a number you love and will remember, since we’ll also need this for the receiver.

Step 2: Decide how you want your wand to trigger action.

The micro:bit has an accelerometer which measures changes in acceleration in our three spatial dimensions: up/down, left/right, and forwards/backwards.

Quick solution: Use the “on shake” block! (Code 1, above photo)

More complex, gesture-based solution: Explore how the accelerometer works and observe the output as you make gestures (open the Arduino IDE Serial Monitor to see the output, if you need help with this check out this tutorial). Use your observations to set triggers. (Code 2 in the above photo)

The example in Code 2 is my attempt at a Wingardium Leviosa gesture: swish-and-flick! (down and left) Use it as-is or as a starting point for your own fav magical gesture!

Helpful Tips:

(1) Since microcontrollers process information super quickly, the pause block gives us time to finish the first part of the gesture before the micro:bit checks for the second part.

(2) I added axes labels on the micro:bit so I could more easily figure out how to get the right motion for Wingardium Leviosa spell — definitely recommend this!

Step 3: Use the gesture to send a radio number.

The “radio send number” block is found in the “radio” block set. Any (rational, real, non-infinite) number will work!

Step 4: Download and save the code onto the micro:bit!

The micro:bit power lights will flash as this is happening, when they are done flashing the code is finished uploading.

Build it: Magical Receiver!

Grab your second micro:bit, your breadboard, and all the fun electronic parts and pieces!

Step 1: Insert your MOSFET transistor into the breadboard.

Recommended to have the black part of the transistor facing you so that pin references in these instructions are accurate 🙂

Step 2: Grab one of your pin-ended alligator clips and connect it from micro:bit pin P0 to an open row in the breadboard.

Step 3: Connect your resistor between the micro:bit P0 wire and the MOSFET Gate pin (leftmost pin).

Step 4: Connect a pin-ended alligator clip between micro:bit GND pin and the MOSFET source pin (rightmost pin).

Step 5: Using your two remaining pin-ended alligator clips, connect the motor leads to two open rows in the breadboard.

Step 6: Connect your jumper wire from one of the motor wires to the MOSFET drain pin (middle pin).

Step 7: Connect your diode across the motor terminals so that the negative side (w/ the stripe) connects to the remaining motor wire (yellow wire in photo).

Step 8: Connect the negative (black) battery lead to the MOSFET source pin (same row as micro:bit GND).

Step 9: Connect the positive (red) battery lead to the remaining motor wire (yellow wire).

Code it: Magical Receiver!

Step 1: Set Radio Group to be the same as for the Wand Controller.

Step 2: Pull out a “on radio received” block and set it to “receivedNumber”.

Step 3: Drag a repeat block into the “on radio received” block and switch it to repeat 2 – 3 times.

Step 4: (Optional but recommended) Show an icon on the micro:bit to let you know if it received the string.

This is super duper helpful for debugging.

Step 5: Turn on Digital Pin 0! (aka “digital write pin P0” to 1)

This block is found under the “Pins” block under the Advanced tab.

Step 6: Pause for a few seconds.

I chose 4 seconds, you can keep this or adjust as desired.

Step 7: Turn off Digital Pin 0 (“digital write pin P0” to 0) and the micro:bit display.

Step 8 (Optional but recommended): Add a back-up trigger using micro:bit button A for testing and debugging purposes 🙂

Voila! Download the code onto your Magical Receiver micro:bit and we’re ready for the magical prop!

Let’s make wind!

Let’s make a wind generator!! AKA a fan 🙂 Turn on a hot glue gun and grab your scissors, permanent marker, aluminum can, and some cardboard.

Step 1: Carefully cut out a rectangle of aluminum from an empty can and a small circle of cardboard about 1/2″ (1 cm) in diameter.

 

Step 2: Print out the paper fan template above at 50% to scale. Cut out one of the fan blades and trace it five (5) times onto the aluminum foil.

Step 3: Carefully cut out the aluminum fan blades and glue onto the cardboard circle at equal intervals.

Step 4: Glue the motor mount onto a piece of cardboard (I also added “legs’ made of wooden dowels to make it easier to connect the alligator clips).

Other options:

  • Use the motor drive shaft to spin objects or make some gears/levers to move things in different directions
  • If you connect micro:bit to speakers, it can also play sounds!
  • Start with something simple and play around to find something that makes you feel magical.

Test all the things!

And now, for our favorite part: testing!! Power up your micro:bits (and connect the battery) and move your wand controller (or use the quick button trigger) to test that our magical receiver moves the motor.

When you are done testing, coat the magical receiver connections in hot glue to hold them in place. If you want an ultra-permanent solution, use epoxy (waterproof is a nice bonus feature). Be careful to avoid getting glue (and especially epoxy) on your micro:bits so that you can still use them for future projects!

Note: When you first power everything up, the motor may start spinning without a signal. Trigger the wand controller and it should stop, then behave as expected.

Not working as expected?

Debugging is an almost inevitable part of building things, so congratulations! You are officially a maker! Here are some debugging tips:

1. Power is the most common issue for makers of all experience levels. Double check that the battery is properly connected and both the micro:bit power lights are on (those little yellow lights by the microUSB port).

2. Motor not moving? Be sure none of the wires or other objects are in the way.

3. Motor pulling the feather towards it rather than away? Swap the orientation of the motor leads. This will cause the motor to spin in the opposite direction and thus the air will be pushed in the opposite direction.

Make all the magic!

We’re basically wizards now! Use gloves to hide and hold the micro:bit wand controller and battery pack. Hide your magical receiver in a fantastical container to really impress all the people. I snagged a hollow book stack, cut a hole in the top, and glued my motor with the fan inside.

That’s it! Practice your spell and impress your friends with your new-found powers.

Questions, comments, creations? Leave a comment! Happy making, you magical beings!

DIY Custom Light Performance

The motivation for this project was to create a controller that allows users to “play” light like it is an instrument with gesture control, custom visuals, and brightness/speed dials.

Considering how pricey consumer light controllers can be (often $100 bucks or more- not including the lights!) we decided to make a cheaper, more customizable solution! One aspect of this project that we were particularly excited about was the low barrier to entry. Most users pick up the controller in 2-3 songs, unlike other light toys (gloving, poi, ect) that require a much larger practice investment.

Here is our approach, you are welcome to use as-is or modify the project for all of your wild and wonderful needs!

Build Time: 2-3 hours 

Estimated Cost: $80 of materials

Project Materials

Case/Mounting Board (I used a wood box from a craft store)
Seeed Grove Sound Sensor v1.6 (Optional- Not used in this version)
Addressable LED Strips (2-3)
Rotary Potentiometer (2)
Digilent Pmod KYPD
Ultrasonic Rangefinder
Arduino UNO

Project Tools

Dremel
Soldering Iron
Hot glue gun

Build Overview

Design Considerations

One of the challenges with a project like this is the number of buttons it needs. Even in my more conservative designs, I wanted to have around 8 buttons to manage the different visual sequences, color palettes, and other mode selection. Wiring up that many buttons can be tedious and adds more points of failure. Additionally, the Arduino Uno board has a limited number of digital inputs. Luckily, the Pmod KYPD solves both of these issues!

The Pmod KYPD’s small form-factor allows it to fit neatly onto any baseboard without taking up too much space. I am using a free wood sample I got from my local hardware store as my mounting panel.

Electrical Schematic

Build Process

1. Start by connecting the Pmod KYPD to the Arduino Uno digital pins as shown in the above Fritzing diagram.

2. Next, wire in your potentiometers to Analog Pins A5 (brightness) and A4 (speed).

3. Attach the LED Strips to Ground and 5V, then wire both signal pins into Digital Pin 11.

4. Wire up the sound sensor to power and ground, and the white wire to A1 and yellow wire to A0.

If you do not have the connecting cable as a reference, the yellow wire is the outside one, and more documentation on the sensor is here. For the Ping sensor/Ultrasonic rangefinder Trig is on Digital Pin 13 and Echo is on Digital Pin 12 (in addition to power and ground of course).

5. The PmodBTN is wired to Analog Pin 0-4, along with ground and power.

Code

1. Download the 2.0_Code.

2. Activate the  FastLED and Keypad library (both found in the Arduino IDE library manager).

Keypad is not listed first when you search for it, you will have to scroll down until you find the one by Mark Stanley and Alexander Brevig.

3. Copy and paste the code into the Arduino IDE and click upload. Now it is time to play around with the board!

Note: Buttons 3 and 4 are attached to the ping sensor so try putting your hand over the sensor when you activate those visualizers.

Read through the code and our comments to see where you can make changes or add in new features. Have fun and feel free to expand this project to add more visualizers, sensors, ect!

More information

We updated the code and added more functionality, download LEDController_2 if you want the additional features. This code also requires the FastLED and KeypadUpload libraries.

In the new code the visualizers are:

  1. Flow
  2. Waterfall
  3. DoubleBounce
  4. Hand Bounce
  5. Levels
  6. Center Levels
  7. Blob
  8. AmbientSpots
  9. Segments
  10. Pulse

The numbers correspond to the visualizers and the letter to color palettes.

For the PmodBTN module, the effects are the following:

  • Top Right: Strobe
  • Bottom Right: Bounce Out (Double Bounce Single Sequence)
  • Bottom Left: Pause
  • Top Left: Not Set

Effects are temporary animation sequences that interrupt the current visualizer. They perform a single loop, then the current animation resumes. The one exception is the pause button, which requires you to unpause or skip out of it using a different effect.

Mechanical Design:

For our final version, we took a hollow wooden box from a local craft store and placed/traced out each component on the box. Then we dremeled a hole under the spot for the wires and set the Arduino inside the box. Finally, we mounted each piece with hot glue (after running the wires) and clipped the box shut with the metal clasp that came on it.

That’s it! Please let us know if you have any questions or issues and definitely share your creations with us!

Happy making!

Using Arduino for Citizen Science!

Science allows us to ask our most pressing questions and explore all sorts of curiosities. With some thought, hard work, and patience, we can use our explorations to build a better understanding and appreciation of the complex and beautiful world around us.

This tutorial will teach you how to use an Arduino (uno) microcontroller, how to use different types of sensors, and how to gather and visualize data. Along the way, we’ll build three projects: a tilt switch, a temperature and humidity sensor, and a light sensor!

Difficulty Level: Beginner

Read Time: 20 min

Build Time: Depends on your project! (Projects in this tutorial take about 15 – 20 min)

Pssst, What’s the Difference Between Citizen Science and “official Science”?

The biggest difference is that citizen science is, as I love to say, “hand wavy”, which means that there are lots of errors and uncertainties and no rigorous process to identify them. Because of this, conclusions reached through citizen science are much less accurate than science-science and should not be relied upon to make serious/life-altering/life-threatening claims or decisions.*

That being said, citizen science is a great way to build a fundamental understanding of all sorts of fascinating scientific phenomenon and is good enough for most day-to-day applications.

*If you are doing citizen science and you discover something potentially dangerous (e.g. high lead levels in water), inform your educator (if applicable) and contact the relevant authorities and professionals for assistance.

What Is Arduino??

Arduino is a microcontroller board and Integrated Development Environment (“IDE”), which is a fancy way of saying “coding program”. For beginners, I highly recommend Arduino Uno boards because they are super robust, reliable, and powerful.

Arduino boards are a good choice for citizen science projects because they have lots of input pins to read in both Analog and Digital sensors (we’ll get more into this later).

Of course, you can use other microcontrollers for citizen science depending on your (or your students’) needs, abilities, and comfort level. Here is an overview of microcontrollers to help ya decide what is best for you!

To flash, or program, an Arduino board, plug it in via USB, then:

1. Select the type of Arduino you’re using under Tools -> Boards.

 

2. Select the port (aka where it’s connected to your computer).

 

3. Click the Upload button and check that it finishes uploading.

Tools & Materials

If you’re just getting started, getting a kit is a quick & easy way to get a bunch of parts at once. The kit I’m using in this tutorial is the Elegoo Arduino Starter Kit.*

Tools

  • Arduino Uno
  • USB A to B cable (aka printer cable)
  • Jumper Wires
    • 3 male-to-male
    • 3 male-to-female
  • Breadboard
    • Optional but recommended to make your life easier and more fun 🙂

Materials

For the projects covered in this tutorial, you’ll need these parts from the Elegoo Arduino Starter Kit:

  • Tilt Switch
  • DTH11 Temperature and Humidity Sensor
  • LED
  • 100 Ohm Resistor

*Full disclosure: I purchase these same kits for workshops, but the kit used in this tutorial was donated by the lovely folks at Elegoo.

What Kinds of Sensors Can We Use?

When designing a science experiment, we typically start with a question: How much CO2 do plants absorb in a day? What is the impact force of a jump? What is consciousness??

Based on our question, we can then identify what we want to measure and do some research to figure out what sensor we can use to gather data (although it miiight be a bit tricky to gather data for that last question!).

When working with electronics, there are two main types of sensor data signals: Digital and Analog. In the photo, the first two rows of parts are all digital sensors, while the top two rows are analog.

There are many different types of digital sensors, and some are more challenging to work with than others. When doing research for your citizen science project, always check how the sensor puts out data (srsly tho) and make sure you can find an (Arduino) library for that specific sensor.

In the three projects covered in this tutorial we’ll use two types of digital sensors and one analog sensor. Let’s get a-learnin!

Digital Sensors!

Part 1: the Easy Ones

Most sensors you’ll use output a Digital Signal, which is a signal that is either on or off.* We use binary numbers to represent these two states: an On signal is given by a 1, or True, while Off is 0, or False. If we were to draw a picture of what a binary signal looks like, it would be a square wave like the one in the photo below!

There are some digital sensors, like switches, that are super easy and straightforward to measure because either the button is pushed and we get a signal (1), or it is not pushed and we have no signal (0). The sensors pictured in the bottom row of the first photo are all simple on/off types. The sensors on the top row are a bit more complex and are covered after our first project.

The first two projects in this tutorial will teach you how to use both types! Onward to build our first project!!

*On means an electrical signal in the form of electric current and voltage. Off means no electrical signal!

Project 1: Tilt Switch Digital Sensor

For this first project, let’s use a tilt switch, that black cylindrical sensor with two legs!
Step 1: Insert one leg of the tilt switch into Arduino Digital Pin 13, and the other leg into the GND pin right next to pin 13. Orientation doesn’t matter.

Step 2: Write a sketch that reads in and prints out the status of Digital Pin 13.

Or you can just use mine!

If you’re just getting started in coding, read through the comments to better understand how the sketch works and try changing some things to see what happens! It’s OK to break things, that’s a great way to learn! You can always re-download the file and start over 🙂

Step 3: To see your live data, click on the Serial Monitor button.

.. aaaand that’s it! You can now use the tilt switch to measure orientation! Set it up to call out your kitty when it knocks something over, or use it to keep track of how tree branches move during storms! .. & there are probably other applications in between those two extremes.

Digital Sensors!

Part 2: PWM and Serial Communication

There are many ways to create more complex digital signals! One method is called Pulse Width Modulation (“PWM”), which is a fancy way of saying a signal that is on for a certain amount of time and off for a certain amount of time. Servo motors (which can be used to measure position) and ultrasonic sensors are examples of sensors that use PWM signals.

There are also sensors that use serial communication to send data one bit, or binary digit, at a time. These sensors require some familiarity with reading datasheets and can be pretty tricky if you’re just getting started. Fortunately, common serial sensors will have code libraries* and sample programs to pull from so you can still cobble together something functional. More details on serial communication protocols is beyond the scope of this tutorial, but here is a great resource on serial communication from SparkFun to learn more!

For this sample project, let’s use the temperature and humidity sensor (DHT11)! This is a lil’ blue square with holes and 3 pins.

First we’ll need a couple of special libraries for the DHT11 sensor: the DHT11 library and the Adafruit Unified Sensor library.
To install these libraries (and most other Arduino libraries):

Step 1: Open up the Arduino library manager by going to Sketch -> Libraries -> manage Library

Step 2: Install and activate the DHT library by searching for “DHT” and then clicking Install for the “DHT Arduino Library” .

Step 3: Install and activate the Adafruit Unified Sensor library by searching for “Adafruit Unified Sensor” and clicking install.

Step 4: Insert the DHT library into your open sketch by going to Sketch -> Libraries, and clicking on the “DHT Arduino Library.  This will insert a couple of new lines at the top of your sketch, which means our library is now active and ready to use!

*Just like your fav local library, code libraries are a wealth of knowledge and other folks’ hard work that we can use to make our lives easier, yay!

Project 2: Temp and Humidity Digital Serial Sensor

 

Grab 3 male-to-female jumper wires from the Elegoo Arduino Starter Kit and we’re ready to go!

Step 1: With the header pins facing you, connect the rightmost header pin on the DHT11 to an Arduino ground (“GND”) pin.

 

Step 2: Connect the middle header pin to Arduino 5V output pin.

 

Step 3: Connect the leftmost header pin to Arduino Digital Pin 2.

Step 4: Finally, read the DHT library and try your hand at writing a sketch! Oooor you can use mine or the DHT test example sketch within Arduino -> Examples!

When you’ve got it up and running, go forth and measure the temperature and humidity of all the things! .. Like an animal’s breath, a greenhouse, or your favorite climbing spot at different times of the year to find the *perfect* sending temp.

Analog Sensors!

After the difficult dive into digital sensors, analog sensors can seem like a breeze! Analog signals are a continuous signal, like the photo below.

Most of the physical world exists in analog (e.g. temperature, age, pressure, etc.), but since computers are digital*, most sensors will output a digital signal. Some microcontrollers, like Arduino boards, can also read in analog signals**.

For most analog sensors, we give the sensor power, then read in the analog signal using the Analog Input pins. For this test, we’ll use an even simpler setup to measure the voltage across an LED when we shine a light on it.

*Computers use digital signals to store and transmit info. This is because digital signals are easier to detect and are more reliable, since all we’ve got to worry about is getting a signal or not versus having to worry about the quality/accuracy of the signal.

** To read in an analog signal on a digital device, we must use an Analog-to-Digital, or ADC, converter, which approximates the analog signal by comparing the input to a known voltage on the device, then counting how long it takes to reach the input voltage. For more info, this is a helpful site.

Project 3: LED As a Light Sensor!

Grab an LED (any color except white), a 100 Ohm resistor, and 2 jumper cables. Oh, and a breadboard!

Step 1: Insert the LED into the breadboard with the longer leg on the right side.

Step 2: Connect a jumper wire from Arduino Analog Pin A0 and the longer LED leg.

Step 3: Connect the resistor between the shorter LED leg and the breadboard negative power rail (next to the blue line).

Step 4: Connect the Arduino GND pin to the negative power rail on the breadboard.

Step 5: Write a sketch that reads in Analog Pin A0 and prints to the Serial Monitor!

Here is a sample code to get ya started.

Visualizing Data: Arduino IDE!

The Arduino IDE comes with built-in tools to visualize data. We’ve already explored the basics of the Serial Monitor which allows us to print sensor values. If you want to save and analyze your data, copy the output directly from the Serial Monitor and paste into a text editor, spreadsheet, or other data analysis tool.

The second tool we can use to see our data in the Arduino program is the Serial Plotter, a visual version (aka graph) of the Serial Monitor. To use the Serial Plotter, go to Tools –> Serial Plotter. The graph below is the output of the LED as a light sensor from Project 3!*

The plot will auto-scale and as long as you’re using Serial.println() for your sensors, it will also print all of your sensors in different colors. Hooray! That’s it!

*If you look at the end, there is a super interesting wave pattern which is likely due to the Alternating Current (“AC”) in our overhead lights!

Visualizing Data: Excel!

For more serious data analysis, there’s a super cool (and free!) add-in for Excel called Data Streamer*, which you can download here.

This add-in reads from the serial port, so we can use the exact same coding technique of printing data to serial to get data directly into Excel.. heck yes!!

How to use the Data Streamer Add-In:

1. Once you’ve installed it (or if you have O365), click on the Data Streamer tab (far right) in Excel.

2. Plug in your Arduino and click “Connect Device”, then select the Arduino from the drop-down menu.

3. Click “Start Data” to start data collection! You’ll see three new sheets open up: “Data In”, “Data Out”, and “Settings”.

Live data is printed in the Data In sheet.  Each row corresponds to a sensor reading, with the newest value printed in the last row.

By default we only get 15 rows of data, but you can change this by going to “Settings”. We can gather up to 500 rows (limit is due to Excel bandwidth — there’s a lot happening in the background!).

 

4. Add a Plot of your data! Do some data analysis!
Scatter plots show you how the sensor readings change over time, which is the same thing we saw in the Arduino Serial Plotter.

To add a Scatter Plot:

Go to Insert -> Charts -> Scatter. When the plot pops up, right click on it and choose “Select Data”, then Add. We want our data displayed on the y-axis, with “time”** on the x-axis.

To do this, click the arrow next to the y-axis, go to the Data In sheet, and select all of the incoming sensor data.

We can also do calculations and comparisons in Excel! To write a formula, click on an empty cell and type an equals sign (“=”), then the calculation you want to do. There are lots of built-in commands like average, maximum, and minimum.

To use a command, type the equals sign, the command name, and an open parenthesis, then select the data you’re analyzing and close the parentheses.

5. To send more than one column of data (AKA more than one sensor), print the values on the same line separated by a comma, with a final blank new line, like this:

Serial.print(sensorReading1); 
Serial.print(","); 
Serial.print(sensorReading2); 
Serial.print(","); 
Serial.println();

*Full disclosure: Although this tutorial is not affiliated, I do work w/ the Microsoft Hacking STEM team which developed this add-in.

**If you want the actual time to be on the x-axis, select the timestamp in Column A on the Data In sheet for the x-axis values in your Scatter Plot. Either way, we’ll see our data as it changes over time.

Go Forth and Measure All the Things!!

Alright folks, that’s all! Time to go outward and upward! Use this as a foundation to start exploring sensors, Arduino coding, and data analysis to tackle your questions, curiosities, and fav mysteries in this big, beautiful world.

Remember: there are lots of folks out there to help you along the way, so please leave a comment if you have a question!

Need some more ideas? Here’s how to make a wearable state change switch, a solar-powered remote temperature sensor, and an Internet-connected industrial scale!

Like this tutorial and want to see more? Support our projects on Patreon! 😀

A Beginner’s Guide to Microcontrollers

What do remote controllers, routers, and robots all have in common? Microcontrollers! These days, beginner-friendly microcontrollers are easy to build with and program using just a laptop, a USB cable, and some (free) open-source software. The catch? There are like, 4324302* different microcontrollers and it can be daunting to get started, especially if you’re just getting into electronics. Where the heck do you start?!

Right here, bbies, I got chu. Whether you are looking to build some cool electronic projects, learn programming/tech, or wanting to teach others about electronics, this tutorial will help you figure out what microcontroller is right for your needs, goals, and budgets. Yay! Let’s get started!

Read Time: ~ 20 min

*Ok, ok, maybe not *that* many, but definitely a few dozen!

 

Wait…What is a microcontroller??

Maybe you’ve seen this word and were like “uhhh..?” but didn’t feel comfy enough to ask*. Totally fine, here’s a quick rundown:

A microcontroller is a “simple computer” that runs one program in a loop. They are designed to perform a single, specific task.

In this guide, we’ll be focusing on microcontrollers that have breakout boards, or a board that makes it easier to connect to and program the microcontroller.

On a breakout board, the microcontroller pins are soldered to a printed circuit board (“PCB”), headers or other connectors are added to the PCB, and some basic firmware, or permanent software, is loaded to prep the microcontroller to receive signals.

*Questions are always good even if they are “dumb” or “n00by”, just find a safe space — like this site or Instructables!

What’s the Difference Between the Raspberry Pi and a Microcontroller?

The Raspberry Pi is not only small and adorable, it is also a full-fledged computer! 😀

Computers have microprocessors AND microcontrollers that work together to perform many tasks at once.

The microprocessor is what does the “heavy lifting” in a computer. It performs the instructions and calculations that make the computer work. Microprocessors are much faster than microcontrollers, but they need external resources like RAM, Input/Output ports, etc., whereas a microcontroller is typically self-contained.

Computers (which are microprocessors) can run multiple programs at a time — you can surf the Internet, reminisce with old photos, write a paper, and have like 1000 tabs open all at the same time! Microcontrollers… not so much. You can do one of those things, but not all.

To learn more about the Raspberry Pi, check out the last section of this tutorial!

Arduino (Uno)

A robust, open-source microcontroller and programming environment designed for beginners with some knowledge of circuits.

Recommended Ages: 12+ (or kids comfy with programming and algebra)

Difficulty: Intermediate

Average Cost: ~$35

There are lots of different types of Arduino boards. This is the Arduino Uno, the best fit for beginners! There are boards that are larger, smaller, wearable, and for specialty use cases like robotics.

Being familiar with Arduino boards and programming maps well to projects and careers in computer science, engineering, and design.

Hardware Features

  • The Arduino Uno has 14 Digital Input & Output (“I/O”) pins, 6 Analog I/O pins, 2 Power Out pins (3.3V and 5V), and 3 Ground (GND) pins.
  • Power input can be anywhere from 5 to 12 VDC
  • The ICSP header (right side in both photos) allows you to connect a ton of different add-on boards called “shields”.
    • For example, you can add a WiFi shield to connect your Arduino to the ‘net!

Example Project: 

Robot Mini Golf Obstacles

Motion-Reactive Shake the Maze Game!

Purchase/Learn More: Arduino Website (www.Arduino.cc)

Micro:Bit

A friendly lil’ microcontroller handy for kids and folks just getting started with coding and hardware.

Recommended Ages: 8+ (or kids comfy with circuits and simple tools)

Difficulty: Beginner

Average Cost: ~$15

The Micro:Bit is a great tool to start learning how to code, teaching others, particularly elementary school students, how to code, and making simple and quick electronic prototypes.

The Micro:Bit is a collaboration between Microsoft and the BBC to bring educational computers into classrooms around the world.

Hardware Features:

  • The Micro:Bit has 3 Digital and Analog I/O pins, 1 Power Out pin (3.3V), and 1 Ground (GND) pin
  • Power input should be 3 – 5 VDC via micro USB cable or battery pack connector.
  • It also has lots of onboard inputs, outputs, and sensors!
    • 5×5 (25) LED matrix
    • Two (2) Pushbuttons (A, B)
    • Radio Transmitter and Receiver
    • Accelerometer
    • Compass
    • Light and Temperature Sensors
  • For more I/O pins, grab a Micro:Bit breakout!

Example Project: 

Text Messenger Puppet!

Purchase/Learn MoreMicro:Bit Website

Circuit Playground Express

A versatile microcontroller great for kids and folks just getting started with coding and hardware.

Note: There is also the Circuit Playground Classic — the hardware is nearly identical, but this board is programmed in the Arduino IDE.

Recommended Ages: 8+ (or kids comfy with circuits and simple tools)

Difficulty: Beginner

Average Cost: ~$25

The Circuit Playground Express, or CPX, is a helpful tool to learn how to code, teach others how to code, and make quick prototypes for beginners to experts alike.

The Circuit Playground Express is a powerful and versatile microcontroller created by Adafruit Industries.

Hardware Features

  • The CPX has 7 Digital/Analog Input & Output (“I/O”) rings that are also capacitive touch!
    • 1 “true” Analog I/O ring
    • 2 Power out ring (3.3V)
    • 3 Ground (GND) pins
  • Power input should be 3 – 5 VDC via micro USB cable or battery pack connector.
  • There are also tons of onboard inputs, outputs, and sensors!
    • 10 Mini Neopixels (can be all colors)
    • 2 Pushbuttons (A, B)
    • 1 Slide Switch
    • Infrared Transmitter and Receiver
      • Can receive/transmit remote control codes, send message between CPXs, and act as a distance sensor
    • Accelerometer
    • Sound sensor and mini speaker
    • Light and Temperature Sensors

Example Project:

 Minecraft Gesture Controller!

Purchase/Learn More: Adafruit Industries

Makey Makey

An interactive introductory microcontroller great for young kids and folks new to electronics and coding, especially for those who want to play with technology without having to build circuits and code.

Recommended Ages: 5+ (or kids comfy with simple tools)

Difficulty: Beginner

Average Cost: ~$50

The Makey Makey is a great first step into electronics and technology — no programming required! Connect alligator clips to the pads and then connect any somewhat conductive material, like hands, fruit, or metal objects, to trigger certain keyboard and mouse keys.

The Makey Makey is an Arduino-compatible board, meaning that you can also reprogram it using the Arduino Integrated Development Environment (“IDE”).

Hardware Features

  • The Makey Makey has six (6) capacitive touch pads on the front of the board:
    • Four control the keyboard arrow keys,
    • One controls the spacebar, and
    • One controls the left mouse click.
  • On the back of the board are header pins for more controls (also capacitive touch):
    • Six (6) pins that map to letters,
    • Four (4) pins that map to arrows,
    • Two (2) pins that map to mouse keys, and
    • One (1) pin that maps to the spacebar key.
    • There are also three (3) general I/O pins, a 5V power pin, and a ground pin.

Example Projects

Beginner: Floor Piano

Intermediate: Interactive Survey Game!

Purchase/Learn More: Makey Makey website

Other Common Boards

There are waaaay too many microcontrollers to cover in one tutorial. If you have a super specific specialty need, there is probably a microcontroller for that (just like apps!). To get a feel for some of the other boards not mentioned in this tutorial, peruse the inventories of SparkFun Electronics and Adafruit Industries and/or ask folks in the field!

Here are a few of my favs:

Particle Photon

Similar to the Arduino Nano, the Photon is a WiFi connected microcontroller that can be programmed wirelessly. The easiest setup uses a (free) smartphone app, but if can also be programmed directly via USB in almost the same language as Arduino*.

Recommended Ages: 12+ (or kids comfy w/ circuits and coding)

Difficulty: Intermediate

Cost: ~$20

For more info and to get the Photon setup, visit the Particle online store here.

Example Project

IoT Industrial Scale

*Wiring is the code framework, so most Arduino code will work without modifications. Can also write in C/C++ or ARM assembly

Adafruit HUZZAH ESP8266 Breakout

A super small, super cheap (and currently very popular in the IoT* community) WiFi microcontroller. You’ll need an FTDI or console cable. You can use the Arduino IDE to program this board or NodeMCU’s Lua Interpreter.

Recommended Ages: 14+ (or kids comfy w/ hardware & software)

Difficulty: Intermediate++

Cost: ~$10

For more info, visit the HUZZAH Adafruit product page.

(SparkFun also has a similar board, the “ESP8266 Thing”, which you can find here for ~$15.)

*IoT stands for “Internet of Things”, which is the term that refers to connecting and controlling various hardware devices, like sensors and household electronics, to the Internet.

Adafruit Trinket M0

A teeny tiny yet powerful microcontroller that blurs the lines between computer and microcontroller (it has an ATSAMD21E18 32-bit Cortex M0 processor). It can be programmed with Circuit Python or in the Arudino IDE.

Recommended Ages: 14+ (or kids comfy w/ hardware & software)

Difficulty: Intermediate

Cost: ~$9

For more info, visit the Adafruit product page for the Trinket M0.

There are a TON of other M0 boards, similar in scope to the Arduino Zero connectable microcontrollers. If this doesn’t suit your needs or your fancy, search around on the Adafruit and SparkFun websites!

Wearable Microcontrollers

There are also a handful of microcontrollers designed for wearable projects!

What makes these special is that they can be washed, so you don’t have to rip them out of the awesome project you made (but do remove the battery!).

Wearable microcontrollers also have special I/O pins that make it easier to sew into clothing and stitch circuits with conductive thread. Here are a few of my favs:

Adafruit FLORA

A circular sewable microcontroller with 14 inputs and outputs. Can be washed (but def remove the battery).

Recommended Ages: 12+ (or kids comfy w/ circuits and coding)

Difficulty: Intermediate

Cost: $15

For more information, visit the Adafruit FLORA product page.

Arduino Gemma

A lil’ tiny sewable microcontroller with 3 inputs and outputs. Perfect for hiding, connecting to small objects, and creating jewelry.

Recommended Ages: 12+

Difficulty: Intermediate

Cost: ~$5

For more information, visit the Arduino Gemma product page.

Arduino Lilypad

A circular sewable microcontroller with 14 available inputs and outputs.

Recommended Ages: 12+

Difficulty: Intermediate

Cost: ~$25

For more information, visit the SparkFun product page for the Lilypad.

 

Raspberry Pi 3

The Raspberry Pi, or Pi for short, is a credit-card sized computer* that runs a special version of Linux and can be programmed to control hardware.

Recommended Ages: 12+
Or kids comfy with coding and algebra

Difficulty: Intermediate (easy as a computer)

Average Cost: ~$35

The Raspberry Pi computer, or Pi for short, can be used as a “standard” computer or as a controller for all sorts of hardware projects. It is a great first computer for kids to use and learn to code on, and is widely used by hardware experts to build all sorts of electronic projects, from robots to 3D printers to home automation systems!

The Raspberry Pi has changed the way we build electronics! There are a few different versions, the most recent is the Raspberry Pi 3 and the Pi Zero, a miniature version of the Pi 3 for just $10.

Hardware Overview

  • The recommended Operating System (“OS”) is a special version of Linux called Raspbian.
  • The Pi has 40 General Purpose Input and Output (“GPIO”) pins.
    • 26 Digital I/O pins (no Analog I/O)
    • 4 Power Out pins (two 3.3V and two 5V)
    • 8 Ground (GND) pins
    • 2 Specialty Pins (I2C ID EEPROM, advanced use only)
  • The Pi also has most standard computer features:
    • 4 USB Ports
    • 1 Ethernet port
    • 1 HDMI port
    • 1 Audio Jack
    • 1 Camera Module Port

Example Projects

Local Cloud Server

IoT Pet Monitor! (Raspberry Pi Zero)

Impact Force Monitor

Purchase/More InfoRaspberry Pi Foundation

*The Pi can be used similar to a standard microcontroller AND can also control microcontrollers! Basically, the Pi is super awesome and I *have* to include it even tho it is technically a computer 🙂

Final Thoughts

If you are just getting started and want to build all sorts of projects, I’d recommend the Circuit Playground Express. It’s super easy to get up and running and has a ton of onboard gadgets.

If you are super interested in computer networking, AI, or connecting things to the Internet (e.g. making a “Smart Home”), I’d suggest the Raspberry Pi.

If you want a sturdy, stable, and reliable board to build a wide variety of projects, go with an Arduino.

If you still have no idea where to start and are totally intimidated, start with the Micro:Bit — it’s only $15 and has plenty of snazzy things on it to play with. Plus, if you get one for your friend, you can send lil’ messages back and forth 🙂

The best advice I can give you is to find a project you are passionate about and build it! There are tons of tutorials online so search around for someone who has built the same or similar project. Build off of their findings and adjust as you please!

And of course, leave any related questions in the comments and I’ll do my best to help!

Happy hacking!

Turn your Pi into a (local) Cloud Server!

Save and access docs and photos and music on your own local Pi Cloud* server! The best part: you can use it if, or when, the Internet goes down (or if you’re in a remote spot & want access to Wikipedia). Oh hey, and if your friend gets one and they live close (*ahem*80ft*ahem*), you can share stuff with them and make your own personal chat line!

That gets me thinking.. if enough folks built Pi Cloud servers, we could crowdsource the Internet! That would be an 11/10 on a scale of greatness. With the new models of the Raspberry Pi computer, it’s possible and not even expensive! (What! Tell me more!)

This tutorial will show you how to set up a short-range (~ 80 ft) WiFi Access Point and a personal web server (‘bringin it back to HTML bbies). You can set this up as a (closed) local network only (i.e. your own personal “cloud” backup device), or broadcast it to the rest of the world! (..if you do this be sure you know network security.)

That said, assuming you have a basic knowledge of the Pi, here’s the breakdown:

Read Time: ~ 40 min

Build Time: ~ 60 min (less if you are experienced w/ Linux)

Cost: ~ $35 (for the Pi 3)

If you are interested in using this to crowdsource a people’s Internet, share it w/ your friends & family & everyone you know (or build it for them!). If you build this project please mark that you’ve built it so we can get a sense of how many folks have the infrastructure we need to actually make a full-fledged people’s Internet. Lastly, follow me to stay updated (I am reaching out to some folks to try to get this to be a real thing, please feel free to contact me if you can help and/or take this on, it is open-source!).

 

New to Linux & Terminal Programming?

We’ll need to be able to access our Pi remotely (e.g. via SSH). If you’re like “wtf is that”, check out this introductory tutorial for a more thorough overview on how to set up the Raspberry Pi 3 and some quick Linux terminal programming.

This approach to the Pi Access Point* and web server** uses the Jessie Lite OS. If you follow this tutorial line-by-line, you will need this specific version of Linux.

Lastly, this tutorial is built off of the Adafruit Digital Free Library tutorial, so check that tutorial if you run into any issues (or leave a comment and myself or another helpful folk will attempt to answer your question 🙂 )

(Also, this might feel a bit long, so I’ve included various cute puppy photos throughout to keep you motivated :D)

*An Access Point is hardware device that allows a WiFi device (e.g. smartphone) to connect to a wired network (e.g. router).

**A web server is a computer that delivers a web page. When you go to your favorite websites, you type in “www.wikipedia.org” which takes you to the IP address for the web server and displays public information.

Warning: it is recommended to run your Pi as a local network only (i.e. do not connect the Pi to the broader World Wide Web) as the WPA2 password protocol may not be secure.

Materials

– Computer with Ethernet port & SD Card slot

– Raspberry Pi 3

– SD Card (8GB or larger, esp. if you want to use it for storage)

– MicroUSB to USB power cord

– Ethernet Cable

– RecommendedRaspberry Pi Case

Software Programs

1. PuTTY allows us to remotely log in to the Raspberry Pi using the Pi’s IP address, username, and password.

Download here: ​http://www.putty.org/

2. Etcher formats and writes the Raspbian (or other) Operating System (“OS”) to an SD card.

Download here:​ https://etcher.io/

3WinSCP allows for easy file transfer between your computer and the Raspberry Pi.

Download here (click on Installation Package): ​https://winscp.net/eng/download.php

4. Windows computers will need Bonjour print services for Windows (from Apple) to use the “raspberrypi.local” IP address.

Download here: ​https://support.apple.com/kb/dl999?locale=en_US

 

Quickstart

If you’ve worked with the Pi before and are comfortable w/ the Linux terminal and such, here’s a quick overview of this process:

1. Load Jessie Lite onto an SD card (8GB or more) and insert into the Pi.

Download the Jessie Lite OS here.

2. Remotely log in (e.g. SSH) and enter credentials.

3. Here’s a Github repository with all of the commands to turn your Pi into a web server 😀

Go through the Setup file and input the commands (in order). This process will install HostAPD (authentication), DHCP (IP management), iptables (firewall), and Apache (web server software).

4. Create a public web page or keep your files/data private/w/ friends & family.

A sample HTML web page adapted from the Adafruit Digital Free Library tutorial is included in the Github repository (ServerWebsiteHTML-Raw). You can also use the larger zip file to build off of 🙂

Warning: it is recommended to run your Pi as a local network only (i.e. do not connect the Pi to the broader World Wide Web) as the WPA2 password protocol may not be secure.

 

Set up the Raspberry Pi

1. Flash the SD card with Jessie Lite (​download Jessie Lite here). Enable SSH by adding a file named “SSH” in the SD card file contents (no extensions — remove the .txt if any added automatically). Insert into the Pi.

2. Plug in the Ethernet cable between your computer and the Pi, then plug the Pi power cable.

3. Create a network bridge between your computer and the Pi.

Go to Settings -> Network & Internet -> Change Adapter Settings. Select the Ethernet connection (should show an unknown connection or something similar). Hold the “CTRL” key, and then select the WiFi connection. Right click and choose “Bridge Connections.”

3. Open PuTTY, type “raspberrypi.local” for the hostname, and log into your Pi, woo!

If you are logging in for the first time, use the default username: pi and password: raspberry . Change your password using the command passwd .

4. Check that the Pi is connected to the Internet and update it.

Run this command to check if the Pi can connect to Google (it will print 5 lines saying it if received information from google.com):

ping -c 5 google.com

Run this command to update the Pi:

 sudo apt-get update
 sudo apt-get upgrade

Install Apache

Apache is our web server software! (It allows us to easily host information and files accessible via a web browser like Chrome, Firefox, Explorer, etc.).

Let’s install the Apache software and then change permissions to edit the HTML folder. Type and enter the following commands (in order):

sudo apt-get install apache2 -y
cd /var/www
sudo chown pi:pi /var/www/html
cd

Install Server Software!

1. Install HostAPD and DHCP software.

HostAPD is used to authenticate information sent and received from connected devices, and DHCP is a protocol used to provide quick, automatic, and central management for the distribution of IP addresses within a network.

To install both at once, type the following command and then press “y” to continue:

sudo apt-get install hostapd isc-dhcp-server

2. Install iptables for a firewall. (yayy for security!)

Run this command and type “y” (yes) to both of the config screens that pop up:

sudo apt-get install iptables-persistent

Edit the DHCP Configuration File

Let’s set up the DHCP communication protocol so we can send and receive information (pretty important if you’re thinking of building a connected network)! Go to the DHCP configuration file by typing the following:

sudo nano /etc/dhcp/dhcpd.conf

1. Add a comment (“#”) in front of the following lines (so it looks like the file in Photo 1):

option domain-name “example.org”;

option domain-name-servers ns1.example.org, ns2.example.org;

2. Remove the comment (“#”‘) from the “authoritative” line (Photo 1 also helpful here):

#If this DHCP server is the official DHCP server for the local network, the authoritative directive should be uncommented.

#authoritative;

3. Add this code to the very end of the file:

subnet 192.168.42.0 netmask 255.255.255.0 {    
    range 192.168.42.10 192.168.42.50;     
    option broadcast-address 192.168.42.255;
    option routers 192.168.42.1;
    default-lease-time 600;
    max-lease-time 7200;
    option domain-name “local”;
    option domain-name-servers 8.8.8.8, 8.8.4.4;
}

What is this doing?! To (very briefly) summarize, it sets up a range of IP addresses to assign to connected devices (from 192.168.42.10 to 192.168.42.50), just like your home router! It also tells the Pi how to communicate to other devices (its broadcast address, 192.168.42.255, and its own IP address, 192.168.42.1). It assigns an amount of time (in sec) to share this connection (lease time), and sets up domain name servers (like looking up a phone number in a directory).

4. Save and exit by pressing “Ctrl – X” and then “y” (and then the enter key).

Edit the Default DHCP Server File

Let’s edit the DHCP server file so that we can assign it to broadcast via WiFi! Go to the DHCP default server file by typing the following:

sudo nano /etc/default/isc-dhcp-server

1. Scroll down to the line that says INTERFACES=”” and change it to broadcast via wlan0 (that’s a zero, not an O):

INTERFACES=”wlan0”

2. Save and exit by pressing “Ctrl – X” and then “y” (you’ve probably figured this out key combo by now so I’ll stop mentioning it 🙂 ).

 

Set Up a Static IP Address

1. Let’s give our Pi a static (unchanging) IP address so that we can always find it, yay! Temporarily disable the wireless interface network:

sudo ifdown wlan0

2. Use the nano text editor program to edit the network interfaces file (which you probably figured out by reading the command (: )

sudo nano /etc/network/interfaces

3. Edit the file so that it looks exactly like the following, then exit & save (also check out the photo below):

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.42.1
    netmask 255.255.255.0
#iface wlan0 inet manual
#wpa-roam /etc/wpa-supplicant/wpa_supplicant.conf
#iface default inet dhcp

4. Assign a static IP:

sudo ifconfig wlan0 192.168.42.1

Configure the Access Point Details

1. Create a new configuration file named “hostapd”:

sudo nano /etc/hostapd/hostapd.conf

2. Write the following (exactly as-is) in this new configuration file (then exit & save) (see photo below):

interface=wlan0
ssid=HelloWorld #Name of your RPi WiFi connection
country_code=US #Unless you are elsewhere!
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2 #This is the password protocol
wpa_passphrase=raspberry #Change the password!
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_group_rekey=86400
ieee80211n=1
wme_enabled=1

3. Tell the HostAPD protocol where to find this new file.

Edit the default HostAPD file:

sudo nano /etc/default/hostapd

Find the line that says #DAEMON_CONF=””. Remove the comment and edit it so that it looks like this (see photo below):

DAEMON_CONF=”/etc/hostapd/hostapd.conf”

Edit the HostAPD initialization file:

sudo nano /etc/init.d/hostapd

Find the line that says DAEMON_CONF=. Edit it so that it to point to your new configuration file! Like this (Photo 3):

DAEMON_CONF=/etc/hostapd/hostapd.conf

Configure Network Address Translation (“NAT”)

This step allows for multiple clients (like all your friends!) to connect to the Pi’s WiFi at once (play all the games!!). It is a bit technical, so I’m gonna gloss over the deets (also not terribly familiar with this part), but it will get you through the process.

Note: you only need the iptables shenanigans if you want to connect your local access point to the greater World Wide Web.

1. First, we need to start IP forwarding every time the Pi turns on. Enter the following command to edit the sysctl* configuration file:

sudo nano /etc/sysctl.conf

— Scroll to the bottom and type this code on a new line, then exit & save:

net.ipv4.ip_forward=1

*btw that is an L in sysctl, not a 1, which I have messed up soooo many times -.-

2. Activate IP forwarding by typing:

sudo sh -c “echo 1 > /proc/sys/net/ipv4/ip_forward”

3. Create network translation between the Ethernet port eth0 and the WiFI port wlan0 by typing the following commands (w/ – signs and caps and such):

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

4. To ensure network translation happens when we reboot the Pi, run this:

sudo sh -c “iptables-save > /etc/iptables/rules.v4”

Test that Access Point!

1. Run hostapd with our configuration file manually with this command:

sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf

2. Check the WiFi list on your computer or smartphone and find your new access point SSID! If you didn’t change anything, it will be named “HelloWorld” with a password of “Raspberry”.

If you connect successfully, you will get some text on the Raspberry Pi screen. We won’t see much yet, but we are very close!

3. Cancel the test by typing “Ctrl+C” in the Raspberry Pi console.

You can check the status of the host AP server and the DHCP server with the following commands:

sudo service hostapd status
sudo service isc-dhcp-server status

 

Set up a Daemon!

A daemon is a program that starts automatically every time the Pi is powered on and runs in the background (not quite like the “His Dark Materials” series..).

1. Start the hostapd and dhcp programs:

sudo service hostapd start
sudo service isc-dhcp-server start

2. Run these next two commands to enable hostapd and dhcp to start automatically when the Pi turns on:

sudo update-rc.d hostapd enable 
sudo update-rc.d isc-dhcp-server enable

Almost there! Create an HTML Web Server!

1. Write an HTML page to host on your web server! Or download one I adapted from the Adafruit Digital Free Library 🙂

Here’s the zip file, and here’s the GitHub repository. Save and unzip the file.

2. Open WinSCP and enter the hostname: raspberrypi.local

3. Log in to the Pi (type the username and password).

4. On the Pi side of the screen (right side), go to the home directory.

Click the folder with the up arrow on it two times.

5.Go to the /var/www/html file.

Double-click on the folder labeled “var”, then the “www” folder”, and finally the “html” folder.

6. Delete the existing index.html file (or if you want to write your own you can just open and edit it).

7. Copy the web server files into the Pi html folder.

On the left side of the screen (your computer), go to the folder where you saved the files. Highlight and drag the contents (two folders and a file named “index.html”) into the Pi html folder. That’s it!

8. Open a browser and type “raspberrypi.local” in the navigation bar at the top. If it worked, you will see the web server page, what what!

Edit the HTML Pt. 1

Change up the HTML file to share the info and documents that you want!

1. Open the index.html file on the Pi.

2. Edit the headers and descriptors in the index.html file.

— Change the title of your web server by editing the text between the title parts:

<title> jenfoxbot's Local Web Server!</title><br>

— Change the heading of the webserver by editing the text between the h2 and center parts (line 51):

<h2> <center> 
jenfoxbot webserver
</center> </h2>

— Optional: Change the description of the webpage (line 55):

<pre><div><center>
<p>Depending on the position of the moon & stars*, 
this hotspot may or may not provide an Internet connection.</p>
<p> If there IS an Internet connection, check out <a href="http://www.foxbotindustries.com" style="font-size: 12.15px;">jenfoxbot's website</a> 
and learn about the other cool stuff she does! </p>
<p><i style="font-size: 12.15px;">*And by position of the moon & stars we mean the current whims of the builder, jenfoxbot :) </p> </i>
</center></div>

3. Optional: Delete existing documents, images, and videos and add your own!

Store PDFs in the “issues” folder and photos in the “images” folder. You can also create other folders to store different files.

Edit the HTML Pt. 2

1. Add your own documents!

— Decide what you want to include on your server and download PDFs of those docs. Also download images for each of the documents so you’ll have something fun to click on 😀

— Using WinSCP, add your documents to the appropriate folders.

— Edit the index.html or other appropriate html file (e.g. if you want to add or change a book in the helpful info page, edit the “helpfulinfo.html” file).  Display your documents and images by changing the file names and extensions and update the descriptions.

2. For folks new to code, you can add more documents by copying and pasting the existing code and changing the file names and extensions!

Here’s a helpful overview on HTML from the Khan Academy!

OMG Finally! We’re Done 🙂

Unplug the Ethernet cable, connect to your wireless access point, and then type in the IP address in the address bar of your favorite browser (192.168.42.1 if you followed this tutorial exactly).

If everything is working, you’ll see your web page (like the screenshots of mine above and below). Woohoo you just created a wireless access point!! (If it didn’t work, run through the setup again and double check that all the terminal code is exactly as shown, including spaces and such).

Explore your very own local Cloud website and decide how you want to use it from here!

What’s Next?

One option is to use it as a local wireless storage device. Plug in the Pi, connect to the WiFi access point you set up (this one is named “HelloWorld”), and store or withdraw files from it. You can access these files even if you are disconnected from the Internet. So you could save your favorite movie and still watch it when the power goes out 🙂 (er, assuming you have a charged laptop).

Add more documents (e.g. you can use it as backup storage), play around with the HTML code to make your site all fancy, and have fun!

Another option is to configure this as a public-facing web page and assign it a domain name so other people can access the files. This is particularly helpful if you are going somewhere without WiFi or cable Internet — you can take Wikipedia with you! (but maybe donate to them if you do that ’cause they are awesome). If you are comfortable with code, you can set this up to be an automatic backup server, a local wireless game server for you and your friends, etc. Get creative!

If you go this route, be sure you know a bit about network security as the WPA2 password protocol has recently been compromised (sad panda..).

Finally, as mentioned in the intro, you can use this Cloud server to kickstart a people’s Internet! Have a build day with your friends to create a bunch of Cloud servers so that you all can “talk” to each other! This approach isn’t necessarily the *best* (aka most efficient/effective) way to build a public Internet, but it’s a great starting point. Plus, the better we understand how these technologies work, the better we use them to solve serious problems and advocate for ourselves and our communities. 🙂

Intro to the (Headless) Raspberry Pi!

Finally! Use your Raspberry Pi without spending what feels like forever connecting external peripherals and dealing w/ a cable monstrosity: Configure your Pi to be headless! (not the scary kind tho) This is particularly helpful for folks teaching workshops with the Raspberry Pi, since it can be cumbersome (and expensive) to provide monitors, keyboards, and mice for every student.

I’m assuming that y’all know a bit about the Pi, so this tutorial will not cover what the Pi is or it’s awesome capabilities (I’m lookin’ at you, GPIO pins!). To learn more about what the Pi can do, check out some of my other tutorials (see the last section in this tutorial) or leave a comment.

What is covered in this tutorial: Enabling and using SSH, a general overview of the Linux terminal window, and how to connect to the Pi’s GUI (Graphical User Interface, aka the Desktop view) via SSH.

Read Time: 15 min

Build Time: ~20 min

Cost: Free! (assuming you already have an RPi and Ethernet cable)

Materials

Computer with Ethernet port & SD Card slot

– Raspberry Pi 3

– SD Card (8GB or larger)

– MicroUSB to USB power cord

– Ethernet Cable

– RecommendedRaspberry Pi Case & GPIO cable

Software

For this project, you’ll need the following (free!) software programs:

 

Configure the SD Card

1. Download your favorite flavor of Raspbian! You can get the most recent version here.

2. Insert your SD card and open Etcher.

3. Select the Raspbian zip file, the driver for your SD card, and click “format”.

4. Enable SSH access

Open the file contents for the SD card. Add a new text file titled “SSH”. If the computer adds a file extension (e.g. “.txt”), delete it and ignore any warnings.

5. Eject the SD card and insert it into your Pi.

 

Let’s Get Connected!

1. Plug in the Ethernet cable between the Raspberry Pi & your computer.

2. Plug in the USB power cable.

Check that the red power light turns on and that the Ethernet port lights (yellow & green) are on and/or blinking.

3. Connect the RPi to the World Wide Web (aka the Internet).

Go to Settings -> Network & Internet -> Change Adapter Options (aka Network Connections).

Click on the Ethernet connection, hold down “CTRL”, and then click on your WiFi connection.* Right-click in the window and select “Bridge Connections” — this will bridge the connection between the Ethernet port to your WiFi port.

*If you select the WiFi connection first, it will bridge the connection from the WiFi to the Ethernet, which would allow you to log into the Pi but not connect to the Internet.

4. Open PuTTY and log in to the Pi using the “raspberrypi.local” IP address.

Default username: pi

Default password: raspberry

5. Change the default password by typing passwd and following the prompts.

 

Navigating the Linux Terminal Window (Shell)

The terminal window is the control panel for the system.

It typically shows a command prompt, which gives us information but is not part of the commands to the system. Most commonly the command prompt displays the user’s login name and the current working directory (represented by a twiddle: ~ ).

Inputting Commands

Commands are written after the prompt and inputted by pressing the Enter key.

Commands can be issued as-is or followed by one or more options. Options usually have a dash in front of them, like the following:

ls -a

You can view the options for a specific command by typing the command name followed by “–help” (will cover this more later).

 

 

 

 

 

 

 

 

Linux Hot Keys!

There are a handful of special key combinations that make navigating the terminal window easier and faster. Here are a some of the most common ones:

  • Ctrl+A – Move cursor to beginning of command line
  • Ctrl+E – Move cursor to end of command line
  • Ctrl+C – End running program
  • Ctrl+D – Logout of current session
  • Ctrl+R – Search command history
  • Ctrl+Z – Suspend a program

 

  • Left and Right arrow keys – Move cursor one place to the left or right on command line
  • Up and Down arrow keys – Browse command history
  • Shift+PageUp and Shift+PageDown – Browse terminal buffer (to see text that is off screen)
  • Tab – Command or filename completion
  • Tab Tab – Shows file or command completion options

Practice using these every time you are in the terminal window and you’ll quickly become a Linux wizard!

Getting Help in the Terminal

1. Manual and Information Pages

The manual pages are an exhaustive resource for all of the available commands in the Linux terminal window. To read the manual pages on a particular command, type the following:

man command

This will pull up the manual pages for the particular command that you are searching. Here’s the manual pages for the apropos command:

In the manual, the first line contains the name of the command you are reading about and the ID of the section that contains the manual page.

After the first line is a synopsis, which is a short description of the command that includes technical notation of all the options and/or arguments. Options are a way of executing the command, and an argument is what you execute it on. Optional arguments are put between square brackets.

After the synopsis is a longer description of the command, followed by a more in-depth overview of the available options, information about combining options, other related commands, and other information pertaining to the command.

Some commands have multiple man pages, like the “passwd” command. To see all pages about a command, use the “-a” option:

man -a passwd

The info pages contain more recent information and can be easier to use. Here’s what the menu of the info pages looks like:

To view the info pages on a command (replacing “command” with the actual name of the command you want to research, like “apropos”), type the following:

info command

To navigate the info pages, use the arrow keys to browse through text, the Enter key to read about a particular keyword, “P” and “N” keys to go to the previous or next subject, and the space bar to move one page further. Use “Q” to quit.

2. whatis and apropos commands

The whatis command gives brief information about a command and lists the first section in the man pages that contains a relevant page (in parenthesis after the command name).

If you’re entirely unsure where to start, the apropos command is a good way to search for keywords. For example, if you want to know how to start a browser, you can type apropos browser, which will pull up a list of all browser-related programs, including web browsers, file and FTP browsers, etc.

Here’s the apropos search results for “text”, which displays commands and programs that contain the phrase “text”:

 

3. Using the –help option

Most commands also have the option –help, which gives a short explanation of the command and a list of available options. When in doubt, this is a great way to get some quick and useful information on using a particular command and its possible extensions.

To use the –help option, type –help after a particular command, like the following example (also shown in the photo above):

apropos --help

The output looks like this:

 

Enough of the Terminal Window! Where’s the friggin’ Desktop??

Alright alright.. Remote Desktop Connection is an easy way to use the desktop view, also known as “Graphical User Interface,” or GUI for short.

1. Install Remote Desktop Connection on your Pi:

sudo apt-get install xrdp

2. Install Remote Desktop Connection on your PC (is already installed on Windows OS).

3. Open Remote Desktop Connection and log in using the “raspberrypi.local” IP (or find your Pi’s IP using command ifconfig). Ignore warning (click “yes”).

4. Log in with the Pi’s username and password.

If you haven’t changed your password yet, do so now. (Yes, I know I already told ya to do so but it is worth repeating since someone could actually hack into your Pi if you don’t change the default password.)

Now you can use the Pi’s GUI and do almost* everything via your PC!

*Sadly, we can’t play Minecraft in this mode as it uses too much data to be transferred via SSH. Using a VNC viewer is one option around this if you really want to play Minecraft remotely.

What is SSH, anyway?

SSH stands for “Secure SHell” — it is a “cryptographic network protocol for operating network services securely over an unsecured network.” – Wikipedia

… Uh, what?

In other words, SSH is a secure way to connect between one computer and another, even if the network through which you are connected is not secure.

For example, if you are on a shared network and you use SSH to remotely log into another computer, other folks on the shared network can’t see what you’re doing through the remote connection (although Snowden did release documents that showed the NSA can sometimes decrypt SSH).

Common uses of SSH include remote log in, like if you want to connect to a computer that lives a mile underground without having to, you know, actually go down there. (I used to work for a super cool dark matter experiment called DRIFT and this is how we would access the computers that controlled the detector because the computers lived in a mine about 3 miles underground.. too far to travel to update software!).

Here’s the full Wikipedia page on SSH — it’s super cool so check it out!

More to Explore!

Go forth and explore! Practice using the terminal window until you get comfortable and familiar with the basic commands.

Program the GPIO pins to do cool stuff! Need some ideas? Check out these tutorials:

1. Making a Soil Moisture Sensor

2. Building an Irrigation Controller (can be paried w/ Soil Moisture Sensor)

3. Bark Back: Install an IoT Pet Monitor

4. Expand on your Smart Home & add a Motion Triggered Music Player

Need parts?

Take apart old & broken electronics! Electronic toys are a great place to get motors and speakers. If you want better motors, take apart power tools.

Ask friends or find a repair shop for extra parts and wire, save power cables from old electronics and use them as power supplies or harvest them for wires and/or connectors, save old headphones and use them for audio projects.

Best piece of advice: think before you toss 🙂



			

Build an (easy) Floor Piano!

The household floor piano is a dream no more! The Makey Makey microcontroller makes it super easy (and affordable) to build your very own “foot-strument” out of common household materials.

Grab a Makey Makey kit, some cardboard, and your musician shoes and let’s get building!

  • Difficulty Level: Easy
  • Estimated Build Time: 60 minutes
  • Cost: $50 (for Makey Makey kit)

 

 

Materials & Tools

Materials

  • Makey Makey Kit
    • 16 Breadboard Jumper Wires
    • 4 Alligator Clips
  • Cardboard
  • Aluminum Foil
  • Plastic Trash Bag (stretchy is best)
  • Duct Tape

Tools

  • Scissors
  • Hot Glue Gun
  • Measuring Tape or Ruler

 

Build the Piano!

1. Build the piano base.

Cut a cardboard base for your keyboard, then divide it into 8 equally sized rectangles — these are the dimensions for your piano keys!

2. Make the piano keys!

Cut out 8 cardboard rectangles using the base dimensions and paint them white.

3. Build the key triggers for the piano.

Cut 16 cardboard rectangles of equal size or smaller than the cardboard piano keys.

Repeat the following for each pair of key triggers:

  • Cover both cardboard rectangles in aluminum foil.

  • Use copper tape to connect one wire to the aluminum foil on each of the key triggers, then cover the connection in duct tape to secure.

  • Cover one of the rectangles with a piece of the plastic trash bag so that the aluminum foil is completely covered. Secure with duct tape.
  • Sandwich the two key triggers together so that the trash bag is a barrier between the aluminum foil.

 

Connect to the Makey Makey!

1. Connect the wires to the Makey Makey – one of the wires goes to ground and the other goes to a keypad (doesn’t matter which wire).

2. Test that the Makey Makey is triggered when you put pressure on the cardboard.

3. Tape the key triggers to the bottom of the white cardboard piano keys. Secure them to the piano base with velcro or glue.

4. Connect one of the wires from each of the key trigger to the six header pins on the back of the Makey Makey board and to two of the arrow keys on the front.

5. Connect the other key trigger wires to the Makey Makey ground.

Recommended to connect the ground wires in two groups of 4, then use one alligator clip per each group of 4.

Write the Scratch Program!

We have 8 inputs, which means we can play an entire octave on our floor piano! (Yes, that was intentional).

Your job: Write a Scratch program that plays 8 successive keys starting at middle C (or wherever you prefer your piano octave to start) using the “play note” function. Or you can copy mine in the photo above 🙂

Aside from the program, just be mindful of what piano key is connected to what Makey Makey pin. It’s easy to get 8 wires a bit mixed up — consider labeling them to save yourself some time (& hair..).

Install & Play!

Consider coating the electrical connections in hot glue. Plug the Makey Makey into your computer, place your floor piano on, well, the floor, and have at it!

Enjoy making beautiful music by stomping on your custom creation.

Micro:Bit Puppet “Text Message” System

Intro

Nearly all of our wireless communication is done using radio waves*, including phone calls, text messages, and WiFi. With its built-in radio transmitters and receivers, the Micro:Bit microcontroller makes it super easy to build all sorts of projects with radio communication.

This particular project is a simple & quick way to send text messages between two Micro:Bit** microcontrollers – the sender writes a (short) message that is transmitted via radio to the receiving Micro:Bit, which shakes a lil’ puppet using a servo motor, and then displays the message on the Micro:Bit LED screen. Each Micro:Bit can be both a sender and receiver.

It’s sort of like a two-person Twitter.. if the tweet notified you via dancing cardboard robot puppet!

*Radio waves are long-wavelength light waves. Check out the electromagnetic spectrum here!

**A huge THANK YOU to Adafruit for donating the Micro:Bit microcontrollers used in this project for educational purposes! yayy thank you for supporting this educational endeavor!! 😀

Materials & Tools

Electronics

Puppet (or other Message Alert System) Materials

Tools

  • Hot Glue Gun
  • Scissors and/or utility knife (e.g. exacto knife)
  • Pencil
  • Ruler or other straightedge

Build the Incoming Message Alert Puppet!

Step 1: Build a cardboard puppet like the one shown in the photo or create your own! Use the paper fasteners to make joints.

Step 2: Build a mounting system to attach the puppet to the servo with skewers and cardboard.

I used a magnet to attach the puppet to the servo mounting system because magnets are awesome, but you can also use glue, tape, velcro, or a variety of other adhesives!

Step 3: Build a stand for the puppet.

  • On an approx. 6 in. x 12 in. cardboard sheet, measure, mark, and cut a hole for the servo body so that the arms of the servo rest against the front of the cardboard sheet.
  • Cut two triangles out of cardboard and glue them on the back of the stand so that the stand, well, stands upright!
  • Cut a hole for the Micro:Bit wires to thread through and add two pushpins on the front to hold the Micro:Bit.

 

 

 

 

 

 

 

Code the Two Micro:Bits!

To start, choose one Micro:Bit to be the sender and the other Micro:Bit to be the receiver. Once both are working as expected, add in the code for both roles.

Use the Make Code Micro:Bit website to program each Micro:Bit. As this is intended as a beginner project, the whole system can be built using the block-based programming language, although adaptations are encouraged and appreciated!

If there is more than one pair of Micro:Bits in the room (i.e. in a classroom setting), remember to set different radio group numbers for each pair.

The sender sends a (short) text based on user inputs over radio, like the example above. Pretty simple!

The receiver moves the servo when an incoming text is received, then scrolls the message text on the LED screen, like in the example below.

Press the reset button to stop sending/receiving the incoming message.

 

Connect the Servo!

Connect the servo red wire to the Micro:Bit 3V power pin, the servo black wire to Micro:Bit ground pin, and the servo white (or yellow) wire to the Micro:Bit input pin P0.

Send all the Messages!

Program both Micro:Bits to be both a sender and a receiver so you can communicate back and forth. Then switch power from the laptop to the battery pack and test out your wireless communication system! When the sender sends a message, the puppet will notify you to check the LED screen so that you can see the incoming message.

How far of a range can you get? Test it out!

There are tons of other extensions to this introductory project, here are some possibilities:

  • Add more message options by adding more inputs or changing how those inputs are read;
  • Instead of a table-top alert system, build a wearable alert system;
  • Send voice messages and/or other sounds.

Happy building!