FoxBot Founder/CEO Featured by Gadegetronix!

Gadgetronicx is an educational website and online community of electronics enthusiasts who share their creations, ideas, and tips and tricks for working with electronics and bringing ideas to life. Founded in April 2012 by Frank Donald and powered by many Enthusiasts around the world, members can learn from and share their projects with readers across the globe.

Recently Gadgetronicx started an interview series called “Meet the Motivators” which interviews makers around the world who are educating and inspiring others. We were so excited that they selected our founder and CEO, Jen Fox, as their first Motivator! Gadgetronicx collected questions from their member base which Fox answered. Here are some excerpts of the interview:

Q1: What you enjoy most? Being a Maker or Educator ?

Both! Being a maker helps me be a more effective educator because it puts me in the position of a student. And being an educator helps me be a better maker because students teach me things, inspire me, ask great questions that make me curious to know more, and help me figure out what projects folks are interested in. It is a beautiful and perfect blend ?

Q4: Why JenFoxbot ? 

Hah good question! My actual last name is “fox” but it is a hilariously common name. Which meant all of the standard handles I was trying to get were taken! So randomly one day when I was in college I said “oh I dont know jenfoxbot” and it was available! So I gobbled up all the emails and usernames I could get my hands on and it stuck! Fun fact: the first name of my company was “foxtronics”, but I switched it to “foxbot industries” because allows me to have a broader scope and mission. And it just sounds better!

Q7: Interesting Raspberry Pi project ever built ?

The pi is so awesome!! I love that it is an affordable computer, which makes it a powerful way to build custom electronics projects. Personally, I am fascinated with the ability to convert a pi into a local access point! For my Halloween costume last year i was a “server” — I used a Pi to host a local webpage where people could order candy, and then I delivered it to them ? I want to dive into that project again at some point and make a personal and local chat app for places that dont have cell service! Here is a link to that project: http://foxbotindustries.com/turn-pi-local-server/

Q8: Modern Education system is so flawed in my view, Your opinion ? 

Hah. That is certainly a big topic! Yes, there are many problems in the US educational system. The current method of standards implementation has resulted in teachers being forced to “teach to the test”, which means students are largely memorizing rather than understanding. Personally, I believe this has contributed to a view that science is a collection of facts (which one could then choose to ignore), rather than an understanding that science is a process of asking questions and seeking answers. I am working hard to help provide standards aligned curriculum that teaches understanding. It is very hard for educators to do all of the things, especially with huge class sizes and little resources. So I am trying to make their lives easier and better by creating more effective curriculum and educational approaches to learning. My hope is that once enough teachers adopt a project based method, the school districts, state and federal policies will update

Q9: Advice to budding Electronics Engineers or Enthusiast ?

Practice and get experience in the areas you are interested in and want to learn. Build up/point to a portfolio of projects you have done solo and with groups. Go to job fairs and figure out what you like and don’t like. What do you like doing and where do those jobs exist? Think creatively and talk to people. Be candid about what you want to do and where you are at. Seek mentors in the fields you want to work in and ask for their advice and suggestions for people and companies. And perhaps most important: be well rounded! Learn about humanities, cultures, and history. Talk to and be friends with people who are different than you. Talk to people who will be using the things you create so you can better meet their needs. By understanding the diverse world we live in, we can create better and more effective products!

 

For the full interview, visit the Gadgetronicx website. While you’re there, check out some of their members’ projects to learn more about electronics and tech!

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!

Raspberry Pi Impact Force Monitor

How much impact can the human body handle? Whether it’s football, rock climbing, or a bicycle accident, knowing when to seek immediate medical attention after a collision is incredibly important, especially if there are no obvious signs of trauma. This tutorial will teach you how to build your very own impact force monitor!

 

Read Time: ~15 min

Build Time: ~60-90 min

This open-source project uses a Raspberry Pi Zero W and an LIS331 accelerometer to monitor and alert the user of potentially dangerous G-forces. Of course, feel free to modify and adapt the system to suit your various citizen science needs.

Note: Build fun stuff with the Impact Force Monitor! However, please don’t use it as a substitute for professional medical advice and diagnosis. If you feel that you have taken a serious fall, please visit a qualified and licensed professional for proper treatment.

Suggested Reading

To keep this tutorial short n’ sweet (er, well, as much as possible), I’m assuming you’re starting with a functional Pi Zero W. Need some help? No problem! Here’s a full setup tutorial.

We’ll also be connecting to the Pi remotely (aka wirelessly). For a more thorough overview on this process check out this tutorial.

**Stuck or want to learn more? Here are some handy resources:**

1. Excellent “Getting Started” guide for the Pi.

2. Full hookup guide for the LIS331 accelerometer breakout board.

3. More about accelerometers!

4. Overview of the Raspberry Pi GPIO pins.

5. Using the SPI and I2C Serial buses on the Pi.

6. LIS331 Datasheet

Materials

 

Tools

  • Soldering Iron & accessories
  • Epoxy (or other permanent, non-conductive liquid adhesive)
  • Probably also scissors 🙂

But wait! What is Impact Force?

Fortunately the term “impact force” is pretty straightforward: the amount of force in an impact. Like most things though, measuring it requires a more precise definition. The equation for impact force is:

F = KE/d

where F is the impact force, KE is the kinetic energy (energy of motion), and d is the impact distance, or how much the object crunches. There are two key takeaways from this equation:

1. Impact force is directly proportional to the kinetic energy, meaning that the impact force increases if the kinetic energy increases.

2. Impact force is inversely proportional to impact distance, meaning that the impact force decreases if the impact distance increases. (This is why we have airbags: to increase the distance of our impact.)

Force is typically measured in Newtons (N), but impact force may be discussed in terms of a “G-Force”, a number expressed as a multiple of g, or earth’s gravitational acceleration (9.8 m/s^2). When we use units of G-force, we are measuring an objects acceleration relative to free fall towards the earth.

Technically speaking, g is an acceleration, not a force, but it is useful when talking about collisions because acceleration* is what damages the human body.

For this project, we’ll use G-force units to determine if an impact is potentially dangerous and deserving of medical attention. Research has found that g-forces above 9G can be fatal to most humans (without special training), and 4-6G can be dangerous if sustained for more than a few seconds.

Knowing this, we can program our impact force monitor to alert us if our accelerometer measures a G-force above either of these thresholds. Hooray, science!

For more information, read about impact force and g-force on Wikipedia!

Acceleration is a change in speed and/or direction.

Configure the Pi Zero W

Gather your Raspberry Pi Zero and peripherals to configure the Pi to be headless!

  • Connect the Pi to a monitor and associated peripherals (keyboard, mouse), plug in the power supply, and log in.
  • Update software to keep your Pi speedy & secure. Open the terminal window and type these commands:
    • Type and enter:
sudo apt-get update
  • Type and enter:
sudo apt-get upgrade
  • Reset:
sudo shutdown -r now

Enable WiFi & I2C

  • Click the WiFi icon on the upper right corner of the desktop and connect to your WiFi network.
  • In the terminal type this command to bring up the Pi’s Software Configuration Tool:
sudo raspi-config
  • Select “Interfacing Options”, then “SSH”, and choose “Yes” at the bottom to enable.

  • Go back to “Interfacing Options”, then “I2C”, and select “Yes” to enable.
  • In the terminal, install remote desktop connection software:
sudo apt-get install xrdp

  • Type ‘Y’ (yes) on your keyboard to both prompts.
  • Find the Pi’s IP address by hovering over the WiFi connection (you might also want to write it down).

  • Change the Pi’s password with the passwd command.

Restart the Pi and Log in Remotely

We can now ditch the HDMI and peripherals, woohoo!

  • Setup a remote desktop connection.
    • On a PC, open Remote Desktop Connection (or PuTTY if you’re comfy with that).
    • For Mac/Linux, you can install this program or use a VNC program.
  • Enter the IP for the Pi and click “Connect” (Ignore warnings about unknown device).
  • Log in to the Pi using your credentials and away we go!

Build It! Electronics

Here’s the electrical schematic for this project:

Note: The LIS331 breakout board in the schematic is an older version — use the pin labels for guidance

And here’s the pinout for the Pi Zero:

Connect the Accelerometer to the Pi’s GPIO

  • Solder and carefully remove any flux residue on the accelerometer and Pi GPIO’s header pins.

  • Then connect jumper wires between the LIS331 breakout board and Pi between the following pins:

LIS331 Breakout Board                     Raspberry Pi GPIO Pin

GND                                                 GPIO 9 (GND)

VCC                                                  GPIO 1 (3.3V)

SDA                                                   GPIO 3 (SDA)

SCL                                                   GPIO 5 (SCL)

  • To make it easier to connect the sensor to the Pi Zero, a custom adapter was made by using a female header and jumper wires. Heat shrink was added after testing the connections.

Add an Alert LED!

  • Solder a current limiting resistor to the negative LED leg (shorter leg) and add shrink wrap (or electrical tape) for insulation.

  • Use two jumper cables or header pins to connect the positive LED leg to GPIO26 and the resistor to GND (header positions 37 and 39, respectively).

Completed Electronics Setup

Connect the battery pack to the Pi’s input power to complete the setup!

Program It!

The Python code for this project is open-source! Here’s a link to the GitHub repository.

For Folks New to Programming:

  • Read through the program code and comments. Things that are easy to modify are in the “User Parameters” section at the top.

For Folks More Comfortable w/ the Technical ‘Deets:

  • This program initializes the LIS331 accelerometer with default settings, including normal power mode and 50Hz data rate. Read through the LIS331 datasheet and modify initialization settings as desired.

All:

  • The maximum acceleration scale used in this project is 24G, because impact force gets big real quick!
  • It is recommended to comment out the acceleration print statements in the main function when you are ready for full deployment.

Before you run the program, double check that the accelerometer address is 0x19. Open the terminal window and install some helpful tools with this command:

sudo apt-get install -y i2c-tools

Then run the i2cdetect program:

i2cdetect -y 1

You’ll see a table of I2C addresses displayed as shown in the image above. Assuming this is the only I2C device connected, the number you see (in this case: 19) is the accelerometer address! If you see a different number, take note and change in the program (variable addr).

Quick Overview of Program

The program reads the x, y, and z acceleration, calculates a g-force, and then saves the data in two files (in the same folder as the program code) as appropriate:

  • AllSensorData.txt – gives a timestamp followed by the g-force in the x, y, and z axes.
  • AlertData.txt – same as above but only for readings that are above our safety thresholds (absolute threshold of 9G or 4G for more than 3 seconds).

G-forces above our safety thresholds will also turn on our alert LED and keep it on until we restart the program. Stop the program by typing “CTRL+c” (keyboard interrupt) in the command terminal.

Here’s what both data files look like:

Test the System!

Open the terminal window, navigate to the folder where you saved the program code using the cd command.

cd path/to/folder

Run the program using root privileges:

sudo python NameOfFile.py

Check that the acceleration values in the x, y, and z-direction are printing to the terminal window, are reasonable, and turn on the LED light if the g-force is above our thresholds.

  • To test, rotate the accelerometer so that the each axes point towards the earth and check that the measured values are either 1 or -1 (corresponds to acceleration due to gravity).
  • Shake the accelerometer to make sure the readings increase (sign indicates direction of axis, we’re most interested in the magnitude of the reading).

Secure Electrical Connections & Install It!

Once everything is working correctly, let’s make sure the impact force monitor can actually withstand impact!

  • Use heat shrink tube and/or coat the electrical connections for the accelerometer and LED in epoxy.
  • For super durable, permanent installations, consider coating the whole shebang in epoxy: the Pi Zero, the LED, and the accelerometer (but NOT the Pi cable connectors or the SD card).
    • Warning! You can still access the Pi and do all the computer stuff, but a full coat of epoxy will prevent the use of the GPIO pins for future projects. Alternatively, you can make or purchase a custom case for the Pi Zero, although check for durability.

Secure to a helmet, your person, or a mode of transportation like your skateboard, bicycle, or cat*!

Fully test that the Pi is securely fastened or the GPIO pins may become loose causing the program to crash.

*Note: I originally meant to type “car”, but figured an impact force monitor for a cat might also yield some interesting data (with kitty’s consent, of course).

Embedding the Circuit in a Helmet

Theres a few methods of embedding the circuit into a helmet. Here’s my approach to a helmet installation:

  • If you have not already, connect battery to Pi (with battery off). Secure the accelerometer to the back of the Pi with nonconductive insulation in between (like bubble wrap or thin packing foam).

  • Measure the dimensions of the Pi Zero, accelerometer, LED, and battery connector combination. Add 10% on either side.

  • Draw a cutout for the project on one side of the helmet, with the battery connector facing towards the top of the helmet. Cut out the padding in the helmet leaving a few millimeters (~ 1/8 in.).

  • Place the sensor, Pi, and LED in the cutout. Cut pieces of the excess helmet padding or use packaging foam to insulate, protect, and hold the electronics in place.

  • Measure the battery’s dimensions, add 10%, and follow the same cutout for the battery. Insert the battery into the pocket.

  • Repeat the insulation technique for the battery on the other side of the helmet.

  • Hold the helmet padding in place with tape (your head will keep it all in place when you are wearing it).

Deploy!

Power up the battery pack!

Now you can remotely log into the Pi through SSH or remote desktop and run the program via the terminal. Once the program is running, it starts recording data.

When you disconnect from your home WiFi, the SSH connection will break, but the program should still log data. Consider connecting the Pi to your smartphone hotspot WiFi, or just log back in and grab the data when you get home.

To access the data, remotely log into the Pi and read the text files. The current program will always append data to the existing files – if you want to delete data (like from testing), delete the text file (via the desktop or use the rm command in the terminal) or create a new file name in the program code (in User Parameters).

If the LED is on, restarting the program will turn it off.

Now go forth, have fun in life, and check on the data every so often if you happen to bump into something. Hopefully, it’s a small bump but at least you’ll know!

Adding More Features

Looking for improvements to the impact force monitor? It is outside the scope of the tutorial but try looking at the list below for ideas!

Do some analysis on your g-force data in Python!

The Pi Zero has Bluetooth and WiFi capabilities – write an App to send the accelerometer data to your smartphone! To get you started, here’s a tutorial for a Pi Twitter Monitor.

Add in other sensors, like a temperature sensor or a microphone*!

Happy Building!

*Note: To hear the whooshing sounds associated with your acceleration! 😀

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!

Build & Play Robot Mini Golf!

Introduction

Create, build, and play an obstacle course for Brush Bots! This is an activity for all ages that teaches the basics of circuits and design thinking while encouraging and inspiring creativity, discovery, and collaboration. Most importantly, it’s super fun! (But seriously though, watch the video it’s adorbs and will make you smile)

This tutorial will show you how to build (and source parts for) a Brush Bot, how to design and build mini golf inspired obstacles, and how to use the design thinking process to create a Brush Bot that can accomplish each of the obstacles. Go forth and build your own Robot Mini Golf course!!

 

 

Tools & Materials

Tools

  • Scissors
  • Hot glue gun(s) + hot glue sticks
  • Wire cutters/strippers
  • Masking Tape

Materials

1. Electronics

2. Brush Bot Body & Feet

Since there are tons of ways to build the body, no list is absolute. Here are some suggestions (upcycling materials are highly encouraged & also cut down on cost!):

  • Toothbrush bristles
  • Styrofoam/plastic/paper cups
  • Paper plates
  • Cardboard
  • Tupperware
  • Toothpicks and/or wooden skewers
  • Popsicle sticks
  • Styrofoam pieces

3. Obstacles

  • Cardboard, cardboard, and more cardboard!
  • Art supplies
  • And maybe throw in some electronics in there also (see Step 4) 🙂

 

What the heck are Brush Bots??

Brush Bots, or Bristle Bots, are the simplest possible form of a robot: a motor with a counterweight and a battery attached to simple body. The counterweight causes the motor to shake, which, in turn, causes the body to shake.

The name “Brush Bot” comes from
a common design that uses toothbrush bristles as the “feet”. The term has been adapted to refer to any simple robot based on the counterweight motor design. Another super fun variation are Art Bots, which use markers or other materials to draw while they wobble around!

There are tons of ways to build a Brush Bot. A couple of approaches are shown in the photos. What other ways can you invent to build a Brush Bot?

 

Building the Obstacles

My obstacles were inspired by mini golf and through my experience in teaching Brush Bots and seeing various approaches from students and educators. I wanted obstacles that would be fun, accessible, and interesting for kids and adults, so I came up with four obstacles of varying difficulty.

Obstacle 1: Enter the Arena

Starting from 1 – 2 feet away, the Brush Bot must enter the opening to an arena. This can be made by marking an arena with tape, or by building a simple fence from cardboard.

Obstacle 2: Spiral Maze

The spiral maze is a crowd favorite and is a great obstacle for younger kids to tackle. Build the spiral maze by scoring a long piece of cardboard (~ 4 feet), then gluing it in a spiral pattern on a 2′ x 2′ cardboard square.

I decorated mine to look like a galaxy by spray painting the outside gold and the inside black, then gluing glow-in-the-dark stars on the inside.

Obstacle 3: Ramp

Although easy to make, this obstacle has proved to be the most challenging. I recommend using a low incline (less than 15 degrees) and adding a rough surface (e.g. sandpaper) on top of the cardboard.

Build the ramp by cutting out two identical triangles and then adhering a cardboard square on top.

 

 

 

Obstacle 4: Robot Head

By far the most fun, but a bit more complicated. I wrote a quick Arduino sketch to move a servo motor and added an IR breakbeam switch to trigger some LEDs when a Brush Bot goes into the mouth.

Recreate or modify this Robot Head or create your own whimsical obstacle!

Building the Brush Bot(s)!

1. Dismantle and gut an electric toothbrush! Your mission: find the motor.

For the Assure-brand “Soft Bristle Electric Toothbrushes” that you can get at the Dollar Store (just $1 woot woot!), twist off the bottom, pull out the battery holder, and pull out the motor. You may need to tap (or hit) the open toothbrush on the floor to get the motor out, or (gently) use pliers to pull it out.

2. Grab (or build!!) a battery box, and connect the positive side (red wire) to one of the motor leads*.

3. Connect the negative side of the battery box (black wire) to the other motor lead.

Orientation doesn’t matter — try switching them and see what happens!

4. Design and build a body for the lil ‘bot and give it a way to move. Iteration through different designs is recommended and encouraged!

Some common and easy ways to make the Brush Bot move are to use toothbrush bristles, toothpicks, or popsicle sticks to make legs/feet. Try different objects and object placements to see what happens.

*The motor leads are those gold tabs with holes by the white cap of the motor.

 

Conquering Obstacles W/ Design Thinking

Design Thinking is a problem-solving method. Traditionally, it’s applied for design of hardware and software products in various engineering disciplines, but this process can be applied to pretty much any aspect of life. The Design Thinking process comes in variety of flavors, here is a common breakdown:

1. Design: Who is your audience? What, or who, are you designing for? What are constraints for your product/project?

2. Ideate: How can you solve this problem? Come up with at least 3 – 5 different approaches — impossible solutions are totally acceptable in this phase.

3. Prototype: Choose one of your (possible) solutions and build it.

4. Test/Observe: Test your prototype and observe how it behaves. Does it solve your problem? If not, what’s wrong with it? If it does, can it be done in a simpler or easier way?

5. Adjust: Change your prototype based on your testing and observations.

Repeat steps 3 – 5 until you’ve arrived at a solution that solves your problem, satisfies your audience (or teacher), and meets any design constraints.

For Educators:

You can go through the design thinking process before, during, or after the workshop. One of the benefits of having obstacles to conquer is that it motivates students to naturally go through this process without having to sit and think about it.

 

Compete & Add Prizes

That’s it! You’re ready to tackle and challenge your students, friends, and/or family to a game of Robot Mini Golf!

A bonus feature would be to add prizes for anyone who successfully completes either one or all of the obstacles. My favorite method is to give out small prizes (e.g. stickers or buttons) to anyone who builds a Brush Bot that completes at least one of the obstacles, and a larger prize for anyone whose Brush Bot successfully completes all of the obstacles. This is a great way to adapt this into a workshop for folks of all ages — older kids and adults can try to conquer all of the obstacles while the younger kids still get to participate and have a blast! 😀

Please feel free to share your Robot Mini Golf stories in the comments! Would lovelovelove to hear anecdotes of how this activity went with students and/or to see photos of your unique Brush Bot(s) and obstacle course creations!

A Few of Our Favorite Brush Bots

 

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!

IoT Pet Monitor!

Keep an eye (er, ear) on your beloved bbies while you are away! This project monitors the volume of sound in your home and if your pet gets too anxious and starts barking or making other loud noises, soothe their sad lil’ soul by turning on music or your own (pre-recorded) voice!

This tutorial will show how to build this project using a Raspberry Pi computer to monitor sound in your home (via the Cloud) to see if and when your pet is upset.

Along with the Pi (and speakers), we’ll use the SparkFun MEMS microphone breakout board to measure volume levels and trigger the audio player. Data is uploaded to the CloudMQTT service using the MQTT communication protocol.

Total Read Time: 8 min.

Total Build Time: 60 min. (less if you are experienced)

Suggested Reading

To build this project, you’ll need a fully configured, WiFi-connected Raspberry Pi 3 computer with ​Raspbian OS. It’s also helpful to know some ​Python programming as well as the following things: (1) how to use and control the Raspberry Pi GPIO pins; (2) MQTT communication; and (3) analog sensors. If any of this is unfamiliar, or if you’re just curious (be curious!), check out the tutorials below!

Raspberry Pi 3

  1. ​Raspberry Pi 3 Starter Kit Hookup Guide
  2. ​Raspberry Pi GPIO
  3. ​SPI Communication with the Raspberry Pi

MQTT Communication Protocol

MQTT (Message Query Telemetry Transport) is a popular IoT communication protocol. We’ll use the Paho Client Python library and an MQTT service called ​CloudMQTT. Here’s more about MQTT and how to use it:

  1. Exploring Communication Protocols for IoT
  2. Getting Started with CloudMQTT
  3. ​Overview of Eclipse Paho MQTT Python client library

MEMS Microphone Breakout Board

The MEMS microphone is an analog microphone, so we’ll need an Analog-to-Digital converter (“ADC”) to read in the analog signal with the Raspberry Pi digital GPIO pins.

  1. Getting started with the SparkFun MEMS Microphone Breakout Board
  2. ​MEMS Microphone Datasheet
  3. MCP3002 ADC Datasheet

 

Materials

Raspberry Pi 3 Model B

We’ll also need the following peripherals: ​Raspberry Pi 3 Case​SD Card (minimum 8 GB); ​Raspberry Pi 3 GPIO cable; ​MicroUSB power cable; HDMI cable and ​HDMI-compatible monitor; USB keyboard; USB mouse; speakers with 1/8″ headphone port.

​SparkFun MEMS Mic Breakout Board

​MCP3002 (Analog-to-Digital Converter)

​Breadboard & ​M-to-M Breadboard Jumper Wires

 

Configure the Raspberry Pi

Step 1: Check & Install Updates
Checking for and installing updates is always a good way to start. Run the following commands in the terminal window:

    sudo apt-get update
    sudo apt-get upgrade
    sudo reboot

Step 2: Set up SPI Interface for MEMS Microphone + MCP3002

To use the SPI (Serial Port Interface) to read in the MEMS Microphone via the MCP3002, we’ll need the Python Dev Package:

    sudo apt-get install python-dev

We’ll also need the SPI Interface (may want to create a subfolder to save this in):

    git clone git://github.com/doceme/py-spidev
    sudo python setup.py install

Here’s the SPI-Dev Documentation if you run into any issues.

Step 3: Playing Sounds with OMXPlayer

The OMXPlayer is an audio and video player pre-loaded on Raspbian OS. It works with most sound file types, including: .wav, .mp3, and .m4a. This is what we’ll use to play back sounds when Fido gets too loud. The Python library to control the OMXPlayer is included in Raspbian (woo!).

To test the OMXPlayer from the terminal, type the following:

    omxplayer /home/.../SongFilePath/SongFileName.mp3

If that doesn’t work, try forcing it over the local audio-out device:

    omxplayer -o local /home/.../SongFilePath/SongFileName.mp3

Step 4: Configure CloudMQTT Server

Now we set up an MQTT server! To do this using CloudMQTT, do the following:

  1. Set up a CloudMQTT account (the “Cute Cat” plan is free).
  2. Create a new MyCloud instance.
  3. In the Console, create a new ACL rule.
  4. You can monitor published messages in the “Websocket” UI.

 

Finally, install the MQTT Paho Client Python library:

    pip install paho-mqtt


Build it! Hardware

Here’s a pinout for the Raspberry Pi 3:

1. Insert MCP3002 pins into breadboard. Here’s a pinout for this board:

The MCP3002 uses 4 SPI pins for communication: Serial Clock (“SCL”), Master Input Slave Output (“MISO”), Master Output Slave Input (“MOSI”), and Chip Select (“CS”). These pins correspond to Raspberry Pi GPIO pin 11 (SCLK), GPIO pin 9 (MISO), GPIO Pin 10 (MOSI), and GPIO Pin 8 (CE0).

Make the following connections with MCP3002 pins:

  • ​Connect Pin 1 to Raspberry Pi GPIO Pin 8 (CE0)
  • Connect Pin 2 to the analog output of the MEMS Microphone breakout board
  • Connect Pin 4 to GND
  • Connect Pin 5 to Raspberry Pi GPIO Pin 10 (MOSI)
  • Connect Pin 6 to Raspberry Pi GPIO pin 9 (MISO)
  • Connect Pin 7 to Raspberry Pi GPIO Pin 11 (SCLK)
  • Connect Pin 8 to Raspberry Pi 3.3V out

2. Solder wires to the MEMS Microphone breakout board. Connect to MCP3002 and Raspberry Pi.

  • ​Connect Vcc to Raspberry Pi 3.3V.
  • Connect GND to Raspberry Pi GND
  • Connect AUD to MCP3002 Pin 2

3. Plug in all the cables for the Raspberry Pi and turn everything on.

 

Build it! Software

Our goal with the Bark Back is twofold: trigger a playback sound when the dog barks, and send the data to a server where we can check it.

Here’s the ​open-source Python program for this project. Feel free to (and please do) adjust and modify the code

To get the program up and running, you need to fill in two things:

songList: Write in the file path and file name for each of the songs you want to play.

creds: Input your CloudMQTT information in this dictionary.

Step 1: Read in the SparkFun MEMS Microphone breakout board.

Read in the ADC value (between 0 and 1023) from the MEMS Microphone breakout board (via the MCP3002) using the SPI library and calculate the signal peak-to-peak amplitude.

Map the signal peak-to-peak amplitude to a Volume Unit. The current code maps the ADC range between 0 and 700 (based on quick experimentation) to a Volume Unit between 0 and 10. To adjust the sensitivity of the microphone, adjust the ADC input range.

For a thorough overview of the MEMS mic, ​check out this tutorial.

Step 2: Trigger audio player.

First we’ll need songs to play! You can quickly record sounds in GarageBand (or on your smartphone) and send ’em to the Raspberry Pi. In Python, use the subprocess library to call the omxplayer.

In the code, input the file path of the songs you want to play back in the *songList* variable (line 26). The current volume threshold is set to 7 in the main function.

Step 3: Send data to CloudMQTT Server

Use the ​Paho Client Python library to communicate with the CloudMQTT servers. To broadly summarize: Set up a Client server; define communication protocols; connect with our credentials (aka creds); and subscribe and publish our data. Most of this is done in the main function (lines 129 – 149, and lines 169 – 174).

To check on received data, go to the “Websocket UI” tab in the CloudMQTT console.

 

Test & Install & Enjoy!

Run the BarkBack.py program in Terminal or in the Python IDE (you can also use SSH to run the program after you’ve already left).

Check that you are getting volume levels in your Websocket UI tab.

Test the system by triggering the mic (clap, yell, bark, etc.) to be sure that the speakers play through all of the sounds.

Once everything is up and running, it’s recommended to solder the components to a PCB (Printed Circuit Board) if you intend to install the system for more than just a few days.

 

Project Extensions

1. Add in an RPi camera module to include video.
2. We’re already connected to the IoT, so why not throw in some more sensors! For example, you could monitor hazardous gases (perhaps methane?).
4. Prefer a reward over barking back? Create an automatic treat dispenser to reward your pet for being quiet for a few hours. Here’s a candy-dispensing tutorial for inspiration and to help get you started.
5. Share your findings and adaptations in the comments below!

Happy building!

Make a Sneaky Wearable ‘State Change Switch’!

 

Secretly change settings for your wearable outfits or use this button as a secret prank trigger! Here’s a quick & easy tutorial on how to build and program a “state change switch.” AKA a button that cycles through different settings. It’s super easy and has tons of practical applications!

Read Time: ~ 5 min
Build Time: ~ 30 min
Cost: Super cheap (>$5)

Materials!

materials1-sm

— Glove (just one.. but you should probably wear two to avoid giving away the secret)

— Three (3) stranded wire segments (24/26 gauge), approx. 3 ft

Wires should be long enough to reach from your palm to wherever you want to hide the electronics. I hid mine in a belt pouch, but you could also opt for a pocket, backpack, etc.

— One (1) 10kOhm resistor

— One (1) pushbutton (aka momentary switch)

— One (1) 1″ x 1″ piece of thin wood

Those free wood swatches at hardware stores are perfect!

— Microcontroller

I used the SparkFun EL Sequencer b/c I was using this switch to select different settings for my Hallowen EL Wire costume. Check out the tutorial to learn how to build your own version of this costume, or you can use this state change switch with any ol’ microcontroller for your own awesome project!

 

Build it!

schematic_bb

buttonbase1-sm

1. Drill holes in a small piece of wood for the button feet.

resistor1-sm

2. Solder a wire to one of the button legs, and a resistor to the other button leg on the same side. Solder a black wire to the resistor.

3. On the other side of the button, solder a wire to the leg across from the resistor.

4. Test electrical connections, then coat all solder joints in hot glue.

buttonbase-bottom2-sm

5. Connect the black wire to the microcontroller ground, and the wire on the same side to the microcontroller voltage output (Vcc).

6. Connect the wire on the other side to a microcontroller digital (or analog) input pin (see schematic above), and then onward to programming!

buttonbase-solder-sm

 

Program it!

code-screenshot

Most folks that program state change switches use the modular, or mod, operator* to tell different settings apart. It’s not perfect, but for how little code is involved it’s a good way to cycle through different settings and get back to our original state.

Here’s a quick sketch that will allow you switch between three different settings by pushing the button. As is, it’s written to switch between three different digital output settings. In other words, if you have a motor connected to your microcontroller, the button will switch the motor from constantly on, to pulsing (i.e. repeatedly on/off), to constantly off, then back to constantly on.

*The mod operator (usually “%”) divides the number by the value after the operator and gives you the remainder. For example, if you see: 10%2, it means 10 / 2 = 5, which equals 0, since there is no remainder. Another example is 10%3, which equals 1, since 10 / 3 = 3.33, and 0.33 is one out of three. Here’s more info on this or feel free to leave a comment if you have any questions!

 

Finish & Test!

Connect the button wire leads to your microcontroller inputs, run the full program and test to see that it works as expected. If it’s all good, put the glove on and push the state change switch and watch as your costume/insertotherawesomeprojecthere changes through different settings!

Now go forth and show off your project around town!

How to Use (and Choose) a Multimeter!

Checking your car battery life, debugging circuits, and finding that pesky short are all super useful functions that can be performed with just one awesome tool: the multimeter!

First of all, what the heck is a multimeter??   Excellent setup question! It’s a handheld device with bunch of different electrical meters — hence, multi-meter!

Measuring voltage, current, resistance, and continuity (aka electrical connection) are the most common uses of a multimeter.  Read on to learn what this means, how to do it yourself, and how to choose your very own multimeter!

Choosing a Multimeter!


There are a few key differences between multimeters, the main one being analog versus digital:
Analog multimeters show real-time changes in voltage and current, but can be difficult to read and log data.

Digital Multimeters are easier to read, but may take some time to stabilize.

There are also auto-ranging multimeters, that automatically detect the measurement range, and manual ranging multimeters where you have to choose a range yourself (or start with the highest setting and work down).

Other than those two main differences, you’ll want a multimeter that has separate ports for current and voltage measurements (this is a safety issue, both for the meter and for yourself).

Next comes the fun part: features! Multimeters all have voltage and current meters (otherwise they’d just be called voltmeters and ammeters!), and most can also measure resistance. There are a variety of other “extra” features depending on manufacturer and cost (e.g. continuity, capacitance, frequency, etc.).

Second-to-lastly, there are a ton of different types of probe leads, including alligator clips, IC hooks, and test probes. Can’t decide? Here’s a kit that has four different types!

Lastly, always check the multimeter maximum voltage and current ratings to be sure that it can handle what you want to use it for.

Using a Multimeter!

But first! A quick overview of voltage, current and resistance!

My favorite analogy for electricity is the “water flowing through a pipe” analogy. In this analogy, voltage is similar to the water pressure, current is like the water flow (except with current you have electrons instead of water molecules!), and resistance is akin to the size of the pipe. Check out this tutorial for an awesome and thorough overview of electricity.

Keeping these analogies in mind helps us to figure out how, and what, we are measuring.

Measuring Voltage:

A voltage measurement tells us the electrical potential, or pressure, across a particular component.

Voltage is basically the “oomph” in our circuit, s so we want to avoid drawing any power from the circuit when we take a voltage measurement. This means we need to measure voltage in parallel with a particular component using infinite (or really, really high) resistance to prevent any electrical current from flowing into the meter.

Using a multimeter to measure voltage across a component (or battery!):

1. The black multimeter probe goes into the COM port, and the red probe into the port marked with a “V”.

2. Switch the dial to the “voltage” setting (choose the highest setting if you have a manual ranging multimeter).

3. Place black probe on negative side of the component, and red probe on positive side (across, or in parallel with the component). If you get a negative reading, switch the leads (or just note the magnitude of the voltage reading).

Read the meter output and you’re done! Not too bad 🙂

Measuring Current:

Taking a current measurement tells us the amount of electricity flowing through a given component or part of a circuit.

To measure current, we need to measure all of the flow in our circuit without consuming any power from the circuit and reducing the current measurement. This means we measure current in series with a component and we want our meter to have zero resistance.

Using a multimeter to measure current through a component:

1. The black multimeter probe goes into the COM port, and the red probe into the port marked with an “I” or an “A” (or “Amp”).

2. Switch dial to the current setting (choose highest setting if you have a manual ranging multimeter).

3. Connect red probe to current source, and black probe to the input of the component, so that the current flows from the source, through the meter, to the component (in series with the component).

Read the meter output! If you’re not getting a reading, switch to a lower setting.

Measuring Resistance: 

Measuring resistance is pretty straightforward, but you do have to disconnect individual components from a circuit to get their actual resistance, otherwise the rest of the components in the circuit can interfere with your measurement.

Using the multimeter to measure resistance of a component:

1. Put the black probe in COM port, and red probe in the port marked with a “Ω” or “Ohm” — it should be the same port as the voltage port.

2.  Switch dial to setting marked with a “Ω” (may have to choose approximate range for manual ranging multimeter).

3. Place probes on either side of the component (orientation doesn’t matter).

Read the meter output and you have conquered resistance!

Bonus: Measure Continuity!

The continuity measurement checks if two points in a circuit are electrically connected, otherwise known as a conductance test. Before measuring continuity, be sure that the circuit power is OFF.

Using the multimeter to measure continuity: 

1. Place black probe in COM port, and red probe in voltage port.

2. Switch dial to setting marked with an audio symbol.

3. Place probes at points you want to check — if the meter makes a beep sound, it means the two points are connected.

Le fin!

Go forth and measure all the things!

Now that we know how to use a multimeter, get crackin’ on all those at home, DIY projects! To get you started, here are a few quick, practical, & fun projects:

1. Measure the resistance of your skin! Change the distance of the probe leads and see how resistance changes. Lick your fingers (or dip them in water) to see how moisture affects resistance!

2. Measure the voltage across AA, 9V, or other batteries around the house/workplace/school to locate dead, or dying, ones.

3. Make a lemon battery and measure the voltage and current output.

4. Use the continuity setting to check if different materials conduct electricity.

 

Looking for more info on multimeters?

Check out this in-depth guide by the folks at Tools Critic!