LED RGB potentiometers

hey hello,
I am quite new to ardruino and trying to set up a first project.
the project means that I want to control 2 short LED strips of 8 LEDs with RGB potentiometers.
I've come up with an idea for this but I'm not sure if it's going to work the way I think it does.
I want to use the 6 analog outputs of an arduino uno.
I chose the uno because it has a power supply that I can also use for the LED strips.

In the attached picture you can see how I want to connect 1 of the strips.
I also want to connect the second strip to the same uno but to the other 3 analog pins.

I'm wondering if this will work? So I can buy myself so components.

I also have this script for it:

void setup() {
pinMode(9,1);
pinMode(10,1);
pinMode(11,1);

pinMode(6,1);
pinMode(5,1);
pinMode(3,1);
}

int a,b,c,d,e,f;

void loop() {
a=analogRead(A0);
b=analogRead(A1);
c=analogRead(A2);

d=analogRead(A3);
e=analogRead(A4);
f=analogRead(A5);

analogWrite(9,a/4);
analogWrite(10,b/4);
analogWrite(11,c/4);

analogWrite(6,d/4);
analogWrite(5,e/4);
analogWrite(3,f/4);
}

You will do better with a good separate power supply for your LEDs.

The UNO is not a power supply. it is only good for a small amounts of current.

Otherwise you are on the right track. What MOSFET or transistors are you using? What is the actual circuit?

Please hand draw a real schematic of what you've come up with.

a7

a7

1 Like

It looks like all the FETs are connected to the 12V supply.should this not be ground?

Powering from the vin pin implies you are putting something into the power jack socket, not a good idea, because it goes through a diode first.

1 Like

No, the Uno does not. The Vin is not an output of 12V. You must use an external supply for the LED strips.

Your code would be more readable if you use OUTPUT in the pinMode functions instead of 1.

1 Like

Ah oke, I thought the vin pin was giving 5V. And this is exactly what my LED strips needed.
But a extra input is noted, thanks!

I was planing to use TIP120 transistors.

What is powering the Uno?

What exact LED strips do you have?

So your Fritzing diagram bears little actual resemblance to the real circuit.

Please do as @alto777 requests and post a real schematic. Hand drawn, photographed and posted is preferred over a Fritz. Include all components, their part numbers and/or values and all power supplies.

Then you will need resistor between the base of the transistor and the Arduino output.

Yes, your sketch looks correct and should work once the hardware is attached. It can be simplified a bit:

void setup() 
{
  // pinMode() is not needed for analogWrite().  
  // The first thing analogWrite() does is 
  // pinMode(pin, OUTPUT);
}

void loop() 
{
  analogWrite(9,  analogRead(A0) / 4);
  analogWrite(10, analogRead(A1) / 4);
  analogWrite(11, analogRead(A2) / 4);

  analogWrite(6,  analogRead(A3) / 4);
  analogWrite(5,  analogRead(A4) / 4);
  analogWrite(3,  analogRead(A5) / 4);
}

Are you sure? These sort of strips normally work off 12V not 5V. Have you a link to where you bought it from?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.