UNO: Code needed for 6 x 12V LED for indepent control settings

Hello,

I'm pretty new to this whole Arduino business! But have started on my first project.

I managed to set up a project to fade/pulse a single 12V LED using this page: http://blog.dcxn.com/2013/03/03/dimming-a-12v-led-strip-with-an-arduino/

I am now looking to expand this out in order build a controller box that is able to control 6 x 12V LED strips with in line toggle switches.

As such I was hoping there would be a way to independently control each PWM pin header on the UNO R3 with some tweak to the code shown in the article above.

So say each LED has 3 settings, Pulse/fade - Blink and Pattern. I would like to able to set each LED strip one of these functions.

PWM 3 - Pulse/fade
PWM 5 - Blink
PWM 6 - Pulse/fade
PWM 9 - Blink
PWM 10 - Pattern
PWM 11 - Pulse/fade

or have them all Pulse/fade in sync.

I have attached a wiring diagram (sorry its a bit rough) to show you what I have already made, it is currently missing the toggle switches.

Any help would be great or if there is any clarification needed just say

Cheers :slight_smile:

TIP120 is not the greatest part, it drops a lot of voltage across its output.
AOI514 is much better, its low Rds means hardly any voltage is lost across it, so the LED strips can be brighter when full on.
http://www.digikey.com/product-search/en?vendor=0&keywords=aoi514
Use a 220 ohm current limit resistor between Arduino pin and the gate, and a 10K from gate to Gnd to ensure the MOSFET is off while the Arduino powers up & the sketch comes to life.
They are also less expensive.

(Why does the forum software insist on hosing links some of time! Very aggravating.)

Thank you for the advice :slight_smile:
Having already built the product to the wiring diagram with the T120s and no necessity to get maximum light output (just for decoration) is there any safety need to swap out the transistors and add the resistors to what I already have? Or will it be fine as it is and just slightly less efficient?

Further to this do you happen to know if my current idea of individual/synced led pwm control is possible?

Thanks again

Hi, without the resistors your Arduino's life could be seriously reduced. Its outputs are overloaded

Your individual/synced idea is no problem.

Paul

Hello there,

So from what has been said I have altered my (rough) diagram and have attached it.

Is this what was meant? or have I got the resistors in the wrong place?

Also is there a specific specification of resistor I need to get, currently I am looking at:

10K Carbon Resistor 1/4W - (Resistors 0.25W)
220 Ohm Carbon Resistor 1/4W - (Resistors 0.25W)

Cheers

Those are fine. 10K to Gnd are only needed with MOSFET - they use so little current for control the input can change & hold state. BJT parts like TIP120 need more current flow and do not need the 10K to turn off when not driven.

Excellent :slight_smile:

That's great - It wont be hard to make the alterations once they arrive. Thank you for the advice.

So the next thing would be the Sketch Code...

I have the code for a single PWM output but not for multiple. Are there any online resources that you know of that could help guide me in the right direction?

lukeshoe1993:
have I got the resistors in the wrong place?

The 220R are OK. The 10K "Gate to Ground" you have shown is wrong and should be removed.

lukeshoe1993:
I have the code for a single PWM output but not for multiple. Are there any online resources that you know of that could help guide me in the right direction?

The secret to getting Arduino to appear to do multiple things at once is to avoid use of delay(), or at least avoid anything except very short delays. There is an example here.

To write any sketch, you need to start by describing exactly what you want the pogram to do, step by step. Your description above is not yet detailed enough to allow you to do this, so start by refining your description of the various patterns. Use diagrams where that makes things clearer than trying to describe them in English.