Lights and Display Board Circuits

Automatic Washroom Light Switch


In this project I will show you how to design and build a simple Automatic Washroom Light Switch,which will automatically turn on the when you enter the washroom and turns it off when you leave.

We turn on the lights in our washroom when we enter it and turn them off when we leave. Sometimes, we forget to turn the lights off after leaving the washroom.

This may result in energy waste, as well as a reduction in the light bulb’s lifetime. To circumvent these issues, I’ll show you how to build a simple circuit that will automatically turn the lights on when a person enters the restroom and turn them off when he or she exits.

There are numerous advantages to automating the procedure in this manner, including the fact that the individual does not have to worry about turning the light on or off whenever he or she uses the restroom. For that person, the circuit, which you will learn about in a moment, performs it automatically.

The circuit is also designed to utilise less energy, so it may be used in any home or public restroom without causing problems.


  • Introduction
  • Automatic Washroom Light Switch Circuit Diagram
  • Components Required 
  • A Brief Note on Reed Switch
  • Circuit Design 
  • Working
  • Operation of the Circuit 

Automatic Washroom Light Switch Circuit Diagram

Components Required 

  • Reed Switch with Magnet (available as combination)
  • LM741 Op-Amp IC 
  • CD4017 Decade Counter IC 
  • 5V Relay Module 
  • Lamp 
  • BC558 PNP Transistor
  • 2 X 10KΩ Resistor 
  • 100Ω Resistor 
  • 820Ω Resistor 
  • Connecting wires 
  • Mini Breadboard 
  • 5V Power Supply

A Brief Note on Reed Switch

Reed Switch is one of the important components of this circuit and in fact the element which is used to detect the opening and closing of the door in this project is a reed switch. The following image shows a typical reed switch.

Automatic Washroom Light Switch Reed Switch Internal

A Reed Switch is a switch that is actuated by magnets. It has a magnetic sensitive switch that will either close or open when a modest magnetic force is applied to it (depending on its construction).

Reed switches are divided into two categories. The first has a normally open contact, while the second has a normally closed contact.

Below is a picture of the Reed Switch that was utilised in this project. Because it is enclosed in a housing, nothing can be seen, but the part with wires is the Reed Switch, and the other part is a magnet.

This is a Normally Open NO type switch i.e. usually the switch is open and when a magnet is placed near the switch, it will be closed. 

Reed Switches are mainly used in detecting whether door is open or not. It can also be used as a proximity sensor.

Circuit Design 

The first important component is the LM741 Op-Amp. It is being operated in comparator mode. Pin 2 is the inverting input of LM741 and its input is given from two 10KΩ Resistors. 

One end of the Reed Switch is connected to +5V supply while the other end is connected to base of a PNP Transistor (BC558). Also, the base of the transistor is pulled down with the help of a resistor. 

The emitter of the transistor is connected to the Non-inverting input of the Op-Amp while the collector of the transistor is connected to +5V. 

Automatic Washroom Light Switch

Pin 1 of LM741 i.e. its output is connected to the CLK input of CD4017 i.e. its Pin 14. Pin 2 of CD4017 is connected to the input of the relay while Pin 4 is connected to Pin 15. 

Rest of the connections can be easily understood from the circuit diagram. 

WARNING: If you are planning to use a real light bulb that runs on AC Supply, be extremely careful when connecting it to the relay and providing the mains supply. 


Before continuing with the circuit’s operation, I’ll first go through the circuit’s planned setup. The magnet is attached to the door, while the reed switch is mounted on the wall near it. This means that the reed switch will always be in the closed position because the door is closed while the washroom is not in use (assumed starting point), and the magnet will be close to the switch.

Assume you entered the washroom through the front door and then closed it behind you. This action will open (when the door is opened first) and close the switch (when you close the door).

As a result, the output of the Op-amp goes HIGH (when you open the door)and then goes LOW (when you close the door). This in turn will cause the counter to produce a HIGH output at its Pin 2. Since Pin 2 of CD4017 is connected to the relay, the light will be turned ON. 

Now, when you’re finished with your business in the washroom, you’ll open the door again, exit the washroom, and close it. This activity will result in the same result, i.e. the switch will open and close, and the Op-Amp output will become HIGH and then LOW.

However, because CD4017’s Pin 4 is connected to the Reset pin, all of the outputs will become LOW, causing the relay to turn off, which will turn out the light.

Operation of the Circuit 

  1. Make the connections and power on the circuit. 
  2. Open the door of the washroom, enter the washroom and close the door behind you. 
  3. This action will turn ON the light of the washroom. 
  4. Once you are done, open the door, leave the washroom and close the door. 
  5. This action will turn OFF the light of the washroom.


Related Articles

Leave a Reply

Your email address will not be published.

Back to top button