Go Down

Topic: ATtiny84 controlling LED light bar??? (Read 1 time) previous topic - next topic


I am trying to make a light bar for my truck. I run with a rescue squad and decided to try to make my own lightbar.... here is what I would like to do and I would like to have ya'll help with this to make sure I got the right idea. BTW I am new to this type of stuff  :D

First of all my power source will be 12v from the truck and I would like to have 30 white LEDS and 30 red LEDS

I will hook 12v to a PCB from Radio Shack
I will use this  https://www.sparkfun.com/products/107 to take the voltage to 5v
That will supply power to my ATtiny84 that I am going to program with a few different flashing sequences
I know that I will not be able to run very many LEDs with the 5v supplied from the ATtiny84.

My question is would the best option be to use this  https://www.sparkfun.com/products/10349 to up the supply power coming from the ATtiny so I could power more LEDs or am I misunderstanding something??

Thanks any help will be appreciated!!


You can run the LEDs from 12V and use NPN transistors to handle the voltage and current.  That will allow you to have several LEDs in series and reduce the number of current limiting resistors.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


Do you have a link to a good tutorial on how to use an NPN transistor?



Dec 11, 2012, 10:53 am Last Edit: Dec 11, 2012, 11:24 am by fungus Reason: 1
A transistor can switch stuff on/off but LEDs aren't that simple. LEDs need current regulation ... and before you know it you've got a PCB full of components.

There's a much simpler way to do what you want: Use an integrated circuit, eg. the AN6884 chip which does switching, current regulation, etc. all in one little package.


Datasheet: http://www.e-ele.net/DataSheet/AN6884.pdf

One of those chips can switch 5 strings of LEDs on/off with no extra components needed, and you can connect dozens of chips to a single Arduino pin (switch hundreds of LEDs with one Arduino pin!)

You've got 12V available so each AN6884 pin can drive multiple LEDs.

A white LED needs 3.6V so you have enough volts to connect three of them in series with a bit left over (3x3.6V=10.8V). Each AN6884 pin can therefore drive three white LEDs. Five pins per chip means each chip can light up fifteen white LEDs. Thirty LEDs only needs two of them.

Similarly... red LEDs usually need 2.2V so each AN6884 pin can drive (up to) five of them (5*2.2V=11V). Each AN6884 can therefore switch twenty five red LEDs on/off. Given that you have some extra capacity and red LEDs aren't as bright as white ones you maybe could put in forty red LEDs instead of thirty (ten strings of four LEDs).

Four AN6884s, two Arduino pins, the LEDs, that's all you need. No resistors, no transistors.

nb. You run the AN6884 at 5V, the same as the Arduino, and connect the Arduino's output pin to the AN6884 pin 7 ('AMP. output'),  bypassing the internal amplifier (which isn't needed here).
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up