Wearable Arduino Controled Light-Up Patch

by Sleepless_Charlie in Circuits > Arduino

132 Views, 3 Favorites, 0 Comments

Wearable Arduino Controled Light-Up Patch

JacketFront.jpg
JacketBack.jpg

In my city there are many magnificent punk bands who play in the local, underground venues and in these places innovation and eccentricity are highly valued and respected. With this in mind, I wanted to make something that would stand out creatively, but would also fit the scene. And thus, the Arduino Controled Light-Up Patch was born!

As I was planning this project I kept environmental sustainability and affordability in mind. All of the components (with the exception of the LEDs) were ones I salvaged from other projects or found in my parts junk-drawer. The incorperated jacket was pre-owned and gifted to me by a friend for this project. This project is very flexable and you will be able to create a patch of almost any size or design, to be applied to almost any article of clothing, but for the scope of this Instructable I will demostrate the basic idea with a single patch attached to a jacket.

Supplies

LED_KIT.jpg
Resistors.jpg
PCBBoard.jpg
BreadBoard.jpg
JumperWires.jpg
22GaugeWire.jpg
Tools.jpg
LED_Test_2.jpg

Electronic Components

An Arduino and Appropriate USB cable

  1. Any Arduino can be used, I chose to use a Mega 2560 because it has lots of digital I/O pins

Some PCBs (Printed Circuit Boards)

  1. The size you'll need will depend on the number of LEDs you intend to incorperate into your design

LEDs (Light Emitting Diodes)

  1. You can use as many as your design needs, however be mindful of the total current they'll draw from the Arduino
  2. My design requried 25

Resistors

  1. The type of resistor required will depend on the colour of the LED and the amount of current you want to send through it.
  2. I ended up using 19x 220ohm and 6x 330ohm resistors.

Wires

  1. I used 22 gauge wire to connect the circuit on the PCB and jumper wires to connect the circuit to the Arduino.

Breadboard

  1. Helpful for prototyping circuits and testing components before permanently soldering them.

9V Battery

Tools

Soldering Iron and Solder

Wire Strippers

Coloured Electrical Tape (optional)

Computer with the Arduino IDE installed

Miscellaneous

Article of Clothing

  1. If you have some fashion forward friends give them a call and see if they're willing to donate some old clothes. I ended up with a nice jacket.

Hook and Loop Dots

  1. Found in most craft or dollar stores, these will allow the patch to be secured onto the article of clothing.

Planning Your Design

PCBDesignDrawn.jpg
LED_Design_Planning.jpg
LEDCircuit.jpg

Once you decide on the size of PCB you wish to use, it's time to come up with a pattern. I decided to make two rings with a single LED in the middle. I'm using a total of 25 LEDs: 16 in the outter ring, 8 in the inner ring, and 1 in the center. The PCB I'm using is 6cm (~2.36in) x 8cm (~3.15in) and has 27 x 22 holes.

It took some playing around to figure out how to space everything out, but I found using graph paper was helpful. Map out the PCB on the graphing paper, with each hole of the PCB corresponding to a square on the paper. I used single LEDs which factored into my design choice. The colours I used are:

Outer Ring

Green (G) x 4

Blue (B) x 4

Pink (P) x 4

Purple (Pu) x 4

Inner Ring

Red (R) x 2

Orange (O) x 2

Yellow (Y) x 2

Warm White (WW) x 2

Center

White (W) x 1

The cathode (shorter leg) of each LED will connect to a common ground (GND) rail on the PCB which will then connect to the GND pin on the Arduino. The anode (longer leg) of each LED will connect to a resistor and the other end of the resistor will connect to an Arduino digital I/O (input/output) pin.


*Note: The red and yellow LEDs were just to help me plan. I use different ones for the actual project.

Deciding Which Resistors to Use

330ohm.jpg
220ohm.jpg
LEDandResistorPlanning.jpg
ResistorPlanning.jpg

Choosing the correct resistors to use in your circuit is vital for ensuring proper functionality of your components. A resistor that is too high in Ohms will cause inconsistant or no functionality and one that is too low in Ohms will cause too much current to flow through the components which usually results in damage.

To find the resistance we can use Ohm's Law: R = (VS - VL) / I

R = Resistance, measured in Ohms (Ω)

VS = Supply Voltage, measured in Volts (V)

VL = LED Voltage, measured in Volts (V)

I = Current, measured in Amps (A)

  1. Small scale electronics (like those frequently used with Arduino) often measure current in Milliamps (mA). To convert from mA to A, divide by 1000. Ex. 1mA = 0.001A.


We're trying to find resistance and in order to do that we need to fill in the other variables. Since we're using an Arduino, we know that our Supply Voltage is 5v.

Most 5mm LEDs run on 10mA-20mA. I prefer to run them closer to 10mA for a couple of reasons. The main one being that most Arduinos can only put out 200mA of total current before you risk damaging the board. If we run the LEDs at 20mA, that only lets us power a maximum of 10 LEDs at one time. If we run them at 10mA, then we can power a maximum of 20 at once. Drawing the maximum allowable amount of current for any substantial amount of time is still a risk for the Arduino, so I tend to err on the side of caution. My LEDs usually run between 10-15mA. For the current variable in the formula, we can use 10mA or 0.01A.

The forward voltages of the LEDs vary by colour. For red, orange, and yellow we can use 2.2V. For green, blue, pink, purple, warm white, and white we can use 3.2V.

R = (VS - VL) / I

To find the resistance value of the red, orange, and yellow LEDs we'll perform the following calculation:

R = (5V - 2.2V) / 0.01A = 280Ω

To find the resistance of the other colours we'll perform the following calculation:

R = (5V - 3.2V) / 0.01A = 180Ω

I don't have these exact resistors and since I am prioritizing using old supplies, I'm going to use 330Ω resistors in place of the 280Ω resistors and 220Ω resistors in place of the 180Ω. This puts the current at roughly 8mA, but the LEDs are still plently bright.

If you need to check the tolerance of any resistors you have on hand, I reccomend this resistor calculator.

Once you have decided on the resistors you need, add them to your design layout. One end of each resistor should be next to an anode (positive pin) of each LED. Bend the ends of the resistors so that they lie flat against the PCB to hold them in place. Remove the LEDs and set aside. You're now ready to start soldering the resistors!


NOTE: Make sure you have a functional circuit diagram and several pictures of the LED layout on the PCB before you take out the LEDs. It takes a lot of time to either redo or retry if you weren't paying attention.

Soldering the Components - Resistors

SolderedResistorsTop.jpg
SolderedResistorsBottom.jpg
PreparingToSolderResistors.jpg

Solder the resistors into place. I usually do them in groups of two to four. Snip off the excess metal legs of the soldered resistors and set them aside. Repeat this process until all of the resistors are soldered.

Soldering the Components - LEDs

SolderDemo.jpg
CloseUpOfSolder.jpg
FirstLEDSolder.jpg
InnerRingSoldered.jpg
ResistorsAndLEDsSoldered.jpg
220ohm.jpg

I reinserted the LEDs two at a time and bent the legs flat to hold them in place, much like the resistors. Solder the cathodes of the LEDs like normal, and snip off the extra length of leg. Put the bent leg of each anode right next to the bump of solder of it's resistor--ensure that the metal leg and the solder are touching. You want the leg of the LED to act as a bridge between the two. See the images for visual examples.

Make sure to check your circuit diagrams frequently. Some things to keep in mind are: the spacing between the components, make sure they match your design; the polarity of the LEDs, soldering them backwards will cause them to not work; take your time and ensure you make good connections, it's much more effort to have to redo your work then it is to take an extra minute and double check your work.

Soldering the Components - GND Wires

SolderedWireDemoBottom.jpg
WireSolderDemo.jpg
SolderedGNDWires.jpg
GNDRailSide.jpg
GNDRailTop.jpg

Measure, cut, and strip the ends of your ground wires. I used black wire for all of them. Solder one end of each wire to a cathode of each LED. Push the other end of the wire through the end of the circuit board where you want you GND rail to be. Solder it in place. Repeate this process for each LED you used in your design.

Using the extra stripped wire and resistor legs solder all of the ground wires together to create the GND rail. See the images for visual examples. Creating a rail will allow us to cut down the number of ground wires going to the Arduino from 25 to 1.

Soldering the Components - Signal Wires

FirstColouredWireSoldered.jpg
ColouredWiresTop.jpg
ColouredWiresSoldered.jpg
SolderedColourWiresComplete.jpg

To connect the anodes of the LEDs to the digital pins on the Arduino, I opted to run wires flat along the bottom of the PCB to get them all to the same edge. This will allow the patch to lie much flatter than if the jumper wires came straight out of the bottom. To do this follow the same general process as the ground wires, however DO NOT connect them all together as a rail. Each anode needs to connect to a seperate Arduino pin through a resistor. Your anodes and resistors should be connected so solder the signal wires to the other end of the resistor.

I only had three colours of wire: black, red, and white. I attempted to use coloured electrical tape to differentiate the connections of the coloured LEDs and it worked, but it looks a bit messy. In the future I will probably get more colours of wire. You don't have to colour code the signal wires, but I do believe it was worth the extra trouble in the end.

I used the following arbitrary colour code:

LED Colour - Wire Colour - Tape Colour

Green - Red - Green

Blue - Red - Blue

Pink - White - Red

Purple - Red - Black

Red - Red - N/A

Orange - Red - Red

Yellow - Red - Yellow

Warm White - White - Black

White - White - N/A

Soldering the Components - Jumper Wires

JumperWire_LBend.jpg
ExampleJumperToWireTop.jpg
ExampleJumperToWireBottom.jpg
CompletedPCBBottom.jpg
JumperWiresForPCB.jpg

I used male/female jumper wires to solder onto the PCB. Take the male ends and bend them to an approximately ~90 degree angle. Take the jumper wire you are using as your main ground (I used a black one) and solder it to the GND rail. The black plastic part near the end of the cable should sit flush with the PCB. See images for visual examples.

Follow the same general process as with the ground wire except solder the excess ends of the wire to the corresponding jumper cable. Be careful not to accidentally solder multiple anodes together or an anode to the GND rail.

Connecting to the Arduino

MegaJumpedToPCB.jpg
Ex_White.jpg
Ex_YellowOrange.jpg
Ex_BlueGreen.jpg

Once you've soldered everything together, connect the PCB jumper wires to the digital pins of the Arduino.

The following program will allow you to test out your hardware and troubleshoot any issues. It puts all of the LED variables into an array and then it runs through the array in a loop lighting up each LED one at a time. Ensure you change any variables or pin definitions as needed.


Attached are the code file and a short (~12 seconds) video of it running on my project.

Plug It in and Try It On

JacketFront.jpg
JacketBack.jpg

Attach one side of the velcro dots to the back of your circuit and the other side to your article of clothing. Press the two firmly to attach.

You'll then need to connect a power source. Connect the negative end of the battery to a GND pin on the Arduino and the positive end of the battery to the VIN pin. I like to use 9V batteries to power wearable items, but you may choose whichever power supply you would like. The recommended input voltage for the Arduino Mega is 7-12V, but ensure you don't go below 5V or above 20V.

Attached is a video of the jacket in action!

Also attached is the code I used to create the pin-wheel effect. It uses for loops and arrays to lightup opposing sides of the circles in a timed manner. I recomend experimenting with creaating your own light-up patterns as well.

Now you have your very own Wearable Arduino Controled Light-up Patch!