I'm using the LDR and led to build a model log cabin to place in my garden.

Discussion in 'The Projects Forum' started by Ford Prefect, Apr 5, 2016.

  1. Ford Prefect

    Thread Starter Active Member

    Jun 14, 2010
    36
    1
    Hi Guys,

    I am building a model log cabin to place in my garden. I want to place a circuit inside with LED lights so that it appears there are people inside.

    The circuit will be powered by a 12v DC supply.
    The circuit is to detect the outside light level via the LDR and using the 741 as a comparator (RED section) so that when it is getting dark and the light level drops to between 300-500 lux (sunrise/sunset) or below it will turn on the timing circuit (which also turns off if the light level is greater than 500 lux) via a 555 timer wired as an astable (GREEN section). One of the white LEDs (in the BLUE section) will switch on and then after several minutes this LED will turn off and then the other white LED will turn on then after another few minutes this LED will turn off and the cycle will repeat making it look as if someone is inside switching the lights on and off.
    I may need to alter the preset and the resistor balancing the LDR but as far as I can work out, this circuit seems to be ok, but can anyone suggest anything I’ve missed or suggest a more suitable circuit?

    Timer Circuit1.jpg
     
  2. SLK001

    Well-Known Member

    Nov 29, 2011
    817
    226
    You are going to have to add some hysterisis to the 741, or it will "rapidly change states" when the LDR is close to the threshhold.

    Also, you are requiring the 741 to provide the power to the rest of the circuit, so "no", it is not going to work. Use the output to switch on a MOSFET or transistor with the output.
     
  3. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,979
    744
    It will work better with hysteresis by putting a 470k resistor between pins 3,6,,,,or replace the op amp with another 555 timer and use that as a photo switch.
     
  4. Ford Prefect

    Thread Starter Active Member

    Jun 14, 2010
    36
    1
    Yes thanks agreed, with hysteresis it will stop any 'chattering' when the 741 is at it's theshold.
    The output when the 741 is conducting, I am calculating will be about 11v, this should be enough to provide power to the timer and LED circuits.

    Any other thoughts? upload_2016-4-5_18-52-39.png
     
  5. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,979
    744
    I would use a better op amp, like lm358, or TLC271, otherwise its ok.
    .
     
  6. SLK001

    Well-Known Member

    Nov 29, 2011
    817
    226
    What is the MAX current output of the 741? Also, the 741 will not go to zero volts with a single ended supply.

    What is the current requirement for the 555?

    What is the current requirement for the LEDs?

    Like I said earlier, use the output of the opamp to drive the base of a transistor switch, like a 2N3904.
     
  7. Colin55

    Member

    Aug 27, 2015
    191
    19
    Buy yourself a few $2.00 solar garden lights and fit different colour LEDs.
     
  8. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,532
    1,249
    I recommend using 1/2 of an LM393 comparator instead of the 741. This comparator has an open-collector output, which is perfect for driving a PNP transistor switch in series between the battery + terminal and the power bus in the green and blue sections. 2N3906 or 2N4403 transistor, 2.2K resistor from the 393 output to the transistor base, 47K from the base to the emitter. Besides being better suited to the task, the 393 is a lower power device, which will improve the overall circuit efficiency since it is the only active device that is on 24/7.

    Going further down this road, a 393 output has a typical rating of 16 mA, and your schematic indicates an LED current of less than 10 mA. The 2nd half of the 393 can be your low frequency oscillator and drive one LED, with a 2N7000/7002 transistor inverting the output to drive the other one. And, you save one LED current limit resistor. The transistor switch would be controlling power to the LEDs only.

    Going even further down the road, a quad opamp like the LM324 can be the LDR sensor, oscillator, and two LED drivers. In this case the output of the sensor circuit disables the oscillator and output stages, no need for a power switch, no discrete transistors, and no 555.

    ak
     
  9. Ford Prefect

    Thread Starter Active Member

    Jun 14, 2010
    36
    1
    Yes possible, but it would be a shame to underestimate the 741, it is quite a versatile IC and referring to the specifications it should be more than capable of using it in this circuit.
    The maximum output current, I estimate will be about 10-11mA....perhaps more.
    True, but the voltage will be so small it is negligible. (<1v)
    Current will be about 11mA
    Between 5-8mA
    I'm not entirely sure what you are thinking. Are you saying add a capacitor and resistors in place of the 555?
    Can you supply a diagram?
    Yes but this won't do what I want it to do. I want the lights to flash something like every 5-10 minutes.

    My calculations are subject to the specifications of the components, however most things in life are not perfect even me!! :D
     
    Last edited: Apr 5, 2016
  10. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    If you want to add a flickering flame effect, take a look here.
     
  11. SLK001

    Well-Known Member

    Nov 29, 2011
    817
    226
    If you insist on using a 741, here is your modified circuit.

    cir.jpg
    The inputs of the opamp have been reversed to properly switch on the MOSFET. With the MOSFET, the opamp has virtually no load, so the voltage swing is the highest. Just get an Enhancement Mode P-CHANNEL MOSFET with a turn-on threshold of 8+ volts.
     
  12. Colin55

    Member

    Aug 27, 2015
    191
    19
    Buy yourself a few $2.00 solar garden lights and fit different colour LEDs.
    You can buy flickering flame LEDs for 20 cents.
     
  13. Ford Prefect

    Thread Starter Active Member

    Jun 14, 2010
    36
    1
    Umm, thank you, I like your thinking. Without me searching trying to find a suitable MOSFET,
    what P-CHANNEL MOSFET can you suggest?
     
  14. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,026
    3,789
    Do you ever read what any OP asks for before you respond?
     
    AnalogKid and ebeowulf17 like this.
  15. Colin55

    Member

    Aug 27, 2015
    191
    19
    "Do you ever read what any OP asks for before you respond?"
    I want to place a circuit inside with LED lights so that it appears there are people inside.

    Why build an exotic circuit for such a simple application?
     
  16. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,129
    266
    Ditch the 741 and use a modern part that can go closer to the rail, the MOSFET might not turn off all the way as it is.
     
  17. Ford Prefect

    Thread Starter Active Member

    Jun 14, 2010
    36
    1
    Yes agreed, I to am not sure the MOSFET will entirely turn off as the 741 will still (I think) be conducting a few mV when the comparator is in it's off state.
     
  18. dannyf

    Well-Known Member

    Sep 13, 2015
    1,782
    360
    The 555 is essential a comparator configured via some resistors so it is widely used by people as comparator's. Ie you can get rid of the 741. So two 555 or 1 556.

    If you do retain the 741, it is better to use its output to control the 555s reset pin. Or experiment the appropriate ldr vs resistor combination so that the pair can control the 555 directly via the reset pin.
     
  19. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,026
    3,789
    You are still funny. Reading only the first sentance doesn't qualify. There were several more requirements in there than an LED candle or LED lanscape light won't solve. Now you've taken the time to made three useless posts here, why don't you read all the words in each of the OP's posts. Once you've done that, you might sit back and enjoy the challenge of solving an interesting problem rather than blurting out the first solution that pops into your head to a problem that you want the OP to ask.

    Next time, read the whole post.
     
  20. SLK001

    Well-Known Member

    Nov 29, 2011
    817
    226
    With selection of the threshold voltage to be in the "active output" area of the 741 comparater, the MOSFET will turn off entirely. Also, without a heavy load, the 741 can get closer to the rails. The circuit is set up so that when the comparater is "HI", the LEDs will be off. When the comparater is "LO", the LEDs will be on.
     
Loading...