I've been working on this project to design a simple LED nightlight using a photoresistor over the past couple of weeks and having initially went with using a single transistor to control the circuit I've finally decided to just use an op-amp instead. The main problems with the transistor configuration:
(1) No clear-cut transition from off to on. The LED gradually brightens, but controlling the range of resistances in an acceptable way is difficult.
(2) Wild variations in triggering due to environmental temperature changes; getting even slightly-consistent results under different conditions is basically impossible.
Thinking about how a comparator works, it dawned on me that an op-amp would result in a much more precise circuit. So the idea was simply to set up two voltage dividers, one as a reference to control the cut-on threshold and the other as input from the sensor. When the resistance of the sensor goes above 39K ohms the LED should light.
I haven't breadboarded it yet, but it seems like it should work okay. Does the design have any major weaknesses? Also, could the circuit be simplified even further?
(1) No clear-cut transition from off to on. The LED gradually brightens, but controlling the range of resistances in an acceptable way is difficult.
(2) Wild variations in triggering due to environmental temperature changes; getting even slightly-consistent results under different conditions is basically impossible.
Thinking about how a comparator works, it dawned on me that an op-amp would result in a much more precise circuit. So the idea was simply to set up two voltage dividers, one as a reference to control the cut-on threshold and the other as input from the sensor. When the resistance of the sensor goes above 39K ohms the LED should light.
I haven't breadboarded it yet, but it seems like it should work okay. Does the design have any major weaknesses? Also, could the circuit be simplified even further?