Site icon Circuit Ideas for You

Light Controlled Switch Circuit using IC LM311 and LDR

A circuit that works as a Light Controlled Switch uses the LM311 integrated circuit along with a Light Dependent Resistor (LDR).

This circuit is simple but very useful because it reacts to changes in light levels around it.

You can find this kind of circuit in many places, like automatic lights, street lamps and security systems.

The main idea behind this circuit is a voltage comparator that is built around the LM311 IC.

In this design, the LDR detects the light and the LM311 comparator turns on a relay, which can control other electrical devices and a transistor BC547 to control external loads.

It runs on a 12V DC power supply and you can also use a 12V battery for power.

Circuit Working:

Parts List:

ComponentSpecificationQuantityRemarks
Resistors (1/4W)
10k2
1k1
2.2k1
Preset47k1
Sensors
LDR1
Semiconductors
ICLM3111
TransistorBC5471
Diode1N40071
LED5mm, 20mA1
Other Components
Relay12V SPST1

The LM311 comparator is the main part of this circuit, and it is really important for comparing two different voltage levels.

At pin 2 called the Non-Inverting Input (+) a reference voltage is set up using a preset VR1 along with a resistor R1.

On the other hand pin 3 known as the Inverting Input (-) gets its voltage from a light-dependent resistor LDR and a resistor R2 that work together as a voltage divider.

When the light is bright the LDRs resistance goes down, which makes the voltage at pin 3 go up.

If the voltage at pin 3 is higher than at pin 2 the output at pin 7 of the comparator goes LOW, which turns off the transistor and the relay.

But when the light gets dimmer the LDRs resistance increases causing the voltage at Pin 3 to drop.

If the voltage at pin 3 is lower than at pin 2 the output at pin 7 switches to HIGH turning on the transistor Q1 and the relay.

Also, the LED1 lights up to show that the relay is working.

To protect against any voltage spikes from the relay coil a diode D1 is added to the circuit for safety.

Formulas with Calculations:

Below are the formulas with calculations for Light Controlled Switch Circuit using IC LM311 and LDR

Voltage at Inverting Input (Pin 3 of LM311):

The voltage at pin 3 is determined by the voltage divider formed by the LDR and resistor R2:

Formula: V3 = (R2 / (LDR + R2)) × V_supply

Example Calculation:

Assume LDR resistance in darkness is 50kΩ:

V3 = (10k / (50k + 10k)) × 12V

V3 = (10k / 60k) × 12V

V3 = 2V

If the LDR resistance in bright light drops to 5kΩ:

V3 = (10k / (5k + 10k)) × 12V

V3 = (10k / 15k) × 12V

V3 = 8V

Reference Voltage at Non-Inverting Input (Pin 2 of LM311):

The reference voltage is set using the preset VR1 and resistor R1.

Formula: V2 = (R1 / (VR1 + R1)) × V_supply

Example Calculation:

If VR1 is set to 47kΩ: V2 = (10k / (47k + 10k)) × 12V

V2 = (10k / 57k) × 12V

V2 = 2.1V

If VR1 is set to 20kΩ: V2 = (10k / (20k + 10k)) × 12V

V2 = (10k / 30k) × 12V

V2 = 4V

If VR1 is set to 10kΩ: V2 = (10k / (10k + 10k)) × 12V

V2 = (10k / 20k) × 12V

V2 = 6V

Comparator Output Logic:

If V3 > V2 the output at pin 7 is LOW keeping the transistor OFF and relay OFF.

If V3 < V2 the output at pin 7 is HIGH turning the transistor ON and activating the relay.

Example:

If V3 = 8V (bright light) and V2 = 2.1V relay remains OFF.

If V3 = 2V (darkness) and V2 = 2.1V relay turns ON.

Transistor Base Current Calculation (Q1 – BC547):

The transistor is used to drive the relay.

The base current is given by:

Formula: I_B = (V_output – V_BE) / R3

where:

Example Calculation:

I_B = (12V – 0.7V) / 1k

I_B = 11.3V / 1000

I_B = 11.3mA

Relay Coil Current Calculation:

The relay coil current is given by:

Formula: I_Relay = V_supply / R_Relay

Assuming a 12V relay with a coil resistance of 400Ω: I_Relay = 12V / 400Ω

I_Relay = 30mA

Diode Protection Calculation:

The diode 1N4007 protects against back EMF from the relay coil.

V_diode > V_supply

Since the supply is 12V the 1N4007 rated for 1000V is more than sufficient.

How to Build:

To build a Light Controlled Switch Circuit using IC LM311 and LDR following steps are required for connection of the circuit:

Conclusion:

This Light Controlled Switch Circuit using IC LM311 and LDR is a simple and efficient way to control devices depending on how much light is around.

The IC LM311 comparator ensures accurate switching and the BC547 transistor helps the relay work well.

You can adjust the sensitivity with the preset, which makes it useful for different things like automatic night lights, security alarms and systems that save energy.

References:

Datasheet IC LM311

Exit mobile version