Arduino, 16 LEDs, and a battery pack. In a helmet.

Hey guys,

I want to put an Arduino-compatible uC, 16 red LEDs, and a battery pack into a construction helmet. There is enough room between the suspension and the hard shell for something like an Arduino Nano (worst case)

LEDs will be paired, and I want to be able to address all 8 pairs separately.

Issues that come to mind:

  • Providing enough current for LEDs. (20mA each)
  • Batteries to use (weight and runtime)
  • Overall size of package / simplicity

I was thinking of using an ATtiny85 and a TPIC6B595N.

How much of a voltage drop can I expect over the TPIC6B595N? Or better yet, where can I find this on it's datasheet?

I was thinking of using 4xAA batteries. For efficiency, should I drive the LEDs directly from the battery, or use the same voltage regulator that the ATtiny85 will be using? Suggestions for a properly sized Vreg?

Suggestions for other battery packs?

Panici:
How much of a voltage drop can I expect over the TPIC6B595N? Or better yet, where can I find this on it’s datasheet?

This IC has a logic supply voltage (often refered to as VCC, for this chip is ~5.0 VDC) so there won’t be an apparent voltage drop across the like with a discreet resistor or diode. Internally there will be voltage drops of course, but the supply voltage allows the output digital HIGH signals to be approximately equal to VCC. This also means that there will be current just to operate the IC. According to the Electrical Charateristics Table with all the outputs LOW has a typical rating of 20 ?A to a maximum of 100 ?A, and with all outputs HIGH the supply current will typically be 150 ?A to a maximum of 300 ?A.

Panici:
I was thinking of using 4xAA batteries.
For efficiency, should I drive the LEDs directly from the battery, or use the same voltage regulator that the ATtiny85 will be using? Suggestions for a properly sized Vreg?

Suggestions for other battery packs?

You might be able to get away with four AAAs instead, depending on the total current draw and how often you can tolerate replacing them. Rechargable NiMH AA or AAA cells are another possibility. However, since the per cell voltage is slightly lower for NiMHs (nominal 1.2 VDC vs. nominal 1.5 VDC for alkalines) a battery pack of at least five cells is advisable.

Red LEDs have low enough Vforward that I think you could drive 2 in series directly from an Arduino IO pin, even if running from 4.5V/3 AAs.

CrossRoads:
Red LEDs have low enough Vforward that I think you could drive 2 in series directly from an Arduino IO pin, even if running from 4.5V/3 AAs.

Good point, but that brings up a question for Panici. How are these LEDs going to be arranged, and will they be constant while turned-on or flashing on and off in some pattern?

"LEDs will be paired, and I want to be able to address all 8 pairs separately."

Sound like 8 IO pins to me. Drive 6 with PWM if want to, and 2 more with softPWM. Or just straight on/off from regular digital pins.

CrossRoads: Red LEDs have low enough Vforward that I think you could drive 2 in series directly from an Arduino IO pin, even if running from 4.5V/3 AAs.

I thought LEDs in series was bad, as one can draw more current then the other.

Far-seeker: How are these LEDs going to be arranged, and will they be constant while turned-on or flashing on and off in some pattern?

I want the ability to both flash them, and have them all on continuously. At maximum brightness.

CrossRoads: "LEDs will be paired, and I want to be able to address all 8 pairs separately."

Sound like 8 IO pins to me. Drive 6 with PWM if want to, and 2 more with softPWM. Or just straight on/off from regular digital pins.

Correct me if I'm wrong, but the Arduino can source 200mA maximum. I've got a 320mA load with all the LEDs on.

Panici:

CrossRoads: Red LEDs have low enough Vforward that I think you could drive 2 in series directly from an Arduino IO pin, even if running from 4.5V/3 AAs.

I thought LEDs in series was bad, as one can draw more current then the other.

It's not a problem if you have a current limiting resistor in series with them. As the name suggests, neither LED will be able to draw more than the resistor.

Panici:

Far-seeker: How are these LEDs going to be arranged, and will they be constant while turned-on or flashing on and off in some pattern?

I want the ability to both flash them, and have them all on continuously. At maximum brightness.

Ok that's simple enough to do in pairs. Variable brightness would require PWM as CrossRoads mentioned...

Panici:

CrossRoads: "LEDs will be paired, and I want to be able to address all 8 pairs separately."

Sound like 8 IO pins to me. Drive 6 with PWM if want to, and 2 more with softPWM. Or just straight on/off from regular digital pins.

Correct me if I'm wrong, but the Arduino can source 200mA maximum. I've got a 320mA load with all the LEDs on.

Two LEDs in series will have the same current draw as one, and as mentioned above you can select a current limiting resistor to ensure each pin only draws 20 mA. Therefore the maximum total current would be ~160 mA, 8 pairs * 20 mA. If they were in all wired in parallel, like one per pin, then the total current would be ~320 mA.

Far-seeker: It's not a problem if you have a current limiting resistor in series with them. As the name suggests, neither LED will be able to draw more than the resistor.

Ok that's simple enough to do in pairs. Variable brightness would require PWM as CrossRoads mentioned...

Two LEDs in series will have the same current draw as one, and as mentioned above you can select a current limiting resistor to ensure each pin only draws 20 mA. Therefore the maximum total current would be ~160 mA, 8 pairs * 20 mA. If they were in all wired in parallel, like one per pin, then the total current would be ~320 mA.

D'oh! Basic stuff. Embarrassing. I blame this cold!

Now that that's settled. Suggestions for battery packs?

Panici: Now that that's settled. Suggestions for battery packs?

My advice on battery packs remains basically unchanged from my initial reply, including the part about possibly using AAA sizes. An decent quality alkaline AAA should have a charge capacity of 800 to 1000 mAh, with AAs having more like 1800 to 2400 mAh. So dividing an estimated average total current draw, just for the sake of argument I'll use 200 mA, would give you approximately 4 to 5 hours with AAAs and 9 to 12 hours with AAs. You can get NiMHs with similar charge capacities, but as previously mentioned they'll have a lower nominal voltage.

However, since you don't have any needs for accurate or precise timing in this project, you probably could get away with three alkaline cells, or four NiMH cells, of either AAA or AA.

Hey guys, Thanks for your help!

Just wanted to follow up with some pictures. Everything works great, I just need to put in a button to change flash modes.

SoftPWM works like a charm as well for fading the LEDs. I've got a knight rider like sweep right now.

How is your power wired up? Is the battery+ connected to the Raw pin, or the Vcc pin? If you used Vcc, did you do anything to drop the 4 battery voltage down some? Like putting a 1N4001 or similar 0.7V diode in series with the battery+ line?

CrossRoads: How is your power wired up? Is the battery+ connected to the Raw pin, or the Vcc pin? If you used Vcc, did you do anything to drop the 4 battery voltage down some? Like putting a 1N4001 or similar 0.7V diode in series with the battery+ line?

Battery+ is connected to the Vin pin. Doesn't that have a voltage regulator behind it?

Yes it does. Might act a little funny as the voltage drops, you are not giving it much margin to work with.

CrossRoads: Yes it does. Might act a little funny as the voltage drops, you are not giving it much margin to work with.

What would you suggest then? An external circuit that's more efficient, and power the board from the +5v pin?

What voltage are you seeing into the board (Vin) and out of the regulator (Vcc)?

I would run the 6V thru a single diode to drop some voltage and connect to the Vcc pin. You don't need a lot of regulation, just a little voltage drop to get away from the Absolute Max voltage rating of 6V.

CrossRoads:
What voltage are you seeing into the board (Vin) and out of the regulator (Vcc)?

I would run the 6V thru a single diode to drop some voltage and connect to the Vcc pin. You don’t need a lot of regulation, just a little voltage drop to get away from the Absolute Max voltage rating of 6V.

A standard diode, like a 1N4001, would work but it will have a constant voltage drop regardless of battery voltage. A 5.1 V zener diode will give a stable “ceiling” value of approximately 5.1 VDC. However, the cheapest and most readily available, like the 1N4733A, won’t be rated to the likely continous current draw. Therefore you’d either have to find one with a higher continous current rating, or put a few 1N4733As in parallel. If I were you I’d choose the former rather than the latter, because the electronics will be in close proximity to your head (these low voltages won’t do much harm, but in some circumstances can still cause unpleasant shocks).

CrossRoads: What voltage are you seeing into the board (Vin) and out of the regulator (Vcc)?

With ~6 hours of use so far, I'm seeing:

All LEDs off: 5.46v Vin 4.56v Vcc

All LEDs on: 5.34v Vin 4.34v Vcc