I bought a RGB LED strip (analog) and it has one 12 volt and three ground pins that is pwm controlled (I assume) to dim them.
I also want to add a 12 volt white strip that turns off when the RBG turns off.

Sadly turning the controller off does not switch off the 12 volt but disables the ground pins.

So what can I do to make the white toggle with the RGB without dimming with the colored grounds?

I want the white to turn on when any of the RGB is on, and the white to turn off when all the RGB is off.

My thought is to have some kind of logic OR that essentially detects if any of the three wires have ground then also give ground to the white strip.
But I'm not good enough with logic gates, never actually used them only seen them in school about 25 years ago...

I can get both 12 volt and ground before the controller/driver.

  • \$\begingroup\$ So you want to turn the white LED's ON when any of the RGB LED's are OFF? \$\endgroup\$
    – Ron Beyer
    Commented Jun 29, 2020 at 19:02
  • \$\begingroup\$ @RonBeyer Sorry, no. I want the white to turn on when any of the RGB is on, and the white to turn off when all the RGB is off. \$\endgroup\$
    – Andreas
    Commented Jun 29, 2020 at 19:03

1 Answer 1


A 3-input NAND or AND gate will do what you want. For either one, there must be a separate resistor from each gate input to the +12 V. Each gate input connects to one of the three LED pins that are pulled to GND by the controller. The reason for the added resistors is to guarantee that an ungrounded input appears as +12 V to the gate rather than as an open circuit.

A NAND gate output will go low when all three inputs are high. An AND gate output will go high. This can drive a small power MOSFET that drives the white LED - anode to +12 V, cathode to the drain, source to GND.

UPDATE - Schematic

R1-C1-D1 form a missing pulse detector / lowpass filter. The inputs to U1B go low only if all three circuit inputs (R, G, B) stay low for at least 70 milliseconds (-ish). That is a loooong time in PWM, ans should indicate that all three LEDs are off without introducing too much delay in turning off the white LED. You haven't given any details about the white LED, so this schematic has a generic output stage.

RESPONSE: 1. For larger white LED currents, just about any n-channel power MOSFET will work, such as an IRF520. 2. The FET can be replaced with a relay, but U1C and the FET are necessary to drive it with the correct logic polarity. Be sure to add a suppression diode across the relay coil. 3. An MC14023 is a direct substitute for the CD part. Pin numbering should be identical; post a link to the datasheet. 4. The R1-C1 filter is necessary. Without it, the white LED will flicker constantly, varying with the brightness of the three color LEDs (the three PWM signals).

enter image description here

  • \$\begingroup\$ Do you mind making a simple sketch on that, I just want to be sure what you mean \$\endgroup\$
    – Andreas
    Commented Jun 29, 2020 at 20:12
  • \$\begingroup\$ Are you sure the color LEDs are driven with PWM signals? Do you have information from the controller manufacturer? \$\endgroup\$
    – AnalogKid
    Commented Jun 29, 2020 at 21:37
  • \$\begingroup\$ Added a schematic with a generic output stage. \$\endgroup\$
    – AnalogKid
    Commented Jun 29, 2020 at 22:54
  • \$\begingroup\$ Thank you so much, I'm trying to find parts or similar parts right now. Will report back when I found everything. I'm not sure that it is PWM. It's a Sonoff L1 and Sonoff products are pretty much always based on the ESP8285 or 8266 chip (this one 8285). I would be sirprised if it's not PWM. I found the discontined predecessor itead.cc/sonoff-led.html and it states it uses PWM. I don't think I need the 70 ms delay thing. Is there any other benefit than "making sure it's off"? \$\endgroup\$
    – Andreas
    Commented Jun 30, 2020 at 7:42
  • \$\begingroup\$ I think I found an issue with the MOSFET. The white LED strip is 9.6 w per meter, I will be using 3.5 meters, which means 33.6 w = 2.8 A. Admittedly I have never used a MOSFET but I see a rating of 2 A in the specifications. I could not find the CD4023 as it's not sold anymore (not here at least). But I found MC14023 which seems to match. 3 inputs, 3-18 V. Just the pin numbering that will be different if I understand it correctly. \$\endgroup\$
    – Andreas
    Commented Jun 30, 2020 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.