Control RGB LED strip color and brightness

I wanted to control the 5M multiple LED strips for color and brightness by arduino. in fact it would be nice to be able to control by Bluetooth module via android.

the problem is that i do not have a strong background in electronics so, i don't know how to wire them all and which electrical components are to be required to make it properly run.

I have 5 LED strips of 5 Meter each and has 72W power, 12V & 5A

can anyone help me to achieve this two things 1)changing the color of LED 2) control the brightness of led
all 5 LED strips to be controlled individually

I have 5 LED strips of 5 Meter each

OK good start, but what sort of strips are they? A link to the data sheet or where you bought them from would be good.

Please read this:-
How to use this forum
for how to ask a question correctly here.

Grumpy_Mike:
OK good start, but what sort of strips are they? A link to the data sheet or where you bought them from would be good.

Please read this:-
How to use this forum
for how to ask a question correctly here.

Sorry!! i forgot to mention the Type of LED strip. It would be 5050 SMD strip which will draw 14.5 W/meter, and has 30 LEDs/meter. please find the below link from where i bought this strip.

https://www.ledshopindia.in/Indoor-Lighting/LED-Strip-Lights/Buy-5050-SMD-Flexible-RGB-Color-LED-Strip

That link does not provide the vital piece of information, which is are the LEDs individually addressable? The picture would appear to say yes but the text does not confirm this, and the 12V input is not normally used on addressable LED strips.

In fact the close up picture of the strip shows no controller chips at all. Therefore I think all you can do with this is to have all the LEDs on any one strip be all the same colour. Therefore you can't do a chase sequence.

To confirm this what inputs do you have on this strip. I would expect there to be four. One +12V and the other three R,G & B grounds. Is this right?

Return the strips to the seller and demand a refund. The seller is being dishonest. They show a picture of the strip displaying a pattern that the strip cannot in fact produce.

Paul

Grumpy_Mike:
To confirm this what inputs do you have on this strip. I would expect there to be four. One +12V and the other three R,G & B grounds. Is this right?

Mike, one of the photos on the web page shows that you are correct. The buyer has been swindled.

Grumpy_Mike:
That link does not provide the vital piece of information, which is are the LEDs individually addressable? The picture would appear to say yes but the text does not confirm this, and the 12V input is not normally used on addressable LED strips.

In fact the close up picture of the strip shows no controller chips at all. Therefore I think all you can do with this is to have all the LEDs on any one strip be all the same colour. Therefore you can't do a chase sequence.

To confirm this what inputs do you have on this strip. I would expect there to be four. One +12V and the other three R,G & B grounds. Is this right?

Yes, it is not addressable LED, but i wanted something inexpensive for the project so i decided to go with this and its alright if the same color is applied to all the LED connected to series.

i only wanted to pair the android app to the arduino and perform the color change and brightness control.

OK then. You will need 15 pwm outputs and 15 logic-level n-channel MOSFETs.

What kind of Arduino do you have/want to use? Even Mega has only 14 pwm pins, but there are several ways around this.

I think there is library called "shiftPWM" that would allow you to use 2 x 74hc595 shift registers to provide the 15 pwm outputs. Alternatively there are chips such as tlc5940 available with 16 pwm outputs, although you would still require the MOSFETs to handle all that current.

There are many suitable MOSFETs available such as stp16nf06l. You would put a 10K pulldown on the pwm output and a 200~300R resistor between the pwm output and the MOSFET gate.

PaulRB:
OK then. You will need 15 pwm outputs and 15 logic-level n-channel MOSFETs.

What kind of Arduino do you have/want to use? Even Mega has only 14 pwm pins, but there are several ways around this.

I think there is library called "shiftPWM" that would allow you to use 2 x 74hc595 shift registers to provide the 15 pwm outputs. Alternatively there are chips such as tlc5940 available with 16 pwm outputs, although you would still require the MOSFETs to handle all that current.

There are many suitable MOSFETs available such as stp16nf06l. You would put a 10K pulldown on the pwm output and a 200~300R resistor between the pwm output and the MOSFET gate.

Thank you Paul, i have arduino uno with me so i have to do as you said of using the shift registers.
i wiil try the components which you have suggested and will let you know how it's working out.
Again thanks for the help.

PaulRB:
Alternatively there are chips such as tlc5940 available with 16 pwm outputs, although you would still require the MOSFETs to handle all that current.

The problem with that chip with FET buffers is that you can never completely turn off the LED. This is because you invert the signal and the fact that there is always one clock cycle off becomes their is always one clock cycle on. While you don't notice the the LED is not quite full brightness, you do notice that it is not completely off.

The only way round this is to make sure you arrange things so that when the output of the chip goes to ground the FET buffered signal turns the LED on.

Hello,
for testing the code i have used stp16nf06l mosfet and 200R resistor to pwm pin and tested a portion of LED strip. for this i have used omniblug app.

all worked well, it works as per the code except one thing, up on powering off the strip from app green and red LED stays minorly lit.

i have tried everything but i am not being able to correct that problem.

i have also used a 10k resistor between gate and source but its not getting off.
it goes off only after turning off the power supply.

please anyone can tell me how to correct this problem.
i am attaching the code and also link to diagram i have used for wiring.

wiring diagram

code:

 //librerias
   #include <EEPROM.h>
 
    int ledRed = 10; 
    int ledgreen=11; 
    int ledblue=9;  
    int ledRed2 = 5; 
    int ledgreen2=6; 
    int ledblue2=3;  
    int red;
    int green;
    int blue;
    int action=0;
    int bluetooth=2;
    int port=0;
    int firsttime;
    int pinDefault=1234;
    
     
    void setup() 
    {
      pinMode(bluetooth,OUTPUT); 
      digitalWrite(bluetooth,HIGH);
      
      Serial.begin(9600);
      
      firsttime=EEPROM.read(0);
      
      if(firsttime!=1){
        color(0,255,255);
        programer(pinDefault);
        EEPROM.write(0,1);
        color(255,0,255);
      }
    }
     
    void loop() 
    {          
      
      while (Serial.available() > 0) {
        
        action = Serial.parseInt();

           if(action==1){
              port=Serial.parseInt();
              red = Serial.parseInt();
              green = Serial.parseInt();
              blue = Serial.parseInt();
           }
           if (Serial.read() == '\n') {
               color(red,green,blue);
           }
      }
      if(action==2){
              color(0,255,255);
              delay(500);
              color(255,0,255);
              delay(500);
              color(255,255,0);
              delay(500);
      }
      if(action==3){
        int pin = Serial.parseInt();
        
        if (Serial.read() == '\n') {
          color(255,0,0);
          programer(pin);
          action=0;
          color(0,255,0);
        }  
        
      }
      
     
    }
    
    void programer(int pin){
        digitalWrite(bluetooth,LOW);
        delay(250);
        digitalWrite(bluetooth,HIGH);
        delay(5000);
        Serial.print("AT");
        delay(1000);
        Serial.print("AT+NAMEOMNIBLUG");
        delay(1000);
        Serial.print("AT+PIN"+pin);
        delay(1000);
        digitalWrite(bluetooth,LOW);
        delay(250);
        digitalWrite(bluetooth,HIGH);
    }
    
    
     
    void color(int red, int green, int blue){
        
        if(port==1){
          analogWrite(ledRed, red);
          analogWrite(ledgreen, green);
          analogWrite(ledblue, blue);
        }
        if(port==2){
          analogWrite(ledRed2, red);
          analogWrite(ledgreen2, green);
          analogWrite(ledblue2, blue);
        }
        if(port==3){
          analogWrite(ledRed, red);
          analogWrite(ledRed2, red);
          analogWrite(ledgreen, green);
          analogWrite(ledgreen2, green);
          analogWrite(ledblue, blue);
          analogWrite(ledblue2, blue);
        
        }
        
    }
     
    //Fin

please anyone can tell me how to correct this problem.

At the start of the setup function define each or the three led pins to be an output and set that output low.

i have also used a 10k resistor between gate and source

But your circuit uses transistors not FETs, so you have to put that resistor between base and emitter.

Grumpy_Mike:
But your circuit uses transistors not FETs, so you have to put that resistor between base and emitter.

i have used stp16nf06l mosfet with this circuit as the picture shows FETs and connected the resistor between gate(PWM pin) and source(ground).

Is it correct arrangement?

The resistor from the PWM to the FET's gate should be about 150R and 10K from gate to ground. The source must be connected to the Arduino's ground as well.

But also see my other point and change that code.

up on powering off the strip from app green and red LED stays minorly lit.

Which part of your code actions the "power off"?

At the start of the setup function define each or the three led pins to be an output and set that output low.

On this page it says

You do not need to call pinMode() to set the pin as an output before calling analogWrite().

Yes but it is the time between the power up and the first analog write in the code that is where he is seeing the problem. An alalogWrite of zero to each led in the setup function would do the same thing to cure the problem.

Grumpy_Mike:
Yes but it is the time between the power up and the first analog write in the code that is where he is seeing the problem.

Well, it could be an English translation thing, but I don't think that is what he was saying. I think he is saying that he powers the strip off from the app and it is after that the problem happens.

Yes paul you are correct!! when i press the turn off button in app at that time the strip goes off but i can see the red and green color LED stays lit which we can notice.

even yesterday i tried by disconnecting the adruino from power source but still the same problem persists.

though i am powering the strip with a separate 12V DC power supply and applied the ground to the arduino so, that's why i think the LEDs are getting the power from ground.

i don't know what is the exact reason but i will try what Grumpy_mike said and reply what is happening.

i don't know what is the exact reason but i will try what Grumpy_mike said and reply what is happening.

Don't bother.

It is leakage in the FETs.