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!

Mini Robotic Table

What’s better than a table with wheels? A table that you can drive around! This tutorial will teach you how to build your very own Mini Robotic Table, a project that was conceived and designed by one of my students (she was 10 when we started).

We built this table because, in the words of my student:

“I wanted to build something and I thought of a table and I thought of robotics and I smooshed them together. I like woodworking and I like robotics and I wanted to do something with the both of them.

We started w/ a full size table but that took a lot of time and money so we decided to make a tiny version, which is a prototype to the big one.”

We sized this mini table for American Girl Doll height (an American Girl doll is 18″ tall so we made the table to be 9″ tall), but you can adjust and modify depending on your needs. The most important thing to keep in mind is table weight, as a larger table requires larger motors and more battery power.

Difficulty level: Intermediate

Estimated build time: a few days to a week

Cost: ~ $75 – $100

Adult supervision required (lots of sharp and powerful tools involved)

 

Supplies

Materials

  • Wood
    • Table top: 8″ x 16″ (width x length)
    • Legs: 1.5″ x 1.5″ x 8″ (width x length x height)
    • Table Shelf: 8″ x 14″
  • Brackets (8)
  • Screws (28)
    • For brackets: 1.25″ screws
  • Axle, metal
    • We used the metal rod from an old (aka broken) french press
  • 4xAA Battery case and (4) AA batteries
  • Continuous rotation servos (2)
  • Small screws to hold wheels onto servo (2)
  • Radio controller and receiver
  • Servo Wheels (2)
  • Caster Wheels (3)
    • we used the same wheels as for the servo motors, but attached them to an axle instead of a servo.

Tools

  • Hot glue dispenser and glue sticks
  • Power Drill
  • Drill Bits
  • Screwdriver Bits
  • Saw
    • Or get pieces cut at your local hardware store
  • Sandpaper
  • Glue
  • Electrical Tape or heat shrink tube
  • Safety glasses
  • Dust mask
  • Scissors
  • Measuring tape
  • Level
  • Clamps
  • Optional:
    • Duct Tape
    • Velcro
    • Zip Ties

Tips, Tricks, & Extra Information (Please read before building!)

Before you build anything, read the full project instructions first!

Helpful info to have before you start this project:

1. Be prepared for drying time

2. How to use power tools and know safety rules.

Safety rules: put hair up, eye protection, roll up sleeves, no loose clothes, no jewelry that could get in the way, always have a second person in the room especially an adult if you are younger, dust mask.

3. Be prepared w/ the materials and tools you’ll need.

4. Document in a notebook as you work for reference later.

5. Find a radio controller that comes with a receiver. It is easier to put together the electronics if you get a controller and receiver together because it will take a lot more time to figure out which receiver will work with a particular controller, so get a controller that comes w/ the right receiver.

RC controllers can be very expensive, and other ones are super cheap and don’t work well. Read the entire description for the controller and receiver that you are interested in. The way we figured it out was by finding three options: one that was expensive, one that was in the middle, and one that was cheaper. We used our budget to help figure out the best option, and ended up selecting the option that was in the middle.

Build the Table!

Gather your woodworking tools, wood pieces, and brackets (see Supplies section for sizes). Remember to measure two or three times before drilling, gluing, and/or cutting 🙂

Step 1: Determine placement of legs and brackets and mark all bracket holes with a pencil. 

We used 2 brackets for each leg and 4 screws for each bracket, except for two brackets that overlap in between the legs.

It is helpful to use a tape measure to get placement as accurate as possible.

Step 2: Attach legs to the tabletop with brackets and screws.

A. Drill small holes in the tabletop and table legs to avoid cracking the wood. (See photo)

B. Attach two brackets to each leg.

C. Attach legs with brackets to table.

Step 3: Add the table shelf!

We cut ours to fit between the legs and attached with wood glue.

Tip: Add an object under the shelf while it is drying so the shelf does not move.

 

Step 4: Sand the table where needed.

Step 5: Measure the height of the wheels and include in the total table height.

Connect the Electronics!

1. Set up the radio controller and receiver.

Bind the receiver to the controller as shown in the instructions that come with the controller that you chose.

2. Connect the battery case to the radio receiver.

Connect the battery pack to the pins that say “B/VCC” (black wire goes on the outside of the receiver).

For this table size and weight, four AA batteries are enough to power the receiver and the two continuous servo motors. If you build a bigger table, you’ll need larger motors and more battery power.

3. Do a quick test to figure out which receiver input plugs work best for driving your table with the controller.

For the test, do the following:

If you are using the same radio controller and receiver, we recommend using receiver channels 2 and 3.

A. Connect one motor to the first channel on the receiver. Align the servo wires with the receiver channel as shown in the photo above.Then move the controls on the controller, observe when and how the motor moves, and record your findings.

B. Move the motor to the next receiver channel and repeat Step 2A. Do for all channels on the receiver.

C. Decide which channels work best to drive your robotic table!

Build the Drive Train and Attach Wheels!

The drive train is how we connect the motor and wheels to the table.

Step 1: Attach the wheels to the servos.

We attached the wheels with screws, but we had to find screws that fit and held the wheels on tight. We also had to drill out a bit of the wheel where the hole is so the screws could fit through. You may need to do a bit of testing to find the proper screws.

Step 2: Figure out placement of the servos and wheels. Use tape to hold in place while you test.

Use a level to make sure that when you attach the wheels the table is not all wonky. Measure how tall the servo with wheels are going to be before you attach them and before you drill into the wood. If you do not measure them, the table might be too tall and disproportionate.

Step 3: Attach the front castor* wheels to the table using the metal axle.

A. Measure and mark the location of the axle so that the castor wheels are even with the back wheels.

B. Drill holes into the front table legs and push the axle through, adding wheels as you go.

C. Secure the castor wheels in place by adding hot glue or grommets** on either side of the wheels, leaving about a 1/2″ (1cm) gap so that the wheels can rotate freely.

*The front wheels are called “castor” wheels because they are not connected to the motor.

** A grommet is circular rubber stopper, sort of like a rubber band, that prevents the wheels from sliding off.

Step 4: Secure the servo motors with epoxy or another strong adhesive.

Note: We recommend doing this step after testing the whole table as the servo motors will be stuck once the epoxy dries.

Test, Drive, & Decorate!

Power up the radio receiver and controller and test out your robo table! It might take a few practice trials to get a feel for driving the table.

Once you’re sure the table is working, add some hot glue (or epoxy) to hold wires in place and prevent the electronics from getting disconnected.

Decorate your table with markers, paint, stickers, fabric… whatever your creativity compels you to do!

If you want to see optional upgrades, check the next slide. Otherwise….

You’re done! Enjoy driving your robo table, maybe to give your pets a lil’ exercise or to deliver you or a friend food when you are watching a movie. Share your ideas and creations with us, we’d love to see!

Optional Upgrades

Battery holder!

We made a battery holder using wood, felt, ribbon, and wood glue. We measured the battery box and cut small pieces of wood to make a box without a top. We used the felt to cushion the battery box and keep it in place, and the ribbon to more easily pull the battery box out.

Wire Tubing

We purchased some wood-colored cord cover and cut it to fit the sides of the table legs to conceal the servo wires.

Brakes!

Design your own braking system, or stay tuned for separate tutorial on how we tackle this!

How to use a Breadboard!

Used by hobbyists and professional engineers alike, breadboards allow us to quickly build all sorts of circuits!

Breadboards got their name because in a time long ago, engineers used to use wooden cutting boards! They would hammer in nails and wrap wires to make connections. Not only was it tedious, but the cooks got frustrated that their breadboards kept getting stolen and used for definitely-non-food-purposes, so eventually someone invented the plastic breadboard to keep kitchen utensils safe. Hooray!

Similar to wires, plastic breadboards use conductive metal and insulating plastic to create paths where electricity can flow (the metal parts), and breaks where it cannot flow (the plastic parts).

If we were to look underneath a breadboard and peel off the backing, we would see something like this:

What do you notice?

The middle of the breadboard is different than the outsides. On outside of the breadboard, on both the left and the right sides, there are two long strips of metal. These are called “Power Rails”, or “Power Buses”, and one of the strips by itself is called a “Power Bus.”

Flipping the breadboard back over, the top, where we make our circuit connections, looks like this:

Looking at our Power Buses, there are colored lines next to them. While these are just guidelines (ahhhh sorry for the terrible pun, lol), the colored lines are super helpful for keeping track of how we connect our battery or power supply to the breadboard. Typically blue means negative, or ground (“gnd”), and red means positive.

The middle gap of the breadboard is called the trench. This separates the two identical middle halves of the breadboard. The trench is sized so that components with more than 3 pins can fit across.

The rows of the breadboard are marked with numbers, in this case numbers 1 – 30. The columns are marked with letters A, B, C, D, and E. Each row has a set of 5 holes that are connected by the piece of metal we saw on the bottom, as well as metal pins on the inside that hold wires and component pins in place. Some of the hole groups that are electrically connected are shown on the photo above with red rectangles.

Now let’s make some circuits! We’ll need four (male-to-male) jumper wires and the following parts:

Next, we’ll connect the battery to the power rails. If your battery case does not plug directly into the breadboard, grab two jumper wires for this.

The battery case that you are using might change how you connect your battery to the circuit, and that’s okay! The important part is that you connect the positive side of teh battery to one power bus, and the negative side of the battery to the other. Be sure that both sides of the battery are in different power buses (if you feel the battery getting warm it may indicate that it is short-circuited, this would be the place to double check).

Next, let’s connect our light! Grab your remaining jumper wires and your LED.

Insert the LED legs so that both legs are in two different rows (reminder: rows are marked with numbers). Connect the positive side of the battery to the longer LED leg. Connect the negative side of the battery to the shorter LED leg.

Voila! If the LED is connected to the battery in a circuit, it will light up!

Try moving your LED to a different part of the breadboard. Observe what happens!

Does wire color matter? Try two different colored wires and see what happens!

Finally, let’s end our exploration by tracing the path of the electricity.

Electric current is defined to flow from positive to negative. That means our electric current, which is made up of moving charges, flows out of the positive side of the battery, through the wire and into the breadboard power bus. It flows through the power bus, then up and out the red wire to the breadboard row where it can travel up the LED where it does work (and loses some energy) to make the LED turn on.

Then the (less energetic) electric current flows out of the LED through the shorter leg, into the breadboard row where it flows into the black wire. It then flows out of the black wire and into the second power bus, through the power bus and back to the negative side of the battery.

Our circuit is a circle! The moving charges that leave their home must also come back, but they come back more tired and into the back-door (which is to say, the negative side!).

Other helpful terms:

  • Current: The amount of charge flowing past a point in our circuit.
    • Current units are given in Amperes/Amps, or A
  • Voltage: The potential energy, or pushing force, across a component in our circuit. A higher voltage means more pushing force.
    • Voltage units are given in Volts, or V.
  • Resistance: How much a particular component resists the flow of electricity.
    • Resistance units are given in Ohms, or O
  • Capacitance: How much current a battery can provide over time.
    • Capacitance units are given in Amp-hours, or Ah.

There are two ways to connect components:

1. In series: connect components in line with one another, or head-to-tail.

2. In parallel: connect components in loops, or head-to-head.

Going Further!

You are now ready to tackle more circuits! Try adding more lights, or using different components. What happens when you add different kinds of components together? How many ways can you combine multiple components ?What sorts of projects could you use these circuits for? Share your creations with us, we always love to see and share!

And of course, please let us know if you have any questions, we are here to help!

Other useful tutorials:

Happy making!

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!

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! 😀

(Quick & Easy) Micro:Bit Magic 8 Ball Costume

90s kids unite! And build this super fun, easy, and interactive costume!

Ask a (yes/no) question, shake the Micro:Bit, and it displays a fortune (obviously accurate) to your deepest most pressing questions, like what is life, how do we solve climate change, and why are pineapples so difficult to cut open. Except you’ll do a better job with phrasing your questions as yes/no 🙂

Anyway….

Here we go!

Read Time: 7 min.

Build Time: < 30 min.

Project Cost: $15 – $20

Materials

  • Micro:Bit 
  • 2xAAA Battery Case
  • 2 AAA Batteries (plus some extras if you plan to wear the costume for more than 3 hours)

… Seriously, that’s it!

Oh, and to make it all aesthetically pleasing and on point:

  • Cardboard (like a 4″ x 4″ square)
  • Blue Paint

Step 1: Program the Micro:Bit!

Step 1: Go to www.MakeCode.org and open a new Micro:Bit project.

Step 2: Write a program to display randomly generated messages of your choosing!

Need more info? Here’s a more detailed overview 🙂

Go to Variables and create a unique variable for each message you want to send (e.g. msg1msg2, …msg42, etc).

Go to Inputs and drag out the On shake block. In On shake, add “set item to” from Variables, then go to the Math blocks and connect the “pick random 0 to..Change the random number range (i.e. the 2nd number) to reflect the total number of messages you are showing (e.g. if you have 5 messages, the random number range is 0 to 4 because there are 5 possible numbers: 0, 1, 2, 3, 4).

Almost done! Add an “If – Then” from Loops. In the first if, set the condition to: item = 0, then display the first message (“show string” block w/ the variable name for your first message (e.g. msg1)). Recommended to repeat the message at least once ’cause scrolling letters can be hard to read! Repeat the if statement condition for each random number and message, and viola, c’est fini! You can test the code in the simulation on the left side of the screen by clicking the Play button and then Shake (:

When you’re ready, download the code, plug in your Micro:Bit, and then drag the (.hex) file onto the Micro:Bit drive. The code is loaded when the power lights are done flashing!

Step 2: Optional Triangle Cover

Step 1: Make a cardboard triangle & paint it blue!

For most accurate imitation, go for an equilateral triangle (geometry for the win, woot woot!).

Step 2: Cut a 1 in. x 1 in. (2.5 cm x 2.5 cm) hole in the center for Micro:Bit LEDs.

Step 3: Attach Micro:Bit on back of triangle w/ glue or tape.

If using hot glue, avoid the battery and USB connector.

Step 4: Wear it & Share it, pretty bby!

Attach the Micro:Bit (& cardboard combo) to yourself or your clothes! You can use velcro, tape, or hot glue (although probably avoid using this one on your actual skin..) Or make straps w/ string, twine, fabric, etc!

Put on your favorite black outfit & you’re done! Quick & awesome & comfy Halloween costume for the winnnn 😀

Feel free to ask any questions in the comments section. If you build this or a variation, please share your creations, I’d love to see what you make!!

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!

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!

Make Custom (& Inexpensive) Circuit Blocks!

Create, build, and play with your very own LEGO-inspired circuit blocks! Explore the basics of electricity and circuits, discover how sensors work and use ’em to design your own experiments, and incorporate upcycled materials to improve on your materials-sourcing & MacGuyver-ing skills! That old gum wrapper? Make it into a resistor or a switch!

But seriously, this is a super fun (and inexpensive) project/toy/game to teach electronics to kids (and adults!) of all ages and experience levels. The total cost of this project is under $30 and it takes about 2 hours to design and build.

 

Ok.. so where do we start?

First we need a base, the circuit block itself. This design uses breadboards* as the circuit block bases. I chose mini color breadboards so that each color denotes a specific type of electronic component (see next section). These are super cheap, typically less than $1 per board. Follow my design or create your own!

For each breadboard/component, we also need at least two or more breadboard wires (or 22 or 24 stranded wire), so for 20 breadboards with a single component we need 40 or more breadboard wires.

*Breadboards are non-edible, inexpensive prototyping boards for electronics projects. See photo above for a quick illustration of how breadboards work, or check out this tutorial.

 

Gather Electronic Components!

If you happen to have an assortment of electronic components around, gather them up and go through them to find the most choice pieces — we want components with only two leads, like simple motors, fans, LEDs, resistors, capacitors, etc. Check out websites like SparkFun or Amazon and search for electronic components.

Hey, wait, where can I get this stuff for free??

Dig up that box of broken electronics in your garage and see what you can find inside the electronics!

The best sources for components are electronic toys that move and/or make noise, speakers, telephones, and other medium-sized electronics.You’ll need wire cutters and pliers to remove the pieces, be sure to keep the legs intact so they can easily connect to the breadboard.

Avoid smartphones, tablets and laptops since the circuit components are suuuuper small and difficult to attach to a breadboard (unless that’s what you’re going for, then extract away!). For safety reasons, avoid appliances (e.g. microwaves, televisions, refrigerators, etc.), and do not use capacitors that are larger than a child’s thumb.

 

Build the Circuit Blocks!

The breadboard assortment I got included red, blue, white, green and black, mini breadboards. I broke up the colors into the following categories and components:

 

Red boards (power devices): One 1 W solar panel, one 9V battery clip, one 2 AA battery box, and two coin cell cases.

 

 

 

Blue boards (simple active): one motor w/ propeller, six LEDs of different colors (three per board), and one transistor (the transistor is pretty tricky — I’d recommend replacing this with another motor).

 

 

 

Green boards (sensors): one photoresistor, one buzzer/piezoelectric sensor, one peltier junction, and one capacitive sensor (this didn’t end up working, so replace it with a pressure sensor or other cool, two-lead sensor).

 

 

 

White boards (simple passive): six resistors of varying values (three per board), two (small electrolytic) capacitors of different values, and one potentiometer.

 

 

 

 

Black boards (electromechanical): Two pushbutton switches of different sizes/types (one per board), two toggle switches (single board), and one cooling fan.

 

 

 

To build each circuit block:
Connect each component to the first rows of each breadboard (be sure they aren’t shorted — should be on either side of the breadboard), and hot glue the wires into place. Remember to label which side is positive and which side is negative! Another fun option is to make labels for each component.

 

Plug & Play!

You’re ready to start building circuits and teaching other people the basics of electronics! Start simple, then add in more components to explore their function and see how they affect your circuit.

Here’s an example progression exploring different ways to light up an LED:

1. Use a coin cell to light up an LED.

Exploration questions: Does orientation matter? Where do the wires need to connect to the breadboard?

2. Use the solar panel to light up an LED. Move the panel into the shade (or cover it with your hand), and see how the LED brightness changes.

Exploration questions: How does the brightness of the LED change when you cover the solar panel? Why does this happen?

3. Use a coin cell and potentiometer to adjust the brightness of an LED.

Exploration questions: What do you notice? Does it matter how we connect the potentiometer?

4. Use a coin cell and a photoresistor to adjust the brightness of an LED.

Exploration questions: What do you notice?. Does it matter how we connect the photoresistor? How could we use the photoresistor in an experiment?

Build your own sequences to teach folks about specific circuit components or sensors, or use them as a fun & educational free-time project!