Simple & Modular Wearable Lights

Build fabulous, futuristic, and adjustable wearable lights with just a few inexpensive (and deliverable) parts! Attach to to all sorts of accoutrements and swap out colors to match outfits/feelings/holidays/all the things!

Difficulty: Beginner+

Read time: 5 min

Build Time: 30 – 60 min

Cost: ~ $5

Materials

Tools

  • Safety Goggles!
  • Soldering iron and accessories*
  • Waterproof epoxy or superglue
  • Wire strippers
    • Scissors will also work just be careful to avoid cutting the wire.

*Unable to solder? Follow instructions but instead of soldering, tightly wrap and twist bare wire connections together, then wrap tightly with ​​conductive nylon fabric tape.

Setup!

  1. Turn on the soldering iron.
  2. Remove about 1/2″ (1cm) or the plastic coating on each of the female JST connectors.
  3. New to LEDs? Test ’em out!
    • Grab your coin cell and one of your LEDs.
    • With just those two pieces, explore how to make the LED light up!
    • Hint: Read the coin cell battery. How many sides does the battery have? How many legs does the LED have?

Make the first connector!

For all steps, be sure the coin cell is NOT in the battery holder.

Step 1: Solder your first resistor to the negative ( – ) hole on the coin cell battery holder.

  • With the switch facing you, use the negative hole on the left side of the holder.
  • Pro Tip: Wrap the resistor wire around the hole, getting the resistor body as close to the hole as possible. Use the soldering iron to heat the joint for about 3 seconds, then add solder to fill in the hole.

Step 2: Grab your first JST connector and solder the black wire to the other end of the resistor.

  • Pro Tip: Wrap the JST connector bare wire around the resistor leg as close to the resistor body as possible.

Step 3: Solder the red JST connector wire to the positive ( + ) hole on the battery holder.

  • With the switch facing you, use the positive hole on the left side of the holder.
  • Pro Tip: Wrap the JST connector bare wire around the hole Use the soldering iron to heat the joint for about 3 seconds, then add solder to fill in the hole.

Make the second connector!

Repeat the same process as for the first light, but using the right-side holes on the battery holder.

More details:

For all steps, be sure the coin cell is NOT in the battery holder.

Step 1: Solder your second resistor to the negative ( – ) hole on the coin cell battery holder.

  • With the switch facing you, use the negative hole on the right side of the holder.
  • Pro Tip: Wrap the resistor wire around the hole, getting the resistor body as close to the hole as possible. Use the soldering iron to heat the joint for about 3 seconds, then add solder to fill in the hole.

Step 2: Grab your first JST connector and solder the black wire to the other end of the resistor.

  • Pro Tip: Wrap the JST connector bare wire around the resistor leg as close to the resistor body as possible.

Step 3: Solder the red JST connector wire to the positive ( + ) hole on the battery holder.

  • With the switch facing you, use the positive hole on the right side of the holder.
  • Pro Tip: Wrap the JST connector bare wire around the hole Use the soldering iron to heat the joint for about 3 seconds, then add solder to fill in the hole.

Test and Secure Joints

Step 1: Trim any excess wire.

Step 2: Insert the coin cell battery into the holder and move the switch to the “ON” position.

Step 3: Insert LEDs into the JST connectors so that the longer (positive) LED leg plugs into the red wire of the JST connector.

Step 4: Check to ensure that the LEDs light up! If it does, proceed to Step 4. If not, follow the troubleshooting guidelines below.

Step 5: Remove the battery, then thoroughly cover all exposed solder joints with epoxy or super glue and let dry in a safe, out-of-the-way spot. Remember to glue the back of the battery holder!

  • Be sure to glue the connections between the JST connector and resistor. Coat the positive and negative solder holes, but DO NOT cover any other parts of the holder or it may be impossible to insert the battery or use the switch.
  • Check the dry time for your glue (mine was about 60 minutes until fully dried). Be sure to avoid bumping or getting hair on your project, as it will be hard to remove after (as a dog owner this is a constant challenge!).
  • Pro Tip: Use a fine-tipped brush or skewer to add the glue.

Troubleshooting:

  • Check the power. The battery should be inserted so that the positive side (with the writing) is facing up.
  • Double check the LEDs are inserted in the correct orientation: longer leg to positive (red) wire, shorter leg to negative (black) wire.
  • Gently wiggle your solder connections. If you notice the LED flashes on, it is likely a poor solder connection.
    • Remove the battery and add more solder to your joint.
  • Check that the solder joints are not shorting the battery holder. If you feel the battery getting warm, this is likely the culprit
    • Check that the solder is contained to the positive and negative holds ONLY. It should not be touching any other parts of the holder, especially any exposed metal.

Finish & Flaunt!

Finally, grab your attachment mechanism and, if needed, glue to the back of the battery holder and let dry (I used a magnet for mine so no glue necessary!). Insert your preferred LEDs and attach your light-up accessory to your clothes or hair for some futuristic flourish!

Going Further

  • Sew somethin’ pretty to go over the lights!
  • Aside from hair, explore different options for diffusing the LED light. Some quick, inexpensive options are ping pong balls, a dab of hot glue around the LED bulb, or white fabric.
  • More lights!! Test before doing this as the brightness of the lights will change depending on whether you connect them in series or in parallel.
  • Add a dark detecting circuit so your lights only turn on in the daytime!
    • You can harvest a dark detecting circuit from a solar path light.
    • Or search online for the circuit!

Questions? Ideas? Let me know! I’d also love to see your finished creations, so please share!

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

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

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

Anyway….

Here we go!

Read Time: 7 min.

Build Time: < 30 min.

Project Cost: $15 – $20

Materials

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

… Seriously, that’s it!

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

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

Step 1: Program the Micro:Bit!

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

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

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

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

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

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

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

Step 2: Optional Triangle Cover

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

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

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

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

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

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

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

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

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

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

Make a Minecraft Gesture Controller!

Move your body to play Minecraft! What!! Yes. Check the video for a demo 🙂

This tutorial will show you how to make your very own gesture game controller for Minecraft (or your other fav. computer game). Move your hand(s) to walk/run/jump, look around, and attack* all the things!

Let’s get started! Grab yourself a Circuit Playground Expresssnag my program code, and get shakin’ to play Minecraft in (srsly) the most fun way ever! 😀

Read time: 20 min

Build Time: ~ 2 hours

Cost: ~$30

*It is a biiiiit tricky to attack moving things (like monsters), so be careful in survival mode! Or use this to challenge your skills 🙂

Materials

Tools

  • Sewing Needle
  • Scissors
  • and a lil’ patience.. 🙂

 

Build the Glove Controller!

You can make the gesture controller without the glove, but the glove controller makes it easier to play, keeps the CPX in the same orientation (very important), and means you can use your fingers as added controls!

1. Cut rectangles of conductive fabric for the finger pads (~ 0.5 in. x 1 in.).

2. Use regular thread to sew the conductive fabric pads onto each of the glove fingers.

Suggested to use a highlighter or other pen to avoid sewing the two sides of the glove together (learn from my mistakes bbies).

3. Attach CPX to the glove with velcro squares.

4. Use an alligator clip or insulated wire to connect the CPX ground (“GND”) to the thumb pad.

5. Stitch conductive thread from the CPX capacitive touch pads (A1, A2, A3 & A4) to each of the four fingers.

6. If you have a multimeter, check continuity between the CPX pins and the conductive thread pads.

Plan out your controller!

 

First! What do we need to do to control Minecraft (or another awesome game)?

This is a super helpful & fun lesson in Design Thinking, but you can skip this if you want to just use my controls. You can always come back here later if you want to make changes later 😀

1. Determine (crucial) game controls.

Note: Start simple! Figure out the most important controls for the game and start there. You can always add more later.

Here are the controls that I wanted to use while playing Minecraft.. in creative mode 🙂 (you can use the same ones or customize your own controller!):

Movement:

  • Walk forward: W key
  • Run: Ctrl + W
  • Jump: Space bar
  • Look Left & Right: Mouse rotate
  • Walk backward: S key

Actions:

  • Attack: Mouse Left Click
  • Place Block/Push/Open: Mouse Right Click
  • Inventory: E key
  • Escape: ESC key

2. Decide how you want to use gestures and/or the finger pads to trigger these controls. Recommended to sketch out your plan.

Here is my design thought process:

I’ve always wanted to feel like I was actually *in* a game, so I went the “cheap VR” route and used gestures to control basic movements. For walking, I went the “let’s move my arms like I’m walking” route, which easily transitioned into running and jumping by increasing the speed of motion.

To make it easy to place a block or exchange items, I decided to use an “awkward handshake” motion.

Turning was a bit of a challenge, but my goal was to be able to look around by moving my hands in the direction I wanted to look.

Attack became the pointer finger pad, inventory the middle finger pad (which I ended up removing), Escape the ring finger pad, and the pinky finger pad to let me to walk backwards.

Again, you can keep these same controls or design your own 😀

Let’s get programming: Set up the CPX!

1. If you’re using Windows, download the Adafruit Windows Drivers here.

2. Download & save the latest CPX Circuit Python UF2 file.

3. Plug in the CPX with a USB cable (make sure it has data transfer capabilities).

4. Double-click the reset button on the CPX.

The LEDs should turn green. If they are red, it means something is wrong with data transfer to the CPX — check the USB cable, try another USB port on your computer, or try the trusty “unplug and plug back in” method.

5. On your computer, you will see a new disk drive called “CPLAYBOOT”.

6. Drag the CPX Circuit Python UF2 file onto the disk drive.

7. The “CPLAYBOOT” drive will disappear and be replaced with “CIRCUITPY”.

 

Add all the libraries!

Libraries let us access all sorts of special functions for the CPX without having to do a ton of programming.. hooray for open-source! This install will download most of the standard Circuit Python libraries* so peruse them at your leisure to learn about more cool things you can do!

1. Download and save the Adafruit Circuit Python Library Bundle Release from here.

2. Unzip the folder, open the first folder, and copy the “lib” folder onto the “CIRCUITPY” drive.

*It is unlikely that you’ll run out of space since the CPX comes with at least 2MB of Flash storage. But, if you do end up needing more space, you can revisit the libraries and remove the ones you don’t need. If you mess ’em up, just copy and paste the lib folder again.

 

Writing the Controller Code

The CPX has an on-board compiler, which means you can program it in (pretty much) any language you want! I opted for MicroPython, a version of Python for microcontrollers, ’cause Python is awesome.

Read this step if you want to understand how the program works (definitely suggested) or if you want to modify the code.

Here’s the GitHub repository that has the full code.Download it, drag it to your CPX, and rename the file “Code.py” (here’s the raw code if you want to just copy & paste).

1. To do the things I mentioned in the last step in MicroPython, we need the following libraries:

  • LIS3DH accelerometer

    • This allows us to use motion to trigger various things.
  • Human Interface Device (“HID”) keyboard

    • This library allows us to control the keyboard!
  • HID mouse

    • This library means we can control the mouse!
  • CPX capacitive touch
    • This library lets us use the capacitive touch feature on the CPX, hooray!
  • A couple of other libraries to make our lives easier: timebusio, and board.

2. Configure and initialize the libraries.

Assign variables for the keyboard, mouse, and accelerometer objects. Select a range for the accelerometer.

3. Write short functions for each of the controls.

The motion controls can be tricky. Do some initial testing with the accelerometer by printing the values in a serial monitor (in the source code, go to the __main__ function and uncomment the two debugging lines). This will help you to determine thresholds for walking, running and jumping, looking left and right, and placing objects.

The touch pad triggers are much easier as you are only looking for a capacitive trigger (True/False).

Remember to release all of the keyboard and mouse keys at the end of each function!

Debugging: Seeing what’s up the CPX program

If you’re familiar with Arduino, you’re probably familiar with the Serial Monitor. The CPX has the same feature with a slightly different access point depending on what program you are using.

If you are using Mu it’s super easy: the serial console is built in and will automatically detect your board, yay!.

If you are using Idle or another program, follow these steps:

1. Download PuTTY* here.

2. Go to Windows Device Manager and check the serial port number for the CPX (e.g. COM18) — see Photo below.

If there are multiple serial ports listed, unplug the CPX and plug it back in to see which one disappears then reappears.

3. Open PuTTY and select “Serial”.

4. Enter the serial port number (e.g. COM18) under “Serial line” and the baud rate of 115200 under “Speed”.

5. Click Connect! 

*PuTTY is a free and open-source SSH and telnet connection program.

 

Test & Improve

Load the program onto the CPX by dragging and dropping the python file onto the CIRCUITPY drive, then rename the file as “Code.py”

Like pretty much every project, this one will likely be a little wonky when you first get it running. If the touch pads are acting strange, reset the CPX (this recalibrates the capacitive input pins).

Test 1:

– Open up the serial monitor with PuTTY and run the program (CTRL + D)

– Test each of the movement controls (you’ll see the mouse moving on the screen and make sure the program doesn’t crash as well as the touch pads (which should display relevant text on the serial monitor).

Test 2:

Deploy in Minecraft creative mode! Test the movement and action controls to see if anything breaks or doesn’t work as expected (plz keep in mind that this is a prototype)

Update the program based on your testing. Remember, it’s OK if it’s not perfect, there’s always time to make it better!

 

Have all the fun!!

You’re ready to run through Minecraft!! Just be wary of monsters, it might be a bit tricky to protect yourself..

Supplementing your gesture controller with a keyboard is a good idea if you want play for reals 🙂

Please like and/or leave a comment if you enjoyed the tutorial! And of course, let me know if you have any comments or questions!
Happy Building!

<3, jenfoxbot

Anti-Facial Recognition Wearable No. 1

Every time we leave our homes, we are photographed and videotaped in public and private spaces. Facial recognition software identifies our unique facial features and can be used to tag us in photos that are taken with or without our consent. This tutorial is about exerting our right to control our personal privacy. It is our choice and our right to decide if we want to be identified by cameras that photograph us in public and private spaces.

There are many approaches to anti-facial recognition makeup/wearables. This is my first approach based on some background research, chatting with fashion-minded friends, and my own personal artistic and electronic interests.

The purpose of this project is to make it more normal (& fun!) to wear privacy enhancing fashion so that if/when it is needed, folks who are using it for legitimate protection are not targets.

Follow along or use this as inspiration for your own anti-facial recognition wearables! If you design your own, pleasepleaseplease share it in the comments so other folks can learn from and be inspired by you!

Difficulty: Easy

Build Time: 1 – 2 hours (+2 hours for glove controller)

Cost: < $15

Quick Overview of Facial Recognition Software

Computer Vision, or “CV” for short, is a software method that breaks down images into a series of black and white pixels, and then attempts to extract meaning from patterns in the pixels. Since human faces have the same characteristics (two eyes, nose, mouth, & chin), these characteristics can be broken down into patterns that a software program can look for.

For example, pupillary distance, or the distance between the pupils of each eye, varies from about 54 to 68 mm for adults – a CV program would look for black pixels separated by that distance range and log those as one layer. There are tons of patterns that a CV program can search for and locate, then go back and analyze the layers together to ensure they match up. All of these values are stored as variables that can be used for comparison with other images.

The more images a CV program analyzes, the better it gets. By comparing CV-found patterns to patterns in existing photos tagged on social media, CV programs may also tag an individual regardless of where that photo was obtained. CV programs are incredibly accurate, can select a face from multiple angles and backgrounds, and can identify a person’s emotions.

Check out CV Dazzle to learn more about anti-facial recognition makeup and other styles!

 

Materials & Tools

Materials

Optional glove controller:

Tools

  • Liquid Latex
  • Scissors
  • Wire Strippers
  • Soldering Iron (recommended for glove controller)
  • Hot glue gun (or other fabric-safe glue)

 

Step 1: Attaching the Flowers

Use the flowers to cover up distinguishing facial features. Eyes, eyebrows, and nose bridge are three primary regions of the face that are used by facial recognition software to identify and tag a face.

1. Cut flower stems off (unless you want ’em on for aesthetic purposes).

2. Pour a small amount of liquid latex into a container.

3. Figure out where you want to put the flower, then dab the base of the flower into the liquid latex. Let it dry for a few seconds, until it feels sticky and less liquid.

Be sparring with this stuff, it can be kinda painful to peel off, especially after 30 flowers.

4. Attach the flower to your skin. BUT FOR REAL THOUGH avoid your hair!! It is a huuuge pain (literally) to get out.

5. Repeat 2 & 3 until your face is adequately covered.

You can check your progress using a Snapchat or Instagram filter: If the filter can’t find your face or looks wonky (like sunglasses on your forehead instead of your eyes) then you’re all set!

 

Step 2: Adding LEDs!

To add freestanding LEDs, grab a coin cell, and push the two LED legs over the coin cell battery sides (longer LED leg on the positive battery side). Dip one side in the liquid latex, let dry for a few seconds, and then smoosh onto your skin just like with the flowers (again, avoiding precious and sensitive hair).

If you’re using the glove controller (see next step), run the LED wires up your arm to behind your ear, holding them in place with rubber bands or hair bands. Arrange how you want the LEDs to point, then pin the wires in place with bobby pins. That should be sufficient to hold them, if not add some liquid latex to the ends of the LEDs.

The LED + coin cell combo should last ~ 12 hrs.

 

Step 3 (Optional): Make a Glove Controller

This is a good option if you want to save battery life or to be able to turn on/off the LEDs. The thumb is the battery case, with conductive thread on the top as the positive connection. The fingers are the positive connections for the LEDs.

This takes ~ 2 – 3 hours to build.

1. Attach wires to the LED(s).

Measure out two (2) wires per LED to span from your head, down your neck, and to your wrist. Add 3″ to this measurement to allow for movement. Cut wires and strip both ends.

Mark the positive side of the LED with a pen, then twist one end of each wire around the LED leads. Solder the LED leads to the wire. Use a red wire, or mark the positive wire with a pen.

If available, use heat shrink tube to make a poke-less connection. Or just coat it in epoxy or hot glue or some other liquid adhesive.

Repeat for each LED you want to add to the glove.

2. Using conductive thread, make the negative side of the circuit: a negative connection for the coin cell and a “ground bar” for the LEDs.

Put on the glove, and mark where the center of the battery will go. Sew about 10 layers of conductive thread over your mark — this is the ground connection for the coin cell battery.

With the thread still attached, sew down to the base of the glove and stitch back and forth until there are a few layers of conductive thread in a line — this is the negative connection for the LED connections.

3. Make a coin cell battery case on the thumb of the glove.

Cut out 1 square of regular fabric, and 1 square of conductive fabric.

Cut a small hole in the regular fabric and then stitch the conductive fabric square over the hole (with regular thread). Run over this a few times since the conductive fabric tends to fray.

Using normal thread, sew 3 of the 4 sides of the regular fabric over the negative connection for the battery, so that it makes a lil’ pouch for the coin cell. (You might want to sew down the 4th side a bit to hold in the battery, or use a safety pin).

4. Attach the positive side of one LED to a glove finger and make a conductive pad.

Sew the positive LED wire onto the glove (regular thread)

Still using regular thread, sew a square of conductive fabric over the stripped end of the wire.

5. Attach the negative side of the LED to the glove ground pad.

Wrap the stripped end of the wire to the conductive thread ground pad and/or use conductive thread to secure it.

6. Repeat 4 & 5 for all LEDs.. or until you run out of fingers.

7. Epoxy or use fabric glue to adhere all of the connections.

 

Step 5: Test & Deploy!

Test your privacy enhancing getup by opening Snapchat or another filter app and check that it can’t identify that there is a face in the image. At the very least, if it does identify a face, be sure that the filter it adds is hilariously broken.

If you want to get real serious, you can download the OpenCV library and test it against your wearable — this is my long-term goal, but for now I’m happy with sticking flowers and LEDs on my face for V1.0.

Stay tuned for more of these anti-facial recognition wearables and please share your awesome creations!

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!

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.

 


Materials


— 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.


Tools



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.


Testing!


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!

Sound Reactive EL Wire Costume

Bring science fiction to life with a personalized light-up outfit! EL wire is a delightfully futuristic-looking luminescent wire that has the added benefit of staying cool, making it ideal for wearable projects. Combining sensors and a microcontroller with EL wire allow for a wide range of feedback and control options.

This project uses the SparkFun sound detector and the EL Sequencer to flash the EL wire to the rhythm of ambient sound, including music, clapping, and talking.

Materials

Electronics

 

El Wire comes in a variety of colors, so pick your favorite(s)!

Costume

  • Article(s) of clothing

For a Tron-esque look, go for stretchy black material. Yoga pants and other athletic gear work great!

  • Belt
  • Old jacket with large pocket, preferably zippered or otherwise sealable.

The pocket will house the electronics. If you intend to wear the costume outdoors in potentially wet weather, choose a pocket that is waterproof (i.e. cut a pocket from a waterproof jacket).

  • Piece of packing foam or styrofoam (to insulate the sound detector).

Tools

Build it! Pt. 1

CAUTION: Although it is low current, EL wire runs on high voltage AC (100 VAC). There are exposed connections on the EL Sequencer board so BE CAREFUL when handling the board. Always double (and triple) check that the power switch is OFF before touching any part of the board. For final projects, it is recommended to coat all exposed connections in epoxy, hot glue, electrical tape, or other insulating material.

1. Test EL Sequencer with EL Wire.
Connect the inverter, battery, and at least one strand of EL wire to the EL Sequencer. (Note that the two black wires of the inverter correspond to the AC side.)
Be sure that the EL Wire lights up and blinks when you power the EL Sequencer on battery mode.

2. Solder header pins onto 5V FTDI pinholes on the EL Sequencer and onto the VCC, ground, and A2 input pins.

3. Solder header pins to the sound detector.

4. Connect sound detector to EL Sequencer via female-to-female breadboard wires (or solder wire onto header pins).
Connect the sound detector VCC and ground pins to the VCC and ground pins on the EL Sequencer. Connect the sound detector gate output to the A2 input pin on the EL Sequencer. If you are using the envelope and/or audio output signals, connect these to pins A3 and A4 on the EL Sequencer (more on this in the Program It! section).

Build it! Pt. 2

1. Make a protective casing for the sound detector using packing foam or styrofoam to prevent jostling or other physical vibrations (aka collisions) from triggering it.

Place sound detector on top of foam, outline the board with a pen, and cut out a hole in the foam for the detector to fit snugly inside. Also recommended to epoxy the wires onto the foam (but not the sound detector board).

2. Cut out a pocket from the jacket and sew onto the belt.

3. Put belt on, connect EL Wire to EL Sequencer, and place EL Sequencer in pocket pouch. Determine approximate placement of each EL wire strand based on location of electronics.

Build it! Pt. 3

1. Mark and/or adhere the base of the EL wire JST connector onto clothing, allowing the full length of the connector to flex. Be sure that the JST connector can easily reach the EL Sequencer.

2. Starting at the basse of the JST connector, attach EL wire strands to your chosen article of clothing.

Sew EL wire onto clothing using strong thread or dental floss, or use an appropriate fabric adhesive.
Prior to adhering the EL wire, it is recommended to use safety pins to determine placement of the EL wire on each article of clothing while you are wearing it. EL wire is flexible but not so stretchy, so give yourself some wiggle room.

It is also recommended to use separate EL wire strands on different articles of clothing to facilitate the process of taking it on/off.

Program it!  

1. Connect EL Sequencer to computer via 5V FTDI BOB or cable. 

2. Program the EL Sequencer using the Arduino platform; the EL Sequencer runs an ATmega 328p at 8 MHz and 3.3V.

3. Determine how you want to use the sound detector output(s) to control the EL wire. The sample program below utilizes the gate channel output to turn on the EL wire if there is a sound detected.

Sample Program:

// Sound Activated EL Wire Costume<br>// Blink EL Wire to music and other ambient sound.
//JenFoxBot
void setup() {
  Serial.begin(9600);  
  // The EL channels are on pins 2 through 9
  // Initialize the pins as outputs
  pinMode(2, OUTPUT);  // channel A  
  pinMode(3, OUTPUT);  // channel B   
  pinMode(4, OUTPUT);  // channel C
  pinMode(5, OUTPUT);  // channel D    
  pinMode(6, OUTPUT);  // channel E
  pinMode(7, OUTPUT);  // channel F
  pinMode(8, OUTPUT);  // channel G
  pinMode(9, OUTPUT);  // channel H
//Initialize input pins on EL Sequencer
  pinMode(A2, INPUT);
}
void loop() 
{
  int amp = digitalRead(A2);
    
  //If Gate output detects sound, turn EL Wire on
  if(amp == HIGH){
    
    digitalWrite(2, HIGH); //turn EL channel on
    digitalWrite(3, HIGH);
    digitalWrite(4, HIGH);
    delay(100);
  }
  
    digitalWrite(2, LOW); //turn EL channel off
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
  
}

This program is just one example of what is possible with the SparkFun sound detector. Depending on your needs, different responses can be achieved by using the “envelope” and “audio” outputs of the sound detector. The EL Sequencer can individually control up to 8 different EL wire strands using the three sound detector output signals, so there are tons of possiblities to customize your sound-activated outfit!

More information about the sound detector output signals:
The gate channel output is a digital signal that is high when a sound is detected and low when it is quiet. The envelope channel output traces the amplitude of the sound, and the audio output is the voltage directly from the microphone.

In the photo provided, the red trace corresponds to the gate signal output, the light green trace corresponds to the envelope signal output, and the dark green trace corresponds to the audio signal output.

Test, Secure, & Show Off!

Connect all components to the EL Sequencer (inverter, battery, sound detector) and place in belt pouch. Turn the system on, make some noise (e.g. clapping, snapping, or music) and check that the EL wire flashes when there is a sound.

If the outfit works as expected, secure all connections by coating them in a (thin) layer of epoxy. Let dry for at least 24 hours. Epoxy is a very permanent adhesive, so if you want to reuse any of the components, try other adhesives like hot glue or electrical tape (less secure, but adjustable and removable).

You can reduce the overall strain on individual connections by ensuring that wires are securely fastened to the belt and/or pouch approximately one inch (1″) from all connections. The goal is to allow the EL wire to flex while keeping electrical connections rigid, as the connections are the most likely point of breakage.

Wear your one-of-a-kind, high-tech outfit and go show it off to the world!

EL Wire Light Up Dog Harness

Whether it’s to keep Fido (or in my case, Marley) visible on an adventure or as an awesome all-year-round costume, a light up dog harness is an excellent accessory for your favorite pup.

EL wire is a great option for wearable lights. It stays cool, is flexible, and comes in lots of different colors. This design uses the SparkFun EL Sequencer to automatically turn on EL wire when it is sufficiently dark outside so you don’t have to worry
about locating Mr. Dog to turn the system on.

Here’s a video tutorial for this project.

Recommended Reading

If you are new to electronics, EL wire, or the EL Sequencer, or would like more information on the main components in this project, check out this tutorial.As this design also uses a lithium ion battery, I also recommend reading this tutorial to give you an overview on proper care and handling of lithium batteries.

Materials

Electronics

  • EL Wire
    • EL wire comes in variety of colors, pick your favorite!

Harness Materials

  • Dog harness
    • A vest or backpack will also work.
  • Waterproof jacket with pocket(s)
  • Optional: Tupperware or other sealable plastic container

Tools

  • Safety goggles
  • Soldering Iron
  • Wire Cutter/Stripper
  • Epoxy (waterproof)
  • Scissors
  • Needle + thread OR fabric adhesive
  • Optional: Velcro

Build it! Pt. 1

**CAUTION:** Although it is low current, EL wire runs on high voltage AC (100 VAC). There are exposed connections on the EL Sequencer board so BE CAREFUL when handling the board. Always double (and triple) check that the power switch is OFF before touching any part of the board. For final projects, it is recommended to coat all exposed connections in epoxy, hot glue, electrical tape, or other insulating material.

1. Test the EL Sequencer with EL wire.
Connect EL Wire, inverter, and battery to EL sequencer.
Turn on power switch and check that the EL wire turns on (should be blinking). You can connect, and control, up to 8 different strands of EL wire.

2. Solder header pins onto 5V FTDI pinholes on the EL Sequencer.

 
3. Solder header pins to the “GND,” “VCC,” and “A2” pinholes EL Sequencer (right side).

4. Solder male end of breadboard wires to ambient light sensor. Coat exposed metal on the sensor in epoxy (do not coat actual sensor).

Note: Recommended to solder the pins on the bottom of the sensor so that the sensor can more easily be attached to the harness (found this out the hard way..).

 

 

 

 

Build it! Pt. 2 

1. Attach EL Wire to harness.
Sew EL wire onto harness with dental floss for a strong, durable bond. Can also use an appropriate fabric adhesive.For straps/buckles: leave about 1″ of unattached EL wire on either side of the strap/buckle.You can either wrap the ELwire for its entire length, or cut it and insulate the ends.2. Make a durable pouch for the electronics.
For a waterproof pouch, cut out a pocket in a waterproof jacket. I also included a small tupperware container to house the electronics in the pouch to further insulate and protect them from weather and dog conditions.

Build it! Pt. 3

1. Attach electronics pouch to harness.
Sew pouch onto top side of harness, or wherever is comfortable and practical for your pup. Recommended to put harness on dog to find a suitable location for the pouch.

2. Cut small holes on underside of pouch for the EL wire JST connector and the light sensor wires.

3. Attach and secure light sensor to harness. Recommended to put harness on your dog and mark location for light sensor so that it faces upward.
There was an ideal flap in the rainjacket pocket for me to cut a hole, push the sensor through, and epoxy the other side. You can also use velcro or sew the light sensor onto the pocket or harness, just be sure that it stays stationary and won’t get covered when the dog is moving.

4. If using tupperware, cut or drill holes in tupperware for EL wire JST connector and light sensor wires.
If you are not using tuperware, it is recommended to cushion the electronics and/or epoxy all connections (except the JST connectors) to protect them from your dog’s antics.

5. Connect EL wire and light sensor to EL Sequencer (through holes in the tuperware), then epoxy the holes to keep wires in place and maintain a waterproof seal.

Program It!

1. Connect EL Sequencer to computer via 5V FTDI BOB or cable. 

2. Program the EL Sequencer using the Arduino platform; the EL Sequencer runs an ATmega 328p at 8 MHz and 3.3V. 


3. Write a program to read in the analog value of the ambient light sensor, turn on the appropriate EL wire channels at a value that corresponds to low light, and turn off once the light sensor value is above the low light threshold.Here’s a sample program with a preset light threshold:

// EL Wire Dog Harness Program
// Turn EL wire on when ambient light is low.
// JenFoxBot
// Based on test sketch by Mike Grusin, SparkFun Electronics
void setup() {
  Serial.begin(9600);  
  // The EL channels are on pins 2 through 9
  // Initialize the pins as outputs
  pinMode(2, OUTPUT);  // channel A  
  pinMode(3, OUTPUT);  // channel B   
  pinMode(4, OUTPUT);  // channel C
  pinMode(5, OUTPUT);  // channel D    
  pinMode(6, OUTPUT);  // channel E
  pinMode(7, OUTPUT);  // channel F
  pinMode(8, OUTPUT);  // channel G
  pinMode(9, OUTPUT);  // channel H
  // We also have two status LEDs, pin 10 on the EL Sequencer, 
  // and pin 13 on the Arduino itself
  pinMode(10, OUTPUT);     
  pinMode(13, OUTPUT); 
  pinMode(A2, INPUT);  
}
void loop() 
{
  int x,status;
  
  //If ambient lighting is too low, turn on EL wire
  if(analogRead(A2) < 50){
    digitalWrite(2, HIGH); //turn EL channel on
    delay(1000); //wait 1 second
    
    //Keep EL wire on until light sensor reading is greater than 50
    if(analogRead(A2) > 50){
      digitalWrite(2, LOW); //turn EL channel off
      delay(10);
    }
    
    Serial.println(analogRead(A2)); // Use this to check value of ambient light 
    
    digitalWrite(10, status);   // blink both status LEDs
    digitalWrite(13, status);
  }
}

4. Check that the EL wire turns on when the ambient light is low, and turns off in bright light. 

Test it and Put it to Work!

Place EL Sequencer, inverter, and battery inside the pouch (and tupperware). Connect all components to the EL Sequencer and turn it on using battery power. Test it in low and bright light to ensure that it functions properly.

If system works as expected, put on dog and go exploring!As an added bonus, you can use the electronics pouch to store other small, non-magnetic items. Enjoy!

LED Proximity Sensor Gloves

This is a minimalistic design for a proximity sensor glove: a light-up glove that dims in brightness when an object, or person, is close to the sensor. This project costs less than $10, although it does take some time to build (1 – 2 hrs).

This is also a modular design, meaning that it is easily customizable and can be used in other projects.

Here’s a video showing the glove in action.

Materials

  • Gloves (fingertips optional)
    Pretty much any type of glove will work. I chose simple cotton ones (that are well worn and have character) because it’s easy to sew components into these gloves and, if necessary, can easily (& cheaply) be replaced.
  • LEDs! I had 5mm white LEDs on-hand, so I used 10 for one glove. As long as each LED has appropriate resistance, you can (pretty much) add as many as you want.
    I strongly recommend getting surface mount LEDs or wearable LEDs. They are a bit more expensive, but are much more aesthetic for this type of project and are waay easier to sew.
  • Conductive thread
    This is one way to connect + attach the LEDs. I chose conductive thread b/c it looks cool and incorporates the circuit into the glove material, acting as both a conductor and an adhesive. Other options include wire or alligator clips.
    Disclaimer: When using conductive thread, be super careful of short circuits. I set my conductive thread on fire more than once during this build process..
  • Photoresistor
  • Five 1 KOhm resistors (one for each pair of LEDs) The value and number of your resistors may change depending on your battery + LED type.
  • 9V battery + battery clip
  • Switch (optional)

Tools

  • Scissors
  • Sewing needle
  • Hot glue gun, epoxy, or other quick-drying adhesive.
  • Soldering iron (optional) You can build the glove without a soldering iron by tying conductive thread tightly to a component, then coating in hot glue or other adhesive.
  • Multimeter (highly recommended) A multimeter is super useful for checking electrical connections.

Build it! Pt. 1

If a breadboard is available, use it to test the circuit.

  1. If you have a switch, connect one end to a battery clip lead.
    Solder the two wires together, or use conductive thread + hot glue.
  2. Determine layout of the photoresistor(s), LEDs, and resistors.
    You can follow my schematic or you can add more LEDs and/or photoresistors (recommended b/c it’s cooler). Here’s a helpful website to calculate the circuit resistance. Remember that the photocell also adds some resistance (mine was between 300 Ohms and 1 MOhm).
    In my layout, two LEDs are connected in series with a resistor, as in the breadboard photo above. These in-series LED pairs are then connected in parallel with all other in-series LED pairs.
    Aside: Diode forward voltage & current depends on the color. These white LEDs were ~ 3.4 VDC and 20 mA. Use Google or this page to find forward voltage and current for your specific LEDs.
  3. Turn glove inside out and mark location of the LEDs, resistors and photoresistor(s).
  4. Sketch the positive and negative connections onto the glove w/ a pen. Label the + and – lines.
    This step is especially helpful b/c 3D circuits can be a bit confusing.

Build it! Pt. 2

  1. f68ghgsi1cc12bw-largeAttach the photoresistor to the glove (and add a positive battery lead to the glove).
    Make a slit in the glove or push the photoresistor wire legs through the fabric (be sure the legs are on the inside of the glove). To hold it in place, dab hot glue or sew legs to glove with regular thread.Tie conductive thread to one end of the photoresistor (either leg works), and sew thread through the
    glove to the bottom. Leave a few inches of thread at the end for the the
    battery connection. Coat connection in hot glue.
  2. Attach a resistor to the positive leg of one LED. Repeat for one LED in each set of LEDs that are in-series (5x for this configuration).
    Wrap the two ends together and, if possible, solder the connection. Remove excess wire and coat in hot-glue to adhere connection and cover sharp ends.

Build it! Pt. 3

  1. Attach the LED + resistor to the glove.
    Poke the ends of the LED through the glove (or make a slit). Tie conductive thread to LED legs and coat in hot glue to hold components in place, and to cover sharp ends.
    Be careful to avoid shorting the LED legs with the conductive thread. 
  2. Connect the LED + resistor to the open leg of the photoresistor. Sew conductive thread from the resistor leg to the photoresistor leg, then tightly tie thread to photoresistor leg. Coat connections in hot glue.
  3. Connect the next in-series LED.
    Connect the positive leg of the next in series LED to negative leg of the previous LED.
    Depending on the type and number of LEDs you are using, you may have one, two or more LEDs in series w/ the first LED + resistor.
  4. Repeat Steps 1 – 3 for all LEDs in parallel.

Build it! Pt. 4

  1. Once all the LEDs + resistors have been installed, add in a negative battery lead.
    Consider where you want to put the battery before adding in leads. You can attach the battery directly to the glove, hide it inside the glove, or install long leads to allow the battery to be placed elsewhere on your body.
    My initial design used conductive thread for both battery leads, but this shorted the glove so many times I replaced them with an alligator clip in the final design. This works much better, is safer, and is seriously recommended over conductive thread. If you don’t have an alligator clip, any insulated wire will work.
  2. Label the positive and negative battery leads.
  3. Optional: Solder the battery clip leads to the glove battery leads and dab with hot glue.
    Alternative options include alligator clips or twisting wires together + coating with hot glue.

 

Test & Wear!

fsceucvi697s4r1-large Be sure to test your design BEFORE you wear it because if there are shorts in the conductive thread it will probably catch fire. So, please be careful and be sure that the positive and negative sides of the circuit do not touch.

The connections can be a bit finicky. Be patient and check the electrical connections w/ the battery or a multimeter (if you use a battery, be careful to avoid shorting the circuit). Fix and add more hot glue as necessary.
Once you know it works, put on the glove(s) and impress your friends!
Happy hacking!