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!

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!

How do I get started learning Arduino?

One of the most common questions I get is “How do I get started learning X?” (Where X is a some topic in STEM, most often electronics and programing). In an effort to help as many people as possible, I am writing a handful of articles on the most popular topics. Let’s get started with: Arduino microcontrollers, yay!

So you want to learn Arduino hardware and programming? That’s awesome! Like all things, learning a new skill takes practice. That means the best way to learn something is to do it.

Regardless of what you want to learn, my advice is (almost) always the same: Find a project you are passionate about and build it. 

Whether that means making an automated watering system to keep your plants happy and healthy, or gathering data to monitor air quality, or a gesture controller to play your favorite video game (Minecraft? Minecraft.). Whatever idea is pressing on your mind, the thing that you’ve always wanted to build, or whatever makes you giddy and excited and want to shout from the rooftops: build THAT.

If you close your eyes and listen to yourself, sometimes you very clearly can hear or see that idea. But what if there’s utter silence? Or perhaps even more challenging, too much noise?? What now?!?

Relax. I guarantee that you have plenty of ideas bottled up inside of your brain that will make you truly and ridiculously excited. You just need to spend a little time thinking, maybe writing, and maybe looking around for inspiration.

Why should you find something you’re passionate about?

Because learning new things is HARD. And at some point, you will get stuck. At some point, things will break and/or not work. If you do not care about the project you’re working on, it is easy to give up and walk away forever. But! If you genuinely and deeply and fervently want to bring that project to life, you will push through the frustration (maybe after some time away) and mess and the fixing to, eventually, finish it (or at least get it to a point where you are satisfied).

Caring about a project means you are internally motivated to finish it and that, my dear friends, is the key to learning anything: patience and persistence.

Okay, great! Find a project you are passionate about, and build it! Seems simple, right? Well, yes and no. It’s definitely easier said than done, and the hardest part when you’re a completely beginner is figuring out how to read the foreign languages of computer code, datasheets, electrical schematics, etc. etc. It can be daunting when it feels like you don’t know anything.

Start with a super simple prototype. It does not have to be the final version and it definitely does not need to have every feature or concept you envision. Break down your idea into its most basic part, and work on that. It can be dirty and disorganized and not quite what you want, but get something to work.

Or, find a tutorial that is close to what you’re envisioning and use that as a guide. A tutorial will be immensely helpful when you are first getting started because a (good) tutorial will walk you through all the parts and pieces, background info, and what the code is doing.

Okay, so all this so far has been quite general (although 100% applicable), so I can sense you’re aching for some actual, WHAT-DO-I-DO type ish. Fine, fine, here are a some specific suggestions for getting started learning how to do hardware and software projects with Arduino microcontrollers:

  1. Learn how to read Arduino software code.
    1. Use tutorials! Code written for tutorials (aka educational purposes) will most likely have comments that walk you through what the parts of the code are doing and what you can change.
  2. Learn how to read Arduino error messages.
    1. Inevitably, you will need to know what the errors printed in the text bar at the bottom mean. Look for line numbers as this will give you a clue as to where the error is, and that will (hopefully) help you figure out if it is a syntax error (aka a “spelling” error) or a logic error (aka something is wrong with the structure of your code).
    2. A good way to get started is to copy the error message summary, and paste into a search engine. There are thousands of other folks who have had the same questions as you, so leverage the power of knowledge in the World Wide Web to help!
  3. Learn how to use a breadboard to build circuits.
    1. Breadboards are tools for rapidly building prototypes of circuits. They are incredibly useful and almost essential when building a project that involves more than just a single sensor or output device.
    2. There are lots of guides on how to use breadboards, including this one!
  4. Learn how to read Fritzing schematics and, eventually, electrical schematics.
    1. Once you can read and understand the basics of Arduino coding and use breadboard to build simple circuits, it is super helpful to be able to build circuits using Fritzing schematics. Fortunately, Fritzings are cartoon-y, cute, and quite user friendly, like the picture to the right 🙂
    2. Color coding works as follows:
      1. Red = positive power;
      2. Black = negative power/ground (“gnd”)
      3. Other colors: signal wires
    3. Fritzing schematics are quite popular these days, but you may also run into you’re classic electrical schematic, particularly in books, which has symbols for components instead of pictures. It is a useful skill to be able to read these.
  5. Learn how to read, and use, code libraries.
    1. Whether you’re working in C++, Python, or Wiring (Arduino’s coding language) the secret to programming is knowing what libraries exist and how to use them.
    2. Explore the built in libraries in Arduino (Tools –> Include Library) and find code examples that use those libraries so you can more easily see the syntax and structure of how you use them.
  6. Learn how to gather essential information from datasheets.
    1. Once you’ve got a basic understanding of the software and hardware side, you’re ready to start tackling datasheets! Datasheets are where you’ll find the critical information for using different types of electrical components like sensors and motors.
    2. To be able to read a datasheet, you’ll need to have some background information about electricity, including knowing the basics of voltage, current, resistance, and power. That said, a good way to start to get a feel for this stuff is to start reading them! (you probably have guessed I would say that by now)
    3. You can find datasheets for parts by, quite literally, searching for: “PART NAME datasheet”, where hopefully you replace “PART NAME” with the thing you’re looking for (e.g. “servo motor HS-485HB datasheet”).

If you learn those five things, you will be able to build all sorts of projects with Arduino!

And now that I’ve taken the “hardest teacher ever” approach, I’ll be a little easier on ya. Here is a handy (and useful) tutorial to get started with:

Using Arduino for Citizen Science

Why this one? Because this tutorial teaches you the basics of how to use different types of sensors, both analog and digital. It walks you through writing simple programs, flashing the board, making the hardware connections, reading software code, and includes a range of increasingly more complex projects so that you get practice using the main features of Arduino.

I would highly recommend actually building each of these projects and, instead of copying-and-pasting, actually type in the code. Trust me, semicolons are still the bane of my existence, and the more you practice adding them, the easier your coding life will be 🙂

That’s about it! I know this was a broad overview, but that’s because it’s a broad subject and there is a LOT to learn. But just like everything else, learn it one step at a time, and practice, practice, practice!

 

Still have questions or need more help?

Contact me! If you’re in the Seattle area, I teach workshops and offer private lessons. If you’re beyond my travel zone, I also offer virtual lessons.

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

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!