BJT switches are fast and the transistors are not expensive. A minus point is the current needed to operate the switch.
MOSFETS are even faster but they cost more. A plus point is the minute current needed to operate the switch - nearly zero.
OP-Amp comparators are slow, more expensive, but much more sensitive to input voltage changes.
Logic GATE switches are fast and cheap but not very sensitive to small input voltage changes.
Mechanical switches are less reliable due to the moving parts.
Electromagnetic relays are less reliable due to the moving parts.
Mechanical switches and relays can switch high voltages and currents and also alternating current.
A Light Sensing Comparator Circuit
If V+ is higher than V- the output will be high. The LEDs will light.
If V+ is lower than V- the output will be low. The LEDs will not light.
V+ is on pin 3 and V- is on pin 2.
How it Works
R1 and R2 form a voltage divider.
Since the resistors are equal, the voltage is divided equally and the potential at A is about 6V.
R3 and the LDR form a potential divider.
In the light, the LDR resistance is lower so the voltage at B rises.
In the dark, the LDR resistance increases so the voltage at B drops.
The 741 operational amplifier chip is being used as a comparator.
The open loop gain of the op amp is very large (more than 100000).
This means that tiny differences in the input voltages cause large changes in the op amp output.
In bright light, the voltage at B is greater than the voltage sat A so the output of the op amp (C) is low (close to 0V). The op amp will be saturated.
In dim light, the voltage at B is less than the voltage at A so the output of the op amp (C) is high (close to +12V). The op amp will be saturated.
In the dark, the voltage at C is high (+12V) so about 10mA will flow through R4 and the LEDs will be lit.
In bright light, the voltage at C is low (0V) so no current flows through the LEDs.
Why Two LEDs?
An ideal op amp would be able to produce output voltages of +12V and 0V.
Real life op amps are not so good. They might only manage a high voltage of 9 to 12 V and a low voltage of 0 to 3 V.
In this case, the low output voltage would still be enough to light a single LED even when it was not supposed to be lit.
A fault like this could be fatal in an aircraft "Your Engine is On Fire" alert.
By using two LEDs, each of which needs about 2V to light, four volts are needed to light the LEDs. This ensures that the LEDs go off when they are supposed to.
The Circuit Layout
Subject NameLevelTopic NameQuestion HeadingFirst NameLast NameClass IDUser ID