The following is the parts I've used in my design. You may wish to use a different shape with more or less LEDs, and most parts can be substituted. Prices are all before any taxes.
* Grid PC Board
; I got mine at a local independent electronics shop, but it's very similar to RadioShack's #276-158
. You can probably find one on Digi-Key, but they are needlessly expensive($10+ for a board this size), as they only carry boards designed for repeated resoldering. I'd avoid a stripboard unless you know what you're doing and are familiar with them. RadioShack's is $3.19
Note that you could prototype this project on a solderless breadboard(and I did all of my microcontroller programming/testing on one), but the "heart" or other shape aspect will be mostly lost, obviously.
* AAx2 battery holder
; I also got this from my local retailer, but you could also use RadioShack #270-408
You could instead choose a low voltage(<5.5 volt for most AVR microcontrollers) power adapter instead, or a higher voltage(maybe a 9V battery, but you wouldn't have much run time) supply with a regulator.
* 3mm red LEDs - 14 pcs.
; Mine are low current(2mA, but they handle up to ~30mA) from Digi-Key(754-1245-ND
), and cost just under six cents each in a bag of 100. I should warn you that this exact part is actually red-orange when lit up. RadioShack part 276-026
is very comparable, and they're truly red, but cost $1.69 per pack of 2. Ouch. Converted cost for this project is $0.83
if you don't go for the 100 pack)for the Digi-Key LEDs and $11.83
for the Shack's LEDs.
Color is up to preference, but other colors have different voltage drops. More information below.
* 330 ohm resistors - 14 pcs.
; Power rating and resistive element type don't make a difference, but carbon film are cheapest. RadioShack sells these in packs of five(#271-012
) for $1.19 each. Digi-Key CF14JT330RCT-ND
are eight cents each, individually, but if you're working with a lot of LEDs, you might wanna buy a 100 pack for $2.19 total. Amazing deal, if you ask me. RadioShack, $3.57
(with one lonely resistor left over); Digi-Key, $2.19
(with 86 resistors partying in your spare parts container afterward).
I calculated this resistance to provide between 2-5mA to the LEDs over the life of two alkaline AA batteries(3.2 volts fully charged, ~2 volts nearly dead). If you'll be using a different power supply and/or different LEDs, you should use an online calculator to find the value you need. Assuming you're still using batteries, find the charged and depleted voltages to ensure your LEDs look good over the life of the batteries. Here
is a good calculator, but be sure to change the "how many connected" field from 2 to 1, unless you want to run multiples(do so at your own risk and with experience). Keep in mind that shift register pins don't like to supply more than about 25mA each.
* 47k ohm pull-up resistor
; This lets us use the button reliably. It doesn't have to be as high as 47k, but I chose it to draw as little current as possible, as I'm running from batteries. You only need one, but RadioShack #271-1342
will get you five for $1.19
and Digi-Key S47KQCT-ND
will run you $0.08
If you already have a resistor greater than 10k, you could use it, but try not to go too far above 47k, or your microcontroller may not get enough current to be held high. Experiment on a breadboard if you have any doubt!
* 74HC595 shift register - 2 pcs.
; These are each capable of driving 8 outputs, although one output on each is awkwardly on the other side of the chip. Since I'm using 14 LEDs, I just left those "odd" outputs unconnected and wrote my code to match. I used 2 296-1600-5-ND
from Digi-Key at $0.63 each. RadioShack doesn't seem to sell shift registers, so my recommended Digi-Key alternative is SparkFun(COM-00733
) who will charge a modest $1.50 each. Totals are $1.26
for Digi-Key's or $3
* DIP-8 IC socket
; I highly
recommend one for making adjustments to the code after assembly. Even if you don't intend to write or modify your own code, if there's some problem, you'll want to be able to diagnose it. I used a Swiss-milled gold-plated socket I had lying around, but it really doesn't make a difference for this. Digi-Key A100204-ND
and RadioShack #276-1995
You don't necessarily need one, if you're confident with your assembly and soldering skills. An alternative, if you'd still like programming access afterward, is to use pin headers to connect an ICSP(in circuit serial programmer). Heck, maybe you wanna use both.
; This little 8 pin microcontroller has 8K of program space, which is lovely for prototyping. I've found I don't need that much, and could get away with an ATtiny45 or possibly even a 25. I chose the "V" version because it reliably runs on voltages as low as 1.8 volts, so it's ideal for battery use. RadioShack doesn't sell microcontrollers alone, but SparkFun has the standard(not low-voltage) version COM-09378
and Digi-Key sells the ATtiny85V(ATTINY85V-10PU-ND
) for $2.26
Just about any microcontroller can be used here, as we only need 3 pins for shift register control and one pin for button input. If you want to forgo the shift register wiring(and coding, if you don't use my code), you should go with a controller that has enough pins to drive all of your LEDs. You can greatly increase the number of LEDs a chip can drive with charlieplexing, but that's a topic for another Instructable. Also be sure to get a different socket size if your microcontroller uses more pins!
* Power switch
; I won't recommend a specific switch here, because there are thousands of valid options, and what you pick depends on what case you put this in, if you use a case at all. SPST or SPDT will work, but SPDT may be easier to find. Spec the voltage rating for your power supply, and calculate your worst-case scenario for current. Most switches will provide more than enough, but for the record, my design here will consume no more than 60mA. I paid about $4
for mine, a panel-mount paddle switch.
* Push button
; This will be used to switch to the next pattern animation. Like above, there are far too many options to recommend one. I prototyped with a standard, breadboard-compatible button, but my final design uses a panel-mount button. A four pack cost $3.69
; If the button/switch had a lot of options, this is just crazy. You could put this in a cardboard box, or mounted to a piece of wood or plexiglass, or even leave it exposed. Put it in a custom wooden case or hang it on the wall. Just be sure that nothing shorts out on the bottom of the circuit board. If you mount on metal, use standoffs or a lot of electrical tape. I used a tin that has a clear, plastic window in its lid. My mom had this lying around, so it cost me nothing.