Powering + controlling 24v white led strip

Hey,

So this is my first project outside of basic tutorials. At my disposal, I have a two different arduino units: Adafruit Metro 328 and the Adafruit Metro Mini 328 - Arduino-Compatible - 5V 16MHz

My led strip discontinued (page may redirect you): Tunable White Flexible LED Tape Light with 36 SMDs/ft. - 2 Chip SMD LED 3528

My power supply for the strips is: SE-100-24

I will use around 60 inches of strip and will require at least 80% brightness and I'm only powering them to fade on, stay on for 10 seconds, fade off and stay off for 10 seconds.

Any direction forward would be appreciated.

edit: I have the logic level MOSFET (IRLB8721PBF) and 10k ohm resistor, and I am referencing this guide

I'm not a strip expert, but from the WW and CW wire names I guess that the strip can be configured for Warm or Cold White only.

That doesn't make any difference to me. If you leave the white wire un-powered, ground the yellow and power the brown, then cool white turn on with full intensity. That's just fine.

I am just not sure how to use a 24v power source with the arduino and the led strip.

I have 10k Ohm Resistors and Logic Level N-channel MOSFETs as per this guide

However my power supply is 24v, as are LED strips.

Use a DC/DC converter to bring the 24 volt down to e.g. 9V..12V and feed that into the Arduino barrel or the Vin pin.
Alternatively, use a circuit based on a LM7809 (less efficient) instead of the DC/DC converter. Or use a 9V wall wart for the Arduino.

sterretje:
Use a DC/DC converter to bring the 24 volt down to e.g. 9V..12V and feed that into the Arduino barrel or the Vin pin.
Alternatively, use a circuit based on a LM7809 (less efficient) instead of the DC/DC converter. Or use a 9V wall wart for the Arduino.

Thanks, so I have the 9v wall wart for the Arduino. However I'm not seeing how I power the Arduino separately from the LED strips.

I have the logic level MOSFET (IRLB8721PBF) and 10k ohm resister, I found this guide as well, so I can run this and not need to power the Arduino separately?

Hi use a MOSFET,

Logic based mosfet with a gate voltage of 0-5 volts.

Connect your 24V to supply the LED strip

and send a signal to the PWM port to control the PWM port (0-255) this will send a signal to the gate of the mosfet and cause a circuit to flow from the Vds (voltage drain to source).

A quick calculation of your power supply ensure the AMPS is enough to supply your LED lights

usually 0.6A / m

This is the usual way to overcome the voltage difference with a mosfet.

led_fet.jpg

You can power the Arduino from the wall wart; it's important to have both grounds connected.

Note
The fet symbol is not for the FQP30N06L; pins are imcorrectly numbered.

1 Like

sterretje:
This is the usual way to overcome the voltage difference with a mosfet.

led_fet.jpg

You can power the Arduino from the wall wart; it's important to have both grounds connected.

Note
The fet symbol is not for the FQP30N06L; pins are imcorrectly numbered.

and

JACKSONSPARROW:
Hi use a MOSFET,

Logic based mosfet with a gate voltage of 0-5 volts.

Connect your 24V to supply the LED strip

and send a signal to the PWM port to control the PWM port (0-255) this will send a signal to the gate of the mosfet and cause a circuit to flow from the Vds (voltage drain to source).

A quick calculation of your power supply ensure the AMPS is enough to supply your LED lights

usually 0.6A / m

Thanks, I'll try these out when I'm back in the office on Monday. I really appreciate the guidance and the diagram.

Will update next week!

Hey thanks for the help! Wired everything up and it works. Sadly my coding doesn't work.

Code 1 with a sin has an error and doesn't function. Code 2, which is just the arduino.cc turtorial for fade, works great. Codes and error codes posted below.

If anyone could suggest a coding for making this fade on, hold on for 10 seconds, fade off and hold off for 10 seconds... I'd be incredibly appreciative.

I'm brand new to this, but trying to learn.

Thanks

The code that is returning an error: I am using this guiide and its code

When I upload with the code, i receive the error:

Arduino: 1.8.7 (Mac OS X), Board: "Arduino/Genuino Uno"

/Users/exhibits/Documents/Arduino/sketch_nov01c/sketch_nov01c.ino: In function 'void loop()':
sketch_nov01c:9:27: error: expected '}' at end of input
for(int i = 0; i<360; i++){ //convert 0-360 angle to radian (needed for sin function) float rad = DEG_TO_RAD * i; //calculate sin of angle as number between 0 and 255 int sinOut = constrain((sin(rad) * 128) + 128, 0, 255); analogWrite(fadePin, sinOut); delay(15); } }
^
sketch_nov01c:9:27: error: expected '}' at end of input
exit status 1
expected '}' at end of input
Invalid library found in /Users/exhibits/Documents/Arduino/libraries/sketch_nov01a: no headers files (.h) found in /Users/exhibits/Documents/Arduino/libraries/sketch_nov01a
Invalid library found in /Users/exhibits/Documents/Arduino/libraries/sketch_nov01a: no headers files (.h) found in /Users/exhibits/Documents/Arduino/libraries/sketch_nov01a

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This is a copy of the code, unfortunately I don't think it was properly formatted:

//////////////////////////////////////////////////////////////////
//©2011 bildr
//Released under the MIT License – Please reuse change and share
//Simple code to output a PWM sine wave signal on pin 9
//////////////////////////////////////////////////////////////////

#define fadePin 3

void setup(){
pinMode(fadePin, OUTPUT);
}

void loop(){

for(int i = 0; i<360; i++){ //convert 0-360 angle to radian (needed for sin function) float rad = DEG_TO_RAD * i; //calculate sin of angle as number between 0 and 255 int sinOut = constrain((sin(rad) * 128) + 128, 0, 255); analogWrite(fadePin, sinOut); delay(15); } }

so i tried to reformat it to this:

#define fadePin 3

void setup(){
pinMode(fadePin, OUTPUT);
}

void loop(){

for(int i = 0; i<360; i++)

{ //convert 0-360 angle to radian (needed for sin function) float rad = DEG_TO_RAD * i; 
  
  //calculate sin of angle as number between 0 and 255 int sinOut = constrain((sin(rad) * 128) + 128, 0, 255); 
  
  analogWrite(fadePin, sinOut); delay(15); }
}

and then i receive the error:

Arduino: 1.8.7 (Mac OS X), Board: "Arduino/Genuino Uno"

/Users/exhibits/Documents/Arduino/sketch_nov01c/sketch_nov01c.ino: In function 'void loop()':
sketch_nov01c:15:24: error: 'sinOut' was not declared in this scope
analogWrite(fadePin, sinOut); delay(15); }
^
exit status 1
'sinOut' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Lastly, I used this code but I'm at a loss of how to tell it to stay on for 10 seconds following the fade and to stay off for 10 seconds following the fade:

int led = 3;           // the PWM pin the LED is attached to
int brightness = 0;    // how bright the LED is
int fadeAmount = 5;    // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup() {
  // declare pin 3 to be an output:
  pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // set the brightness of pin 3:
  analogWrite(led, brightness);

  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;

  // reverse the direction of the fading at the ends of the fade:
  if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  // wait for 30 milliseconds to see the dimming effect
  delay(150);
}

Well found this code and using this for the time being, however still trying to understand how to incorporate a fade.

In the meantime, watching lots of youtube tutorials and reading even more.

void setup() {
   pinMode(3, OUTPUT);
}
 
void loop() {
   digitalWrite(3, HIGH);   // set the LED on
   for (int x=0; x < 10000; x++) {     // Wait for 1 second
      delay(1);
   }
   digitalWrite(3, LOW);   // set the LED on
   for (int x=0; x < 10000; x++) {     // Wait for 1 second
      delay(1);
   }
}

Ok, I think I figured it out. At least it is doing what i want. Posting this for anyone who happens to find my thread through in a search:

int ledPin = 3;    // LED connected to digital pin 9


void setup()  { 
  // nothing happens in setup 
} 


void loop()  { 
  // fade in from min to max in increments of 5 points:
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect    
    delay(30);                            
  } 
  delay(10000);


  // fade out from max to min in increments of 5 points:
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect    
    delay(30);                            
  } 
  delay(10000);
}
1 Like