1
\$\begingroup\$

I have a string of multi colour LED lights - two colours are connected in one polarity, and the other two colours are reversed. They come with a controller that is able to turn all the LEDs on at once by reversing the polarity at a high frequency.

I'd like to get rid of that controller and control them with my own microcontroller. I'm looking for a part or circuit design that could reverse the polarity of that load based on a digital high/low signal. I could then feed this a PWM signal from my micro at a 50% duty cycle.

I had thought about using a H-bridge (I have some L293Ds to hand) but that on its own won't quite do what I want, as I have to bring one input low and the other high.

Could anyone point me in the right direction? Perhaps I'm just thinking about this in the wrong way.

\$\endgroup\$
  • 1
    \$\begingroup\$ (1) Is the problem with the H-bridge that you only have one pin available on your micro? (2) You want to alternate the two colours but do you need them both off at any time? (That will require another output from your micro. Please edit the info into your question. \$\endgroup\$ – Transistor Nov 24 '17 at 19:14
0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. A simple NPN transistor inverter will allow driving the H-bridge from one micro-controller pin.

  • When CLK goes high A1 out will go positive and A2 to GND.
  • When CLK goes low A1 out will go low and A2 to V+.
  • By varying the duty cycle from 0 to 100% you can change the colour from 100% D2 to 100% D1.
  • Note that with this arrangement it is not possible to turn the LEDs off. You would need a second microcontroller output to switch the enable pin.
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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