Apr 092015

Twilight switch circuit with Op. Amp. and LDR

This Twilight switch circuit activates a light, a lamp, a motor, etc., at the time of sunset. and performs the reverse process at dawn. This is an ideal circuit for activating a security light that must be on all night.

How the Twilight switch circuit work?

This circuit uses an operational amplifier, configured as an inverting amplifier. The circuit uses an LDR as a light sensor. An LDR has very low resistance when exposed to a high intensity light and a very high resistance when it is in the dark.

Twilight Switch Circuit with LDR and Op. Amp.

Resistors R1, R2 (LDR) and R3 form a voltage divider. When the LDR (R2) is illuminated, the voltage at its terminals decreases and the voltage level at the inverting terminal of the operational amplifier decreases.

The positive terminal of the operational amplifier is connected to a potentiometer in order to adjust the level of darkness that will make the op amp output goes high.

When the natural light decreases, the value of resistor R2 increases, as the voltage at its terminals. This causes the voltage across the resistor R3 to decrease, causing the operational amplifier output to goes high. This activates the relay and turns ON the LED.

When we are in darkness and daylight returns, the reverse process begins. The value of the LDR decreases, the voltage across resistor R3 increases, exceeding the set voltage in the non-inverting terminal of the Operational Amplifier. This causes the output of the operational amplifier goes to a low level, deactivating the relay and turning off the LED.

It is very important to prevent the LDR to be illuminated by sources other than natural light. This would be an undesired effect. For example: a Flashlight illuminating the LDR, will turn off the lamp, the motor, or whatever, when it is still dark.

List os components for the Twilight switch circuit

  • 2  1K resistors (R1, R7)
  • 1  LDR (R2)
  • 1  100K resistor (R3)
  • 1  100K potentiometer (R4)
  • 1  220K resistor (R5)
  • 1  10K resistor (R6)
  • 1  BC337 NPN transistor
  • 1  100 uF electrolytic capacitor. 18 volts or more.
  • 1  100 nF capacitor.
  • 2  1N4001 semiconductor diodes (D1, D2)
  • 1  Red LED (L1)
  • 1  LM741 Operational Amplifier
  • 1  12V relay dual output (NO and NC)


  2 Responses to “Twilight switch circuit with operational amplifier and LDR”

  1. R7=?? Twice R2???

 Leave a Reply