Motion Activated Speed Suit

by Beaconsfield in Circuits > Wearables

28965 Views, 249 Favorites, 0 Comments

Motion Activated Speed Suit

main1.jpg
main5.jpg
main6.jpg
main2.jpg
main4.jpg


Most of the time EL wire is used as is, with manual on/off control. However, I wanted to control it with an Arduino, so it would react to results from a sensor. This motion-activated suit flashes when the wearer starts to walk and lights up completely when the wearer runs. Perfect for those late-night runs! (or dance parties - it lights up when the wearer moves, and this includes dancing)

The suit itself is a set of zip-up coveralls decorated with EL wire and controlled via an Arduino Micro. An accelerometer monitors the wearer’s motion and sends that data to the Arduino.

Materials:

Main Circuit

circuitdiagram.png
wiringdiagram.png
IMG_3563.JPG
This circuit has two parts – the transistor that controls the EL Wire, and the accelerometer. Since I couldn't power the inverter directly from the Arduino (it requires 12VDC), I instead controlled the connection to power. The transistor essentially acts as a switch, connecting the inverter to ground when there is current in the base of the transistor (aka. the pin connected to the transistor is high).

The resistor limits the current going to the transistor to make sure it doesn’t get damaged.

The accelerometer is powered by the Arduino (it requires a steady 5VDC) and has its X and Y outputs connected to digital input pins.

Both the Arduino Micro and the inverter run off 12V, so the battery packs contain a total of 8 AA batteries and were wired in series.

Soldering the Arduino Socket

IMG_3567.JPG
IMG_3569.JPG
IMG_3574.JPG
IMG_3580.JPG
I didn't have a socket with the exact number of pins for the Arduino micro, but one with a few extra rows works just as well. I started by soldering the four corners, to keep the socket from being crooked. Then I soldered down each row. Make sure to get a secure connection around each pin. 

Soldering the Accelerometer Socket

IMG_3582.JPG
IMG_3585.JPG
IMG_3592.JPG
I did the same thing for the accelerometer socket (again, I only had an 8 pin socket for a 6 pin part but it works fine).

Solder the Transistor

IMG_3594.JPG
IMG_3596.JPG
IMG_3598.JPG
IMG_3600.JPG
IMG_3602.JPG
IMG_3604.JPG
IMG_3607.JPG
Next, I soldered the transistor so the emitter would be near ground. Keep the pins separate when soldering, and clip the wires when you are done.

Solder the Resistor

IMG_3609.JPG
IMG_3610.JPG
IMG_3612.JPG
IMG_3615.JPG
IMG_3617.JPG
IMG_3619.JPG
IMG_3620.JPG
IMG_3622.JPG
IMG_3623.JPG
IMG_3627.JPG
I soldered the resistor next to the middle (base) pin of the transistor since it goes between the Arduino pin and the base.

Solder the Jumper Wires

IMG_3628.JPG
IMG_3629.JPG
IMG_3631.JPG
IMG_3635.JPG
IMG_3637.JPG
IMG_3638.JPG
IMG_3642.JPG
IMG_3643.JPG
board_all.JPG
IMG_3331.JPG
IMG_3333.JPG
IMG_3345.JPG
Finally, I soldered the jumper/connecting wires in place. I found it easiest to cut them to length before soldering (as opposed to soldering one end and then cutting it). I also folded over the stripped end to put it closer to the pin I was soldering it to (see pictures).

I continued to add jumper wires, and added "extension" wires for connecting to off-board components (the inverter and power).

Soldering the Power Switch

IMG_3306_edit.jpg
IMG_3312_edit.jpg
batterydiagram.jpg
Both the Arduino and the inverter need 12V for power. I used two 6V battery packs (4AA batteries per pack --> 1.5V per battery) soldered in series to achieve this. DO NOT SOLDER THE BATTERIES IN SERIES JUST YET. You want to do this later, when the batteries are in the pockets and the wires are properly routed. 

At this point, I soldered the on/off switch to power and hot glued it to the battery pack. (this would be much more difficult to do after the batteries are in the suit pockets) The wiper (middle pin) is connected to the 12V coming directly from the batteries and the other pin is the power for the circuit. The last pin I left open.

Arduino Code

memsicpulse.PNG
The Arduino code reads in the values coming from the accelerometer, converts them to units of acceleration (in this case, g), and analyzes the values to see what the wearer is doing.

The Memsic 2125 outputs pulses that vary in length based on the acceleration. These pulses are read in using the “pulseIn()” function, which returns the pulse length in microseconds. The Memsic datasheet supplies a formula for converting this pulse length to acceleration (see image from datasheet).

To determine what the wearer is doing, the Arduino calculates the range of acceleration for the vertical axis (the axis aligned with gravity – this axis sees the greatest change when the wearer moves) over a time of about one second. It does this by finding the maximum and minimum values during that time, then taking the difference. The ranges for running, walking, and standing still are fairly distinct; therefore I can set thresholds to define the activities (these thresholds will probably vary from person to person). In my case, standing still had a range of 0-0.15g, walking had a range of 0.15-0.30g, and running had a range of >0.30g. Note that in the code I added a factor of 100 to my accelerometer values to avoid using floats.

Once the code has determined the activity, it controls the EL wire accordingly. If the wearer is standing still, the EL wire stays off; if the wearer is walking, it flashes; and if the wearer is running it stays on.

Downloads

EL Wire Design

IMG_2747_suit.jpg
IMG_2754_edit.jpg
IMG_2759_edit.jpg
After I had the circuitry and code running (you can test it by temporarily attaching the batteries and shaking the accelerometer), I made the suit.

I marked out my pattern with scrap yarn, but you can also just use tailor's chalk or a white colored pencil. Remember to use more organic shapes, since the EL wire doesn't make tight corners and you run the risk of breaking the interior wires if you try (you'll see that although my initial design has lots of corners, the actual suit uses much curvier shapes). 

Cut and Solder EL Wire

ELsolder_1.jpg
ELsolder_2_edit.jpg
ELsolder_3_edit.jpg
ELsolder_4_edit.jpg
ELsolder_5_edit.jpg
ELsolder_6_edit.jpg
ELsolder_8_edit.jpg
ELsolder_9_edit.jpg
There are already a bunch of good guides for soldering to EL wire (see below), so I won't post my exact steps here. I used the method with copper tape, since it seemed more secure and less likely to break the thin wires. I did however figure out that the interior wire is extremely brittle, so be careful with the soldered ends once you are done with them. 

https://www.instructables.com/id/How-to-Solder-EL-Electroluminescent-Wire/#step0
https://www.sparkfun.com/tutorials/130
http://learn.adafruit.com/el-wire/soldering-to-el-wire

Sewing the EL Wire

IMG_3041_edit.jpg
IMG_3042_edit.jpg
IMG_3048_edit.jpg
IMG_3050_edit.jpg
The easiest way to attach the EL wire is just to sew it on using clear thread (colored thread will block the light). I held the end of the EL wire in place with some hot glue before sewing to make it easier to work with. I also used relatively short lengths of thread, since it tangled very easily.

Sewing the Circle

IMG_3055_edit.jpg
IMG_3058_edit.jpg
Sewing the circle was a little more difficult than sewing the other mostly-straight lines. I cut the seam open and glued the EL wire in place before doing any sewing. I put two small dabs of glue at the top and bottom of the circle, just to hold it in shape. The gap in the seam held the “back” piece of wire in place. Then I sewed the whole circle normally.

Tucking in Ends

IMG_3072_edit.jpg
IMG_3074_edit.jpg
IMG_3077_edit.jpg
IMG_3083_edit.jpg
IMG_3085_edit.jpg
IMG_3081_edit.jpg
After sewing, I wanted to hide the ends of the EL wire inside the suit. Since the wires all ended at a seam, I carefully cut each seam open an inch or so and threaded the wire through. Then I sewed the opening shut around it, making a “tube” for the wire (see photos).

Cleaning Up Cables

IMG_3227_edit.jpg
IMG_3300_edit.jpg
I only wanted one set of cables going from the EL wire to the inverter, so I spent some time soldering the EL strands back together. I tried to keep the cables bundled together around the back of the neck and had the final cable going down the front of the suit to where the Arduino would be.

Make Holes for Wires

suitcircuit_front-01.jpg
suitcircuit_back-01.jpg
IMG_3309_edit.jpg
I sewed the other electronics in place as shown in the diagram; one battery pack in each back pocket (to try and spread out the weight), and the inverter and circuit board in the front hip pocket. You should change this to work with your specific suit. The circuit board should stay by the hip though, since that's where a lot of the motion from running is.

To help with routing the wires, I made ½” long buttonholes in the insides of the pockets by cutting slits and sewing around the edges. 

Sewing the Battery Packs

IMG_3317_edit.jpg
IMG_3321_edit.jpg
IMG_3325_edit.jpg
I put one battery pack in each back pocket, and tacked them in place with a bit of thread. Next, I soldered them together in series, winding the wires through the holes I had made as I did so.

In general, I occasional sewed the wires loosely to the inside of the suit. This was to keep them from being caught on anything when the suit is put on/taken off.

Sewing the Circuit Board

IMG_3355.JPG
IMG_3366_edit.jpg
Once I had the power and ground cables sticking out the front pocket, I made a “splitter” for the 12V wire so I could connect it to both the Arduino and the inverter. I then soldered the last few wires, connecting power and ground to the board and connecting the inverter’s ground to the circuit board.

The circuit board itself I sewed securely to the inside of the front pocket. I wanted it to rest near the hip where there would be a lot of motion. I’ve left the inverter loose for now, but if it becomes a problem I’ll sew a few loops around the input and output cables to secure it.

Final Touches

IMG_3376_edit.jpg
The last thing I did was to sew on a panel of soft fabric across the back of the neck. This both keeps the EL wire from getting caught on anything, and makes the suit a little more comfortable.

Wear It!

IMG_5162.JPG
IMG_5170.JPG
IMG_5175.JPG
IMG_5177.JPG
The suit is now complete and you can run around in all your light-up glory. Turn on the switch and go!


As I mentioned earlier, you may need to adjust the values for your particular gait.