Connect with us

LDR with two LEDs

Discussion in 'LEDs and Optoelectronics' started by JoeKageri, Jan 25, 2015.

  1. JoeKageri

    JoeKageri

    2
    0
    Jan 25, 2015
    Hey there, I'm very new to circuit construction.

    I was wondering if its possible to use a single LDR to control 2 LEDs?
    One green LED and one red LED.
    Justi in this situation I also have a bunch of 330 ohms of resistors.

    Basicly it's to sense the presence of an object that occupies a space?
     
  2. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,266
    Nov 28, 2011
    Hi Joe and welcome to Electronics Point :)

    Yes, you can use one LDR to control two LEDs, but you haven't explained how you want to control the LEDs based on the light level at the LDR.

    Do you have a description you could post?

    Do you have a schematic (circuit diagram) of what you have been using so far?

    If you want to sense the presence of an object, you will need a permanently active light source. The object will need to be between the light source and the LDR so it blocks the light from reaching the LDR. The LDR will then tell you whether the object is there or not. I don't know what you want the second LED for.

    You need to explain your requirements, and your project generally. Then we will be able to give you specific advice and suggestions.
     
  3. JoeKageri

    JoeKageri

    2
    0
    Jan 25, 2015
    Hey there! ^^
    Thanks for the speedy reply and sorry for being vague about the description.

    Well basicly i plan to make a small circuit that can be applied to a display shelf.

    The display shelf will have a permanent light source set to each shelf. When the LDR detects the light, it will turn on the green light (Vacant). Until something is placed in the shelf, covering the LDR. This will cause it to turn on the Red light (Occupied) and turn off the green one.

    As for the circuit diagram, i can try to make one as soon as possible.
     
  4. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,266
    Nov 28, 2011
    OK, here's my suggestion for a circuit with minimal parts.

    272421.001.GIF

    It can be powered from any DC supply in the range 4.5~12V. It should work down to 3V but the LED will be pretty dim, even if you delete RL. An ON/OFF switch, SW1, is shown if you want one.

    U1 is a CD40106B hex inverter with Schmitt trigger inputs. These are special inputs that "clean up" signals that hover around the decision threshold and produce a snap-like response to input changes. This isn't too important here because the difference in LDR resistance between illuminated and not illuminated should be pretty clear, but the IC is widely available and versatile. It's also known as CD4584 and 74C14.

    CD is a 100 nF (0.1 µF) ceramic capacitor that is required by U1 for reliable and clean operation. It must be connected as directly and closely as possible between pins 14 and 7.

    RS and the LDR form a voltage divider whose input feeds pin 1 of U1. The voltage here will be low when the LDR is illuminated (when its resistance is low and it drags the voltage down), and high when the LDR is not illuminated, where RS pulls the voltage up.

    The first inverting gate in U1 takes this voltage and produces a voltage on pin 2 with the opposite condition - it is high when the LDR is illuminated, and low when it isn't. This signal is sent to another inverter on pins 13 and 12, and to the inputs of two inverters at pins 11 and 9. The outputs of these two inverters (pins 8 and 10) are also commoned together; this provides a somewhat "stronger" output for driving the LEDs. They will be high when the LDR is in darkness.

    The signal on pin 12, which is also high when the LDR is in darkness, is fed to the inputs of the last two inverters, on pins 3 and 5. Their outputs (pins 4 and 6) are also commoned together, and they feed the opposite side of the LEDs. They will be high when the LED is illuminated.

    The LEDs are connected between these two sets of complementary outputs. The LED shown is actually a two-pin bicolour LED that contains the red and green elements in a single package, but two separate LEDs could also be used, connected as shown.

    When the LDR is illuminated, i.e. the space is empty, pins 4 and 6 will be high, and pins 8 and 10 will be low, so the green LED will be forward-biased. In the opposite state, the red LED will be forward-biased.

    RS needs to be chosen to set the decision point between illumination and darkness for the LDR. A rough value can be determined by measuring the LDR's resistance when illuminated and not illuminated in a practical setup, and choosing RS to be around the geometrical mean of the two values (multiply the two measured resistances and take the square root of the product).

    RL determines the LED brightness. A lower value makes the LEDs brighter. With this simple circuit, a single resistor limits current to both colours. This can be changed if the brightnesses are not properly matched, by adding a diode and a resistor. Let me know if you want details.

    Options for changing LED brightness are limited if the supply voltage is low. The circuit will work at 3V but the LEDs may not be very bright, even if RL is reduced to 0Ω (i.e. replaced with a short circuit).

    For operation at low voltage and low current, high-efficiency LEDs are available in discrete red and green units.

    Here are some links to relevant components on Digi-Key.

    CD40106 (U1) in DIP (through-hole): http://www.digikey.com/product-detail/en/CD40106BE/296-3503-5-ND/376602
    CD40106 (U1) in SMT: http://www.digikey.com/product-detail/en/CD40106BM96/296-14081-1-ND/525857
    CD40106 (U1) in SMT (different brand): http://www.digikey.com/product-detail/en/MC14106BDG/MC14106BDGOS-ND/1478836

    CD (0.1 µF ceramic capacitor), THT: http://www.digikey.com/product-detail/en/C420C104K5R5TA7200/399-4491-1-ND/818348
    CD (0.1 µF ceramic capacitor), SMT: http://www.digikey.com/product-detail/en/GRM188R71E104KA01D/490-1524-1-ND/587865

    LED, red/green, THT, wide viewing angle: http://www.digikey.com/product-detail/en/521-9459F/350-2408-ND/1832557
    LED, red/green, THT, narrower viewing angle: http://www.digikey.com/product-detail/en/SPR-54MVWF/511-1335-ND/637063
    LED, red/green, SMT, wide viewing angle: http://www.digikey.com/product-detail/en/LTST-C155GEKT/160-1172-1-ND/269244

    LED, red, THT 3 mm, very low current: http://www.digikey.com/product-detail/en/HLMP-K150/516-1311-ND/637575
    LED, red, THT 5 mm, very low current: http://www.digikey.com/product-detail/en/HLMP-D150/516-1323-ND/637587

    LED, green, THT 3 mm, wide viewing angle, extra bright: http://www.digikey.com/product-detail/en/521-8133F/350-3039-ND/2671654

    LED, red, THT 5 mm, narrow viewing angle, bright: http://www.digikey.com/product-detail/en/LTL2R3KRD-EM/160-1853-ND/2675133
    LED, green, THT 5 mm, narrow viewing angle, bright: http://www.digikey.com/product-detail/en/LTL2R3KGD-EM/160-1852-ND/2675131

    LED, red, THT 5 mm, medium viewing angle: http://www.digikey.com/product-detail/en/HLMP-4700-C0002/516-2483-1-ND/2744909
    LED, green, THT 5 mm, medium viewing angle: http://www.digikey.com/product-detail/en/HLMP-4740/516-1327-ND/637591

    LED, red, THT 3 mm, medium viewing angle: http://www.digikey.com/product-detail/en/HLMP-1700/516-1308-ND/637572
    LED, green, THT 3 mm, medium viewing angle: http://www.digikey.com/product-detail/en/HLMP-1790-A0002/516-1792-1-ND/1966498

    LED, red, SMT, wide viewing angle, very low current: http://www.digikey.com/product-detail/en/HLMP-P156-EG031/516-3056-1-ND/4240302

    LED, red, SMT, very wide viewing angle: http://www.digikey.com/product-detail/en/CMD2821VRCTR8T1/L62701CT-ND/254941
    LED, green, SMT, very wide viewing angle: http://www.digikey.com/product-detail/en/CMD2821VGCTR8T1/L62705CT-ND/254943

    LED, red, SMT, wide viewing angle, bright: http://www.digikey.com/product-detail/en/LS T67K-J1K2-1-Z/475-1180-1-ND/808950
    LED, green, SMT, wide viewing angle, bright: http://www.digikey.com/product-detail/en/LG T67K-H2K1-24-Z/475-2679-1-ND/1938846
     
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

-