Connect with us

Bi Colour LED Control

Discussion in 'LEDs and Optoelectronics' started by vinit2100, Feb 13, 2015.

Scroll to continue with content
  1. vinit2100

    vinit2100

    100
    1
    Oct 21, 2013
    Please find the circuit attached, Bi colour LED is controlled by a signal called PCB_LED_1, When PCB_LED_1=0, Green LED (top) glows, when PCB_LED_1 =0 , Red LED (bottom) glows, The control signal PCB_LED_1 is from a FPGA. So when the board is powered either Red/Green LED glows. How can we overcome this problem? Any alternate circuit for this ?
     

    Attached Files:

  2. ramussons

    ramussons

    344
    63
    Jun 10, 2014
    What is the problem?:oops:
     
  3. Harald Kapp

    Harald Kapp Moderator Moderator

    9,511
    1,960
    Nov 17, 2011
    Impossible: PCB_LED_1=1 turns on the upper LED, PCB_LED_1=0 turns on the lower LED.
    That is by design: the LEDs are controlled inversely. As soon as you have power one of the two LEDs will turn on (a note on the side: at R1=10kΩ you really see only a faint glow, if anything at all. Typically you need at least 1mA or more for an LED which means R1 <= 1.7kΩ).

    Which problem? What do you expect the LEDs to show at power on? If you want to control the LEDs independently, you will need two separate control signals, not just an inverter.
     
  4. vinit2100

    vinit2100

    100
    1
    Oct 21, 2013
    i want to control this by using a single i/o line. the requirement is when the board is powered the led's should not glow
     
  5. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,260
    2,707
    Jan 21, 2010
    1) What do you want the state of the LEDs to be when the input is high?

    2) What do you want the state of the LEDs to be when the input is low?

    3) What will the state of the input be when power is applied?

    4) What state do you want the LEDs to be in when power is applied?

    Note that the answer to question 3 should dictate the answer to question 4, it being the answer to question 1 or 2 depending on 3.
     
  6. vinit2100

    vinit2100

    100
    1
    Oct 21, 2013
    in this case when input is high D1 glows, when input is low D2 glows. this is a fpga board, so when the board is switched on either D1/D2 can glow. my requirement is After i download the .bit file to fpga. neither D1/D2 should glow. so what should i do ?
     
  7. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,260
    2,707
    Jan 21, 2010
    The device only has 2 states when power is applied. To get the third state (both LEDs off) remove the power.
     
    Arouse1973 likes this.
  8. vinit2100

    vinit2100

    100
    1
    Oct 21, 2013
    what if i drive the control line to HIGH IMPEDANCE state ?
     
  9. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,260
    2,707
    Jan 21, 2010
    Then the input will float and the circuit may oscillate.

    What colour LEDs are they?

    You could perhaps generate a third state by first pulling the input high then pulling it to mid-rail where the Schmitt trigger will not change state, but the input voltage will be insufficient to exceed the Vf of D1.

    It's possible you could even design a circuit to do this at power on.

    You would need a high impedance voltage divider to pull the input to mid-rail, a small capacitor across the upper resistor and then see how it goes. It may take some fiddling to make it work correctly with a high impedance input, and it may also be noise, temperature and/or voltage sensitive.
     
  10. Harald Kapp

    Harald Kapp Moderator Moderator

    9,511
    1,960
    Nov 17, 2011
    Use two separate outputs of teh FPGA to control each LED by a single control signal.

    Or you could use a window comparator. Use a resistive voltage divider to set the input voltage to the window comparator to Vcc/2 when the output of the FPGA is high impedance. Set the window width to Vcc/2+-0.5V.
    Now when you either pull the output high or low one of the two LEDs at the output of the window comparator will be on. If the output of the FPGA is tristate, the input to the window comparator will be Vcc/2 and no output of the window comparator will be active.

    I'd go for a second control output from the FPGA, this is much simpler.
     
  11. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,267
    Nov 28, 2011
    I agree with Harald's and Steve's comments. Here is the only suggestion I'm going to make. It's basically Harald's window comparator suggestion implemented with transistors.

    272680.001.GIF

    If the FPGA pin is set to input mode (or, preferably, output mode but tri-stated), it will float to a voltage determined by R1 and R2, and the base-emitter voltage drops of Q1 and Q2. Wtih the values I've given for R1 and R2, and a 3.3V supply, that should be around 1V. That should be comfortably lower than the minimum low value for a CMOS PLL, so the input circuitry on the pin will not be in the "invalid logic level" range of voltages. It will read as low.

    In this state, both Q1 and Q2 have base current, so Q1 will pull its collector high and Q2 will pull its collector low. This produces a high level at U1 pin 2, and a high level at U1 pin 6, so there will be no voltage across the LED and it will not light.

    If the FPGA sets that pin to an output and drives it high, Q1 will turn OFF (Q1 collector will be low) and Q2 will be ON (Q2 collector = low) so U1 pin 2 will be high and U1 pin 6 will be low. So the red LED will be biased ON and the bi-colour LED will glow red.

    You can figure out for yourself what happens if the FPGA sets that pin to an output and drives it low.

    So the three possibilities are:

    Pin in input mode or tri-stated: LED OFF
    Pin high: LED red
    Pin low: LED green.

    You can modify the circuit - for example, you can probably avoid the IC with the addition of one transistor, with the LED being driven directly from that transistor and one of the input transistors, though for the simplest design, this would waste power when the LED is OFF. If that's not a concern and you want to avoid the IC, let me know and I'll draw up the changes.
     
    Harald Kapp likes this.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-