Go Down

Topic: Powering 12V LED strip through Arduino (Read 362 times) previous topic - next topic

DaanAWH

Hi everybody!

I'm new here. Just started to discover Arduino and all it's possibilities.
I just hooked up a 12V LED strip with 42 LED's in total (about 1 meter of strip) to the Arduino and an external 12V power suply. I've hooked everything onto the Mosfets and got a code from internet which makes the LED strip fade colors. Only problem is, the LED strip burns at full capacity and if you look closely, you can see it fade according to the code. What am i doing wrong that the LED strip keeps turned on whilst i want it to turn of completly and only produce light when the code says so.

I've used 10K resistors.

This is the code i'm using:

// color swirl! connect an RGB LED to the PWM pins as indicated
// in the #defines
// public domain, enjoy!
 
#define REDPIN 5
#define GREENPIN 6
#define BLUEPIN 3
 
#define FADESPEED 5     // make this higher to slow down
 
void setup() {
  pinMode(REDPIN, OUTPUT);
  pinMode(GREENPIN, OUTPUT);
  pinMode(BLUEPIN, OUTPUT);
}
 
 
void loop() {
  int r, g, b;
 
  // fade from blue to violet
  for (r = 0; r < 256; r++) {
    analogWrite(REDPIN, r);
    delay(FADESPEED);
  }
  // fade from violet to red
  for (b = 255; b > 0; b--) {
    analogWrite(BLUEPIN, b);
    delay(FADESPEED);
  }
  // fade from red to yellow
  for (g = 0; g < 256; g++) {
    analogWrite(GREENPIN, g);
    delay(FADESPEED);
  }
  // fade from yellow to green
  for (r = 255; r > 0; r--) {
    analogWrite(REDPIN, r);
    delay(FADESPEED);
  }
  // fade from green to teal
  for (b = 0; b < 256; b++) {
    analogWrite(BLUEPIN, b);
    delay(FADESPEED);
  }
  // fade from teal to blue
  for (g = 255; g > 0; g--) {
    analogWrite(GREENPIN, g);
    delay(FADESPEED);
  }
}

Thanks in advance :)

PaulRB

#1
Jan 23, 2018, 10:49 pm Last Edit: Jan 23, 2018, 10:50 pm by PaulRB
Hi and welcome. Please read this. Especially #7 and #11.

Thanks

Paul

Grumpy_Mike

Quote
Only problem is, the LED strip burns at full capacity
What does that mean?
What gets hot, the strip or the FETs?

Go Up