I have a few arcades and pinballs that I enjoy as a hobby and have repaired over the years, but admittedly my knowledge of raw electronics is only a step above novice. I do have extensive experience as a programmer, so my interest in the Arduino's comes really from that end and a strong interest in trying to learn the other half of it.
I came up with a neat idea to build a coffee table with a glass top that beneath contains an old pinball playfield with all the targets, flippers, bumpers, etc.. still intact, but all the electronics and wiring have been stripped from beneath. What I would like to do is run LEDs to all the old lamp sockets and use code to simulate a random on/off pattern for the lights -- the latter of which I have no problem coding up.
There are roughly 50 lamps on the playfield. I have purchased a lot of warm-white LEDs to best mimic the old incandescent bulbs and appropriate resistors. I have read there are ways to control their brightness digitally by tricking the eyes with the on duration, but I'd rather just use an appropriate resistor for each LED from the get go and simply send an on/off signal to each LED for the duration I wish to have it lit.
My question is rather one of power. Since this is a free-standing coffee table, I was hoping to avoid running a power cord to an outlet. I bought an Audrino mega (still enroute) because of its vast number of pins and my thought was that each LED/resistor would go to a pin. What I don't know is how much current draw there will be. If we say roughly 20mA for an LED, then a 4 pack of AA batteries (~2000 mAH) to supply the voltage would give me roughly 100 hours of "on" time. However, is this the wrong thinking and that 50 LEDs would be added up and use 1A total and run my batteries dry in just a couple hours?
"However, is this the wrong thinking and that 50 LEDs would be added up and use 1A total and run my batteries dry in just a couple hours?"
Yes. Assuming the 4 AA batteries, didn't smoke the Mega first. And that all LEDs were on all the time.
Add a diode in series to drop the voltage below 6V before applying the voltage to the 5V pin. Don't go in via the barrel jack.
Could also try higher resistance, use just 10mA per LED, save on battery.
Well, nothing's burned up since it hasn't arrived. Still brain storming. Since the LEDs operate on 3.2-3.4V, I guess a 3AA pack would work. I have no idea how these external supplies are connected to the Arduino, so that's something to figure out once I get it. I suppose the 3.3V output may actually be perfect for this task.
I also concur that given the large mcd output of these superbright 5mm LEDs that reducing them to 10mA will likely be more than sufficient for this application. Guess it'll be a test and see. Rechargeable batteries may be the way to go here.
kcwxforecaster:
...Since the LEDs operate on 3.2-3.4V...
You should change your thinking here. Instead think of it as the LEDs operating on a maximum 20ma and requiring a minimum 3.2-3.4V to turn on. The resistor is used to limit the current depending on what voltage you're running the LEDs with.
The 3.3V header pin is only good for 50mA, don't connect that to LEDs.
Resistor needed: (4.5V-3.2V)/20mA = 65ohm, use next standard size of 68 ohm, or 82 for less current draw
Dissipates ~30mW, so 1/8W parts will do.
Connect battery pack to 5V pin and Gnd on the Power header pins.
Very helpful response CrossRoads, and this is the initial avenue that I had taken with my online purchase a couple days ago. Since I was able to get 100-pack resistors for about $2, I went ahead about bought 68s, 100s and 150s just to see how high I could crank up the resistance and have sufficient brightness. The warm white LEDs I bought were rated at ~13,000 mcd at 20mA, so I have a hunch I should be able to ramp them down quite a bit to get equal lunimosity to what I was used to with #44 and #555 pinball bulbs. I also went with a "straw hat" design to deflect most of the light upward from underneath the playfield. Of course this is all speculative until I get to play with them but I sure look forward to posting the results of this winter project!