ATtiny84 controlling LED light bar???

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 :smiley:

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 Voltage Regulator - 5V - COM-00107 - SparkFun Electronics 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 P-Channel MOSFET 60V 27A - COM-10349 - SparkFun Electronics 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.

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

Thanks

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).