This article talks about Light Controlled Switch Circuit using IC LM311 and LDR.
It simple and very useful and it feel light change near it.
We find this circuit in many place like automatic light, street lamp and security system.
Main thing is voltage comparator with LM311 IC.
LDR sees light and LM311 IC turns ON the relay.
Relay control other devices.
Also use BC547 transistor to control outside loads.
The circuit uses 12V DC power or 12V battery.
Circuit Working:

Parts List:
Component | Specification | Quantity |
---|---|---|
Resistors (All resistors are 1/4 watt unless specified) | ||
10k | 2 | |
1k | 1 | |
2.2k | 1 | |
Preset 47k | 1 | |
LDR as sensor | 1 | |
Semiconductors | ||
IC LM311 | 1 | |
Transistor BC547 | 1 | |
Diode 1N4007 | 1 | |
LED 5mm 20mA | 1 | |
Relay 12V SPST | 1 |
LM311 comparator is main part of this circuit and it compare two voltage levels.
Pin 2 Non-Inverting positive get reference voltage from preset VR1 and resistor R1.
Pin 3 Inverting negative get voltage from LDR and resistor R2 as voltage divider.
When light is bright the LDR resistance goes down and voltage at pin 3 goes up.
If pin 3 voltage is higher than pin 2 and output pin 7 goes LOW and this turns OFF the transistor and relay.
When light is dim LDR resistance goes up and voltage at pin 3 goes down.
If pin 3 voltage is lower than pin 2 then output pin 7 goes HIGH and this turns ON the transistor Q1 and relay.
LED1 glows to show relay work.
Diode D1 is put to protect from voltage spikes from relay coil.
Formulas with Calculations:
Voltage at Pin 3 (Inverting input):
Pin 3 voltage come from LDR and R2 voltage divider:
Formula:
V3 = (R2 / (LDR + R2)) × V_supply
Example:
If LDR in dark is 50kΩ
V3 = (10k / (50k + 10k)) × 12V = 2V
If LDR in bright light is 5kΩ
V3 = (10k / (5k + 10k)) × 12V = 8V
How to Build:
To build a Light Controlled Switch Circuit using IC LM311 and LDR following steps are required for connection of the circuit:
- Pin 1 of LM311 IC goes to GND
- Pin 2 of LM311 IC goes to Non-Inverting input between R1 and R2
- Pin 3 of LM311 IC goes to Inverting input between VR1 preset and LDR
- Pin 4 of LM311 IC goes to GND
- Pin 5 and pin 6 of LM311 IC connects together
- Pin 7 of LM311 IC goes to base of transistor Q1 through resistor R3
- Pin 8 of LM311 IC goes to positive supply +12V
- Collector goes to positive supply through diode D1
- Emitter goes to GND
- One coil pin connects to positive supply
- Other coil pin connects between diode D1 and transistor collector
- LED anode connects to positive supply
- LED cathode connects to one end of resistor R4
- Other end of resistor R4 connects between diode D1 and transistor collector
Conclusion:
This Light Controlled Switch Circuit using IC LM311 and LDR is simple and works good.
LM311 comparator make switching exact.
Transistor BC547 help relay work strong.
We can change sensitivity by preset VR1.
It is good for automatic night lights, security alarms and for saving energy.
Leave a Reply