Automatic ON/OFF Socket



Introduction: Automatic ON/OFF Socket

This Instructable is about Automatic Night Light.The Socket turns on during the night and it turns off when the light rays are falls on it.

This features

  • Bypass switch to directly operate the socket
  • Status Indication lamp
  • Versatile 5V operated
  • Light intensity adjustable using Potentiometer
  • Stable OPAMP operated unlike Transistor operated
  • Detachable LDR for convenient placing

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Components Required

1. LDR (Light Dependent Resistor)

2.5v Mobile Charger

3.1 X 22k Resistor

4.1 X 10k Resisitor

5.1 X 10k Variable Resistor

6.1 X LM358 Op-Amp IC

7. 1 x BC547 NPN Transistor

8. 1 X 1N4001 Diode

9. 1 X 5V Relay

10. 1 X Bypass switch to directly operate the socket

11. 1 X Current Indication Lamp

12. 2 X 3pin Sockets

13. Dupont Female to Female wires

14. Suitable enclousure

15. 1 Core wire 1 meter (for AC connection)

16. 4 x Berg Strips


Solder the components on a dot board as required and given in the schematic

Connect the terminals as shown above in the diagram

This step is self explanatory


For the 5V power supply I used NOKIA charger to give input for the circuit and I stripped the charger wires and soldered the female dupont pins at the wire end.

Similarly LDR terminals has been extended with two long wires and end soldered with duponts.

Step 3: Assembling

Use 3 core wire for the safety purpose. 1 Earth 1 Phase and other for Neutral

Here I used the hot glue to fix the dot board in the enclosure, you can also drill and screw it.

Keep the circuit board at the suitable place within the enclosure without touching the AC terminals of the socket,switch,etc...

Drill holes at the rear side of the enclosure to take out the wires for power supply and LDR.

When placing the LDR outside, find a suitable position where the light intensity required for switching is needed.

Step 4: Testing

Before soldering the components in the dot board have tested in the breadboard it works successfully!!!

When 230V input is given and if the brightness is low the relay will be trigged so introduce a bright light to the LDR to switch off.

The Bypass switch is included for quick access if brightness is not enough to trigger the relay.

After fixing the dot board in the enclosure adjust the potentiometer for the required brightness depending upon your location where the LDR placed.

If any doubts feel free to mail me at

Be the First to Share


    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest



    2 years ago

    Nice one. Good Start