Go Down

Topic: LED Strip SMD 5050 (Read 302 times) previous topic - next topic

jmgech

Hi!

I am attempting to control a 12V RGB LED strip (SMD 5050) from an Arduino Uno (and Nano), and have set up the following breadboard. When I power on the circuit with a 12v power adaptor, the led turns on to white, but doesn't execute my sketch, which should fade from a color to another.
As I'm pretty new to this, have I made a blatant mistake? (Probably, as I seem to have fried my MacBook Air when I connected to both USB and power at the same time...)

Any feedback would be greatly appreciated  :)

James




PaulRB

#1
May 22, 2018, 12:25 am Last Edit: May 22, 2018, 12:33 am by PaulRB


You should avoid all that current going through the Uno's ground pins. Connect the ground pin from the 12V power supply to the breadboard.

Why do you say your witch is not running? Have you tried 3 x 5mm LEDs, with series resistors, connected to the 3 pwm outputs, without the strip of 12V psu connected?

What model/part number of MOSFET are you using?

jmgech

Hi Paul, thank you for your response  :)

As MOSFET I used 3 LD1117AV33.

Regarding the wiring of the ground, do you mean I should rewire as in my updated diagram?

Regarding the sketch, I am running the following, but it only lights to white.



Code: [Select]
int red = 9;
int green = 10;
int blue = 11;

void setup() {
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);
}

void loop() {
  fadeFromTo(red, green);
}

void fadeFromTo(int from, int to){
  for(int i=0; i<255; i++){
    analogWrite(to, i);
    delay(5);
    analogWrite(from, 255-i);
    delay(5);
  }
}

Wawa

As MOSFET I used 3 LD1117AV33.
That's a 3.3volt voltage regulator, not a mosfet.
Leo..

PaulRB

#4
May 23, 2018, 05:56 pm Last Edit: May 23, 2018, 08:57 pm by PaulRB
That's a 3.3volt voltage regulator, not a mosfet.
Correction: they were 3.3volt regulators, now they are probably broken 3.3volt regulators.

jmgech

Dammit  :smiley-confuse: ! Still have a bunch to learn  :)

What should I be using?

PaulRB

Stp16nf06l would be suitable. I say that because I have memorized the part number! There are probably hundreds to choose from. What you are looking for is "n-channel" and "logic-level" and probably in a "to-220" package. Most of them will have a higher maximum voltage and current than you need, so don't worry so much about those figures.

jmgech

Funny how when you use the right components things work out... I replaced the voltage regulators with TIP120, and the circuit works now correctly :)

Thank you all for the help!

Wawa

That's not a mosfet either, but a bjt darlington transistor.
Sort of ok for a short-ish piece of LED strip, assuming you have used the right (~220ohm) base resistors.
Leo..

PaulRB

Yes, tip120 are a bit old and rubbish compared to a proper MOSFET. If you upgrade to a longer strip, get some real MOSFETs.
Quote
Regarding the wiring of the ground, do you mean I should rewire as in my updated diagram?
I don't see a difference. It's still the case that all the current flowing back to the PSU connector through the ground line is still passing through the Uno board, albeit between neighbouring pins.

Go Up