Introduction: Arduino-based Blinking Santa Hat
This is a Santa hat with programmed lights on the pom pom. The lights are controlled by a battery-powered Arduino. My wife and I put this hat together in one day to add a little nerd-ism to Portland's Holiday Ale Fest. The Arduino program fades the lights in various patterns. To see the blinking hat in all its glory, see my YouTube video. Happy Holidays!
Step 1: Materials Needed
- Santa Hat
- Arduino Mini Pro (3V)
- SparkFun FTDI Basic Breakout - 3.3V, for programming the Arduino
- 2 AA Batteries
- Holder for 2 AA batteries
- Hook and Loop fastener (e.g, Velcro brand) the length of the battery holder
- wire connectors (e.g., Molex crimp and press connectors)
- 4 red LEDs
- 4 100ohm resistors
- about 40 inches (about 400 mm) heat shrink tubing
- White stranded hookup wire
- Black stranded hookup wire
- Red stranded hookup wire
- Hot glue stick and hot glue gun
- Heat gun or wooden matches (to shrink the heat shrink tubing)
- Needle and white thread
- Soldering kit (soldering iron, solder, wire cutter, wire stripper)
Step 2: Open the Santa Hat Pom Pom
Cut the pom pom (the white fuzzy ball) off the end of the hat.
Cut enough of the glue or thread off of the pom pom to open it – but don't cut too much because you'll need to rebuild the pom pom when finished. The pom pom is likely is a piece of fuzzy fabric stretched over a foam ball.
Step 3: Solder the 4 LEDs Into the Pom Pom
Push the leads of one LED through the fuzzy side of the pom pom into the inside.
Inside the pom pom, solder one end of a 100 ohm resistor onto the Positive (plus, anode) end of the LED (usually the longer lead, usually the one opposite the flat side of the LED lens.
Solder one end of a white wire to the other end of the resistor.
Cut the white wire to a length that will reach about 2/3rd of the way into the hat. This wire will eventually attach to an I/O pin on the Arduino, which will be inside the hat.
Slide a length of heat shrink tubing over the LED lead + resistor combination. Use a heat gun or (be careful) a match to heat the tubing so that it shrinks. Be careful to keep the heat away from the fuzz of the pom pom. If you don't the heat may melt the fuzz, ruining the look of the pom pom.
Solder a black wire to the Negative lead (minus, Cathode) of the LED. Cut the wire length to about the length of the white wire. This first black wire will eventually connect to a ground (GND) pin on the Arduino.
Repeat the process for the other 3 LEDs, except that instead of soldering a long black wire to the Negative lead of the LED, you will solder a short black wire between the Negative lead of this LED and the Negative lead of the previous one. That is, all the black (minus, cathode) leads of the LEDs are electrically connected to the one long black wire.
Step 4: Reassemble the Pom Pom
Insert the pom pom foam back into the pom pom and gather the fuzzy fabric around it, with the long wires (4 long white and 1 long black coming out of the part of the pom pom that will fasten to the top of the hat. Using the needle and thread and the hot glue gun, fasten the reassembled pom pom together.
Thread the 1 long black and 4 long white wires through the hole at the top of the hat. You may need to expand the hole to do this.
Use the needle and thread and the hot glue gun to securely fasten the pom pom to the top of the hat. The hat should now look a lot like it did when you bought it, except that it has 4 LEDs embedded in the pom pom.
Step 5: Assemble the Power Supply
Solder a long red wire to the positive side of the battery holder. Solder a long black wire to the negative side of the battery holder. Crimp a two-position Molex connector onto the ends of the black and red wires. Alternatively, you can solder a switch into the red wire, then solder (or press the connectors of) the red and black wires to the RAW and GND pins of the Arduino.
Use hot glue to fasten the hooks part of the fastener to the inside of the hat, high enough so that when you're wearing the hat the fastener is above your head. Glue the corresponding loops part of the fastener to the back of the battery holder.
Step 6: Connect the LEDs to the Arduino
Connect the four white wires to four I/O pins of the Arduino. One way to do this is to crimp Molex connectors to the wires, and solder a header to the pins of the Arduino. Another, less reusable way is to solder the white wires directly onto 4 pins of the Arduino. I used pins 3, 4, 5, and 6 because pins 1 and 2 are often used for Arduino programming.
Connect the black wire from the LEDs to the second GND pin of the Arduino. Again, either use Molex connectors or solder the wire directly to the Arduino.
Step 7: Program the Arduino
The source code appears at Github. Download the code into the Arduino. In the code, change the pin numbers in the P array to match the Arduino pin numbers you connected the LEDs to. Also change the order of pins in the P array so that the pattern of lights goes counterclockwise, then clockwise.
If you want to change the pattern, change the code in the loop(), calling throb(), anticlockwise(), clockwise(), and delay() in any order you want. If you like, you can also call fade() to make up any lighting pattern you want. Go for it!
Step 8: Plug in the Batteries and Wear the Hat
Place the 2 AA batteries into the battery holder. If you soldered in a power switch, turn the power switch on. Enjoy the light show! I calculate that the batteries should have no trouble lasting through a 1/2 day party. In fact, I estimate that the batteries should last about 18 hours.