Friday, November 18, 2016

Hey! We're gettin' bigger!

Check out our new awesome website! Should help ya find fun & interesting projects a bit easier, and keep you up to date with our content!

Share and subscribe!

Monday, August 8, 2016

Prototyping Magnetic Boots!

Walking across large, metal pipes in search of urban adventure, my inner voice joked, "Hey, magnet shoes would be handy right about now." Well, no arguing with that! Off to build my very own magnetic shoes!

This tutorial gives an overview of my build process for a magnetic boot prototype in hopes of inspiring you to build and test your own whimsical ideas! 'Cause seriously, making ideas come to life feels like a superpower.


-- Sturdy Boots
These had to secure my feet (aka no slipping out) and withstand my body weight. I found a pair of sturdy (although rather large) snowboard boots at a local thrift store which work as a first prototype.

-- Rare earth (neodymium) magnets
Small, thin-ish (< 1/4" thick) magnets with a 10 - 15 lbf rating (see previous step).

-- One screw per magnet (or per magnet hole)
Use screws with a length shorter than the sole of the shoe (so they don't poke your lil' feetsies.. or add some sort of rubber sole inside).

-- Suggestion: One washer per magnet
Supposedly, the washer helps increase the magnetic field of the exposed surface. I haven't calculated this or done any serious research, so at this point it's just a design suggestion.


-- Drill

-- Ruler

-- Pen/pencil.

-- CNC Router and a 3/4" drill bit


Build Process!                                                                                    

1. Level bottom of the boot with a CNC router (or other available method).

Clamp the boots to the CNC table with the bottom facing up -- a piece of wood was helpful to keep the boots straight.

Set the zero point of the CNC to be the lowest point on the sole of the shoe, then use a large bit (ours was 3/4") and level the sole of the shoe to the zero point.

2. Mark boot with tape for location of magnets.

3. For each magnet, drill in screw, magnet, and washer into the bottom of shoe.







To test the boot, I stuck it on a roof beam and pulled downwards. I added more magnets and repeated this until I couldn't pull the boot off by hand, then (slowly) tried to hang from it.

Lessons learned during testing:
1. I ended up using waaay more magnets than I thought, so it is probably worthwhile to calculate how the individual magnet fields are adding together.

2. Magnets need to be level to maximize the total magnetic field strength.

3. There is a limit to how close you can place each magnet depending on the shape and size of its magnetic field. Smaller, round magnets are easier to work with than large, rectangular magnets.

4. Don't place magnets close to parking passes (or other electronic devices). Also keep them far, far away from large containers of screws.

Results & Next Steps!                                                                       

​At this point, my magnetic shoes are more magnetic "gloves" (lol thanks @jayludden :D). But! I can successfully hang from one boot, so the concept works!

The lessons learned from testing will help improve this prototype design. Currently awaiting more magnets for the second boot (used most of them for the first one), trying different magnet orientations, and searching for a spot to test them upside down.

Stay tuned, will have them up and running, er, well, hanging, soon!

Many thanks to: ​Tinker Tank at Pacific Science Center for being my build and test center, and to ​Richard Albritton for the CNC help!

Friday, July 8, 2016

How to Use a (Simple) Oscilloscope

Visualize all those mysterious electronic signals with an oscilloscope!

Learn how to build and use a super simple $30 oscilloscope perfect for electronics hobbyist applications. It's also a great way to get started using some of the fancier oscilloscopes!

Reading and Changing the Oscilloscope Display

Every oscilloscope has a window that displays the voltage output of your signal. On every display, the y-axis is voltage, and the x-axis is time.

You can zoom in and out of the display grid by adjusting the "Volts per division"* or "Seconds per division".

On this oscilloscope, the voltage adjustment switches are on the left side (bottom two switches), and they let you zoom out to as much as 5 Volts ("V") per division, and zoom in to 10 mV per division.

Adjust the time scale using the "+" and "-" buttons on the right side.**

*"Per division" means the size of the squares, e.g. 1V per division means that each square is 1V in height, 1 second per division means that each square is 1 second wide. 
** Be sure that the time scale is selected (will be highlighted with a box around it -- this is the default selected setting, change settings using the "sel" button, described in more detail in the next section.


Other Basic Features 

This oscilloscope has all the expected features of larger, more expensive 'scopes, and also is a great introduction to some of the more complex versions.

On the left side, the top switch allows you to choose between a ground signal, a DC signal, and an AC signal. On the right side of the oscilloscope are four buttons:

1. The "ok" button (very top button): Pushing it once takes a snapshot of the screen, which can be saved to the oscilloscope. Holding this button down displays key numeric values about your signal, like the maximum and minimum voltage, signal frequency, etc.

2. The "+" button: Similar to an up arrow key, pushing this button allows you to sort through options.

3. The "-" button: Same as the + button, but, you know, scrolls down

4. The "Sel" button: Pushing this button allows you to select different features (described in order):
A. Change the time scale.
B. Set how the oscilloscope display refreshes - "Auto", "Norm," or "Sing". More on these in the next section.
C. Set the trigger slope. More on this in the next section.
D. Change the trigger level. More on this in the next section.
E. Adjust the horizontal position of the oscilloscope display.
F. Change the vertical position of the display.

Oscilloscope Trigger

Oscilloscope triggers cause the oscilloscope to display a signal. Triggers are set at a specific value, or "trigger level," along a specified direction, or "trigger slope" (more info below).

The trigger helps to display the exact electrical signal that you want, so that you get a stable display and measurement. In this 'scope, the trigger is set on the right side of the display and the LED at the bottom flashes when the trigger is detected.

The simple oscilloscope in this tutorial has three trigger modes that you can switch between using the "+" and "-" buttons:
  1.  Automatic ("Auto"): Display continually refreshes, regardless if triggers are met. 
  2.  Normal ("Norm"): Display only refreshes if the trigger is met.
  3.  Single ("Sing"): Same as normal mode, waveform display is held after a trigger has been detected.

More on Trigger Level and Trigger Slope!
The Trigger Level is a set, internal voltage that is compared to the signal, or input, voltage. The oscilloscope triggers when the signal voltage is equal to the trigger voltage. If an electronic signal rises and falls, then the trigger would happen twice: once when the signal is rising and again when the signal is falling. The trigger slope lets you choose which voltage (rising or falling) to trigger on.


Connecting a Component!

Now, to see the electrical signals at work in the world around you, connect the black lead to ground, and the red lead to the part of the circuit that you want to measure the voltage.

For example, if you want to measure the voltage output of a sensor, like the capacitor in the photo to the right, you want to connect the red probe after the sensor.

You may also want to calibrate your scope using the on-board signal. See the datasheet for more info.



Finally! Turning on the DSO138 Oscilloscope

The an oscilloscope kit in this tutorial takes about 2 -3 hours to assemble (instructions here), but is definitely worth it because many reasons! Here are a few: It's a great way to learn circuit components, get familiar with schematics, and practice soldering (and de-soldering....). And, honestly, it's pretty relaxing.

Once you've got the 'scope assembled, it needs 9V and about 0.1A. There are two power ports: a barrel jack and a male JST connector. You can use a 9V battery with the barrel jack (OMG it's portable!), or a power supply with the JST connector.

The exposed wire on the top of the oscilloscope is a square wave signal to help you calibrate the signal (see the datasheet for more info).

Be sure to use less than 12V or you risk heating up the board and possibly damaging it (don't let the black smoke out!).

Plug and Play!

Now you know all the basics to connect your oscilloscope to sensors, your tongue, and other low power sources to watch the wonderful world of electricity at work!

Please leave a comment in the tutorial if you have any questions or would like more info about the oscilloscope kit. Now go forth and explore all that electricity! :D

Interested in building a capacitive touch sensor like the one used in this tutorial? Check out this tutorial!

Friday, June 17, 2016

Hazardous Gas Sensor

Build a portable gas monitor to check for dangerous levels of hazardous gases in your home, community, or on the go and prevent your friends from lighting a cigarette during  a gasoline fight.*

This tutorial shows you how to build a web-connected "canary" monitor for three hazardous gases: Liquid Propane Gas ("LPG"), Methane (aka natural gas), and Carbon Monoxide ("CO") . Using the Particle Photon microcontroller, the sensor readings are converted into parts-per-million ("PPM") and uploaded to the web service.

*Please note that this is solely a movie reference -- gasoline fights should probably be avoided in real life.

Helpful Background Info!

1. How to set up the Particle Photon.
2. Pushing data to the web server.
3. New to relays? Check out this a handy reference.
4. Here's a helpful overview on the N-Channel MOSFET.
5. For powering the Photon, here's a thorough guide on the Photon Battery Shield.
6. Highly recommended to peruse the datasheets for the three gas sensors.

 Choosing a Battery!

The gas sensors used in this project require a fair amount of current, about 0.17 A each at 5V. To make the system portable, we'll need a high capacity battery. One easy, and affordable, option is to use four (rechargeable) AA batteries in series. These batteries will last about 4 hours.

Another option is to use a lithium ion battery ("LIB"). LIBs have a higher capacity than AAs, but typically run at a lower voltage. If you go with this option, you may need to include a correction factor when you calculate the sensor value or boost the battery voltage with a transistor or other component.

The photo above shows a table with the approximate lifetime of a few different battery options.

If all of this sounds confusing, here's a more thorough tutorial.


Here's a Wish List that includes all the necessary components for this project!

Microcontroller and Accessory Components
- Particle Photon microcontroller
- SparkFun Photon Battery Shield
- One 2000 mAh Polymer Lithium Ion Battery
- Surface Mount DC Barrel Jack
- Barrel jack to USB power supply cable
- One (1) Lamp Switch
- Optional: Male-to-Female JST connector cable

Gas Sensor Circuit
- One (1) Project Case
- One (1) 4 AA battery case
- Four (4) AA Rechargeable Batteries
- One (1) Toggle Switch (SPST switch)
- Piezo Buzzer
- Three (3) Red LEDs
- Three (3) 10 kΩ resistors
- One (1) PCB
- 22 Gauge stranded wire
- Optional: Electrical connectors (3-5)

LPG (MQ6) Gas Sensor
- MQ6 LPG Gas Sensor
- Gas Sensor Breakout Board
- One (1) 4.7 kΩ resistor
- One (1) 5V Voltage Regulator

Methane (MQ4) Gas Sensor
- MQ4 Methane Gas Sensor
- Gas Sensor Breakout Board
- One (1) 4.7 kΩ resistor
- One (1) 5V Voltage Regulator

Carbon Monoxide (MQ7) Gas Sensor
- MQ7 CO Gas Sensor
- Gas Sensor Breakout Board
- One (1) 4.7 kΩ resistor
- One (1) 5V Voltage Regulator
- One (1) 5V SPDT Relay
- One (1) N-Channel MOSFET
- One (1) 10 kΩ potentiometer
- One (1) 10 kΩ resistor


- Soldering Iron
- Wire cutters/strippers
- Drill
- Screwdriver
- Epoxy (or hot glue)

 Build it! Electronics

1. Solder gas sensor breakout boards to gas sensors. Orientation doesn't matter, just be sure that the silkscreen (aka labels) are facing down so that you can read them (had to learn that one the hard way..). Solder wires to the gas sensor breakout board.

2. Solder three voltage regulators to the PCB board. For each regulator, connect positive battery output to the regulator input, and connect middle voltage regulator pin to ground.

3. Connect the LPG (MQ6) and Methane (MQ4) sensors.
For each sensor:
  1. Connect H1 and A1 to the output of one of the voltage regulators (recommended to use an electrical connector).
  2. Connect GND to ground.
  3. Connect B1 to Photon analog pin (LPG goes to A0, Methane to A1)
  4. Connect a 4.7 kΩ resistor from B1 to ground.

4. Connect the CO (MQ7) gas sensor.
*Aside: The MQ7 sensor requires cycling the heater voltage (H1) between 1.5V (for 90s) and 5V (for 60s). One way to do this is to use a relay triggered by the Photon (with the aid of a MOSFET and potentiometer) -- when the relay is not powered, the voltage across H1 is 5V, and when the relay is powered the voltage across H1 is ~ 1.5V.
  1. Connect GND to ground.
  2. Connect B1 to Photon analog pin (A2). Connect 4.7 kΩ resistor from B1 to ground.
  3. Connect A1 to third voltage regulator output (5V source).
  4. Connect Photon 3.3V pin to positive relay input.
  5. Connect Photon Digital Pin D7 to left MOSFET pin, and a 10 kΩ resistor to ground.
  6. Connect middle MOSFET pin to relay ground pin. Connect right MOSFET pin to ground.
  7. Connect relay Normally Open ("NO") pin to H1, and the Normally Closed ("NC") pin to middle potentiometer pin.
  8. Connect right potentiometer pin to ground, and left pin to H1.
  9. Adjust potentiometer resistance until it changes the relay output to ~ 1.5V when the relay receives power.

5. Connect an LED and 10 kΩ resistor to each of the Photon digital pins D0, D1, and D2. Connect buzzer to Photon digital pin D4.

6. Connect toggle switch between battery pack and PCB board power. Recommended to include an electrical connector for the battery pack to make it easier to switch out batteries.

7. Connect lamp switch between LIB and Photon battery shield -- recommended to use an extra JST cable for this to keep the LIB battery cable in tact (and make it easier to install the lamp switch).

8. Label wires!

 Build a Case!

1. Drill hole for toggle switch on case lid.

2. Drill 3 holes in the case lid for the LED lights to shine through, and 3 holes for the gas sensors to have air contact. Adhere components on the inside of the lid.

3. Drill hole in the side of the case for barrel jack USB cord to connect to the Photon Battery Shield.

4. Drill two small holes on the side of the case for the lamp switch cable. Adhere lamp switch to side of case.

5. Label the LEDs with its corresponding gas sensor on the outside of the case.

6. Check electrical connections and, if everything is good to go, coat electrical connections in epoxy or hot glue.

Calculate Gas Sensor PPM!

Each of the gas sensors outputs an analog value from 0 to 4095. To convert this value into voltage, use the following equation:
Sensor Voltage = AnalogReading * 3.3V / 4095

Once you have the sensor voltage, you can convert that into a parts per million ("PPM") reading using the sensitivity calibration curve on page 5 of the gas sensor datasheets. To do this, recreate the sensitivity curve by picking data points from the graph or using a graphical analysis software like Engauge Digitizer .

Plot PPM on the y-axis and V_RL on the x-axis, where V_RL is the sensor voltage. There is a lot of room for error with this method, but it will give us enough accuracy to identify dangerous levels of hazardous gases. Estimated error bars are around 20 PPM for the LPG and Methane sensors, and about 5 PPM for the CO sensor.

Next, find an approximate equation for the PPM vs. V_RL curve. I used an exponential fit (e.g. y = e^x) and got the following equations:
LPG sensor: PPM = 26.572*e^(1.2894*V_RL)
Methane sensor: PPM = 10.938*e(1.7742*V_RL)
CO sensor: PPM = 3.027*e^(1.0698*V_RL)

Program it! 


First, set up a data stream on the [ service]( Next, write a program to read in the analog value of each gas sensor, convert it to PPM, and check it against known safe thresholds. Based on OSHA safety standards, the thresholds for the three gases are as follows:
  • LPG: 1,000 PPM
  • Methane: 1,000 PPM
  • CO: 50 PPM

If you want to get up and running quickly, or are new to programming, feel free to use my code! Use it as-is or modify to suit your particular needs.
Here's the GitHub page!
Here's the raw program code.

Change the following in the code:
1. Copy and paste your data stream public key to the array called `publicKey[]`.
`const char publicKey[] = "INSERT_PUBLIC_KEY_HERE";`
2.Copy and paste your data stream private key to the array called `privateKey[]`.
const char privateKey[] = "INSERT_PRIVATE_KEY_HERE";
To monitor the Photon output, use the Particle driver downloaded as described in the ["Connecting Your Device" Photon tutorial]( Once this is installed, in the command prompt, type `particle serial monitor`. This is super helpful for debugging and checking that the Photon is posting data to the web.

Be a Citizen Scientist!

Now we get to test and employ our gas monitor! Turn the batteries for the gas sensors on using the toggle switch, wait about 3 - 5 minutes, then turn the Photon on with the lamp switch (the gas sensor heater coils take some time to heat up). Check that the Photon is connected to WiFi (on-board LED will slowly pulse light blue) and is uploading data to the server. Also check that the gas sensor readings increase when in proximity to hazardous gases -- one easy, and safe, way is to hold a lighter and/or a match close to the sensors.

Once up and running, use the sensor to monitor for dangerous gas leaks around your home, school, workplace, neighborhood, etc. You can install the sensor in one location permanently, or use it to check gas levels in different locations (e.g. SoCal..).

Educator Extension!

This project is a perfect excuse for a hands-on chemistry lesson! Use the monitor to learn the fundamentals of various gases -- what kinds of gases are in our environment, how are different gases produced, and what makes some of them hazardous or dangerous.

Study the local environment and use a lil' math to record and plot LPG, Methane, and CO in specific locations over time to see how the levels change. Use the data to help determine what causes changes in the gas levels and where/when gas concentrations are the highest.

More to Explore!

Monitor hazardous gas concentrations around your neighborhood or city and use the results to identify problem areas and improve public safety.

Use Bluetooth, or your smartphone WiFi, to connect to the Photon and upload data to the web wherever you are!

Include other sensors, gaseous or otherwise , to create a more comprehensive environmental monitoring system.

Friday, May 27, 2016

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.
Creative Commons License
This work by Jennifer Fox is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License