philba said:
I'm not sure how that circuit can be modified to meet the 3 level requirement.
What do you mean?
philba said:
I see several approaches that would work;
- uC based. LDR+Resistor forms a divider that varies the voltage with the ambient illumination. divider output into the ADC. voltage value read is used to decide on one of 3 PWM duty cycles (100%, 50%, 0)
- PWM circuit. sawtooth generator into one input of a comparator. LDR divider into the other comparator input. value of LDR divider will vary the PWM duty cycle. may need a driver transistor if comparator doesn't have the drive current. This varies the LED output continuously so it techniccally doesn't meet the requirements.
- dual comparator. one comparator for each of the two transition voltages (ie light levels). each comparator contributes 1/2 the current for the LED. the comparator outputs are fed through current limiting resistors and connected to the cathode of an LED, anode is tied to +5V.
schmitt triggers could be added but I kind of think a little flickering would be ok.
What are you talking about?
That seems abig complex just for turning an LED on and off.
bananasiong said:
thanks, which npn and pnp should i use? can it be 2N3904 and BC327? how about the diode?
You don't need a diode for an LED basuce it isn't inductinve so there's no back EMF.
bananasiong said:
Is IN34 enough? Vcc to the 22K and GND to end of LDR right? I thought i need a VR to adjust the sensitivity?
Yes you doo need a variable resistor, I was making you think, I did say it needs some modifications for it to work as you expect.
mramos1 said:
Does this help
**broken link removed**
There's nothing worng with that circuit but it depends on what you want to do, it's fine for switching low power loads with a relay but I wouldn't use it at high powers as the relay isn't snapped on and off, the current throught the coil changes slowly thus softening the switching action which can cause arcing at the contacts at high currents - not important for this application I'm just explaining things.
bananasiong said:
thanks for that!! can i just replace the relay with a LED or a bulb?
Yes you can, (as I said before) this circuit is fine but you'll notice that the LED or bulb won't turn on or suddenly but will slowly get brighter or dimmer and it might vary with the temperature, is this behaviour acceptable?
Also it isn't suitable for large light bulbs or high powered LEDs since the transistor will be getting quite warm when it isn't fully saturated.
My circuit solves these problems (although it uses more parts) the LED/bulb will suddenly turn on or off, and it includes some
hysteresis to help prevent oscillation.