The mosfets I use are IRLZ44N.
I wrote a quick test program
void setup() {
pinMode(6, OUTPUT); // Red
pinMode(3, OUTPUT); // Green
pinMode(9, OUTPUT); // Blue
digitalWrite(6, HIGH);
digitalWrite(3, HIGH);
digitalWrite(9, HIGH);
}
void loop() {
// Turn on red
digitalWrite(6, LOW); // Red ON
digitalWrite(3, HIGH); // Green OFF
digitalWrite(9, HIGH); // Blue OFF
delay(1000);
// Turn on green
digitalWrite(6, HIGH);
digitalWrite(3, LOW); // Green ON
digitalWrite(9, HIGH);
delay(1000);
// Turn on blue
digitalWrite(6, HIGH);
digitalWrite(9, HIGH);
digitalWrite(3, LOW); // Blue ON
delay(1000);
}
When I connect R pad of the strip to drain of the corresponding mosfets it works. You see led strip being red 1/3 of the time and being 0ff for 2/3 of the time.
Same when I connect just Blue pad or Green Pad.
If I connect R and G or any other pair of colors it also works ok. But if I connect all three then I see weird colors. I think this is an issue with the type of mosfet I am using but it seem weird as I am not using PWM signal. I am providing either low or high signal at the gate so why would I get a pinkish color of the led strip. Can someone explain this phenomenon to me
The way you have your gate and pulldown resistors connected they are forming a voltage divider. Try putting the pulldown on the other end of the gate resistor.
The strip is common anode so I light the channal by applying the low signal at the gate. The mosfet connection is fine as it works as expected when I have just one or two color channels connected. The funny colors start when I have all three color channels connected. So it seam that then Arduino starts sending slightly different signals to the gate and the mosfets start working differerntly. Today I used the same exterlal power suply to malso power arduino. Tomorrow I will try to connect it just to led strip and power arduino fro USB , not sure if that would make any difference.
Also I was wondering if the selection of MOSFET matters. Would a different type of mosfets behave differently in this setup as it is better equipped to work with small voltages.
The 10k pull down resistor is there for the Arduino pin, not for the gate of the fet.
It keeps the Arduino pin LOW during bootup.
Only logic level mosfets should be used.
That excludes the common/cheap IRF520 etc.
Leo..
I had an external power supply 5v with 2A. I am currently powering a strip with just 6RGB leds so 18 leds . This should be 18x20ma so 360mA. SO this should be enough to power those leds and power arduino through 5V arduino pin
I know. But I am trying to make this RGB setup work. This setup on paper should work and I am trying to understand why it does not when 3 mosfet are created. The mosfet connectivity in my diagram is correct as it works when Just one mosfet is used
Nothing did. But you wrote you light it driving the gate low and that doesn't match with your mosfet.
You didn't answer anything about the power source...
So how should this circuit look like for common anode strip. Again let me emphasize . The way the mosfets are connected works ok when I connect one color or even two colors. So how does it work when it is incorrect?