Skip to main content
Visitor II
June 4, 2021
Question

How to drive bicolor LEDs by one pin.

  • June 4, 2021
  • 1 reply
  • 3427 views

How to drive bicolor LEDs by one pin. I think turn off LEDs when setting GPIO input. But it is not. On pin high level. What is problem.0693W00000Ba7QlQAJ.png

    This topic has been closed for replies.

    1 reply

    Graduate II
    June 4, 2021

    When you set GPIO as input youre effectively removing the conexion, what remains is both leds with their resistors perfectly polariced to start driving current.

    If this design is already in place you could try to increase R1 and R2 untill they are big enough to avoid D1 and D2 to simultaneously drive current when you set GPIO input.

    I expect this to be happening in this setup:

    • GPIO is high impedance(input): D1 on(less bright) D2 on(less bright)
    • GPIO 3v3 : D1 off D2 on (d2 full brightness)
    • GPIO GND:D1 on D2 off (d1 full brightness)

    Try this instead:http://dangerousprototypes.com/blog/2011/10/24/driving-a-bicolor-led-from-a-single-output-pin/

    ETsog.1Author
    Visitor II
    June 4, 2021

    i want to turn LEDs off. Then to make the GPIO input, it has to be HI-Z. But not D2 is light on.

    Graduate II
    June 4, 2021

    I didnt understand you.

    You mean when GPIO is input only D2 is on?