Introduction: LED Christmas Sweater With Arduino
For a school project we had to make an interactive object with Arduino. And because it's always time for Christmas sweaters I decided to make a this tiny prototype.
It's a perfect doll sized sweater! It's also super cute Christmas decoration, or a funny phone protector! :-)
The sweater has a pattern that flips direction according to the environmental lighting. This guide helps you create your own 6" Christmas sweater with an easily changeable pattern using Arduino.
Step 1: Materials
First you have to collect everything you need to make this miniature interactive LED Christmas sweater.
- 25 - green 5mm LEDs
- 25 - resistors 330 Ω (orange orange brown gold)
- 1 - resistor 10k Ω (brown black orange gold)
- 1 - LDR resistor
- 3 - 8-Bit Shift Registers (SN74HC595)
- 1 - PCB board (at least 32 x 32 holes)
- 1 - 8x1 header / connector
- 7 - wires to connect to Arduino
- soldering setup
- thin wire
- soldering tin
- a sweater or fabric to make a sweater
Step 2: Schematic
This schema shows the connection of all components. You really have to follow this schema if you want the code from the next steps to work!
Step 3: Building
Place the components on the PCB as shown in the schematic. Solder this using a fine tipped soldering iron.
First solder all components to the board.Be careful to place the LEDs and the shift registers in the right direction.
After soldering the components the wires have to be connected. Start with the ground (the black lines in the schematic). Then the VCC (the red lines). Then you make the remaining connections using thin isolated wires.(I used red and black wire-wrap wire).
The pictures show the front and the back of the almost finished project.
Step 4: Code
I attached the code I used for my Christmas tree. I made a 3 row moving bar pattern, the direction is depended on the light of the environment. (As you can see in the video).
You can easily change the pattern by changing the ones and zeros in the array. (1 is on, 0 is off). You can make the pattern longer or shorter if you want. :-)
The array is divided in 4 parts:
- ShiftReg 1
- ShiftReg 2
- ShiftReg 3
- Top Led
See the image above to see which LED is which bit in the code.
You may have to change the value of the SensorGrens, depended on the density of your fabric. For me 40 was a suitable value.
Step 5: Connect to Arduino
Connect your PCB to the Arduino through the connector/ header using colored wires. (Those wires you use on your breadboard, I don't the name...)
- VCC (red) ==> 5V on your Arduino
- Top led (white) ==> Pin 8 on Arduino
- Datapin (blue) ==> Pin 13 on Arduino
- LDR sensor(yellow) ==> Pin A0 on Arduino
- Latch pin (green) ==> Pin 12 on Arduino
- Clock pin (orange) ==> Pin 11 on Arduino
- Ground (black) ==> GND on Arduino
Once you connected all pins to the Arduino, run the code and hope it all works. If it works your done with the technical process.
Step 6: Add to Sweater
The mechanical stuff is done! Now it's time to make it into a sweater.
This is the easiest part, all you need is to make 25 tiny holes in your fabric (I used scissors to poke holes in it) and push the LEDs through it. It's important to choose a fabric that doesn't fray, otherwise this step will be impossible. Hoodie-fabric works very well, this thick sturdy 80% cotton 20% polyester mix doesn't rip if you push the LEDs through it.
Attach the PCB to the sweater with a few stitches and done!