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

#### Ford Prefect

Joined Jun 14, 2010
201
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?

#### SLK001

Joined Nov 29, 2011
1,548
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.

#### Dodgydave

Joined Jun 22, 2012
9,951
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.

#### Ford Prefect

Joined Jun 14, 2010
201
You are going to have to add some hysterisis to the 741
It will work better with hysteresis by putting a 470k resistor between pins 3,6
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?

#### Dodgydave

Joined Jun 22, 2012
9,951
I would use a better op amp, like lm358, or TLC271, otherwise its ok.
.

#### SLK001

Joined Nov 29, 2011
1,548
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.

#### Colin55

Joined Aug 27, 2015
519
Buy yourself a few $2.00 solar garden lights and fit different colour LEDs. #### AnalogKid Joined Aug 1, 2013 9,248 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 Thread Starter #### Ford Prefect Joined Jun 14, 2010 201 I would use a better op amp, like lm358, or TLC271 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. What is the MAX current output of the 741? The maximum output current, I estimate will be about 10-11mA....perhaps more. Also, the 741 will not go to zero volts with a single ended supply True, but the voltage will be so small it is negligible. (<1v) What is the current requirement for the 555? Current will be about 11mA What is the current requirement for the LEDs? Between 5-8mA Use the output of the opamp to drive the base of a transistor switch, like a 2N3904. 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? Buy yourself a few$2.00 solar garden lights and fit different colour LEDs.
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!!

Last edited:

#### wayneh

Joined Sep 9, 2010
17,152
If you want to add a flickering flame effect, take a look here.

#### SLK001

Joined Nov 29, 2011
1,548
If you insist on using a 741, here is your modified circuit.

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.

#### Colin55

Joined Aug 27, 2015
519
Buy yourself a few $2.00 solar garden lights and fit different colour LEDs. You can buy flickering flame LEDs for 20 cents. Thread Starter #### Ford Prefect Joined Jun 14, 2010 201 If you insist on using a 741, here is your modified circuit. View attachment 103847 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. Umm, thank you, I like your thinking. Without me searching trying to find a suitable MOSFET, what P-CHANNEL MOSFET can you suggest? #### GopherT Joined Nov 23, 2012 8,012 Buy yourself a few$2.00 solar garden lights and fit different colour LEDs.
You can buy flickering flame LEDs for 20 cents.
Do you ever read what any OP asks for before you respond?

#### Colin55

Joined Aug 27, 2015
519
"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?

#### Sensacell

Joined Jun 19, 2012
2,821
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.

#### Ford Prefect

Joined Jun 14, 2010
201
The MOSFET might not turn off all the way as it is.
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.

#### dannyf

Joined Sep 13, 2015
2,197
but can anyone suggest anything I’ve missed or suggest a more suitable circuit?
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.

#### GopherT

Joined Nov 23, 2012
8,012
"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?
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.

#### SLK001

Joined Nov 29, 2011
1,548
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.
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.