Motion Sensitive Automatic Light Using 4017 & IR Sensor

In this project, we are going to build a motion-sensitive automatic light using 4017 and an IR sensor. When somebody attempts to cross the sensor, the light will automatically turn on and it will glow consistently. And after coming back to the sensor range, it will automatically turn off.

This circuit utilizes an IR LED and an IR receiver to detect an object. Also, it uses an LM358 op-amp ic and a 4017 decade counter to operate the whole switching program.

People are volatile sometimes to switch off home appliances. To do this easily, we build this project. This may lower electricity wastage as well as light’s lifetime.

Principle Behind Motion Sensitive Automatic Light

When somebody enters a room by crossing the sensor, the IR sensor sends a clock pulse to 4017 ic. Then the light turns on and after the person exits the room it will turn off immediately.

Each time when IR sensor detects an object, it sends the clock pulse to the 4017 decade counter. By that principle, 4017 ic is set to ON state and after receiving another clock pulse it goes back to the previous state (OFF state).

CAUTION: Please take proper safety precautions while working on mains power supply as it is 230V AC source.


Motion sensitive automatic light
Motion Sensitive Automatic Light

Circuit Diagram

Motion Sensitive Automatic Light Circuit Diagram
Motion Sensitive Automatic Light Circuit Diagram

Components Required

  • LM358 Op-Amp
  • 4017 Decade Counter
  • BC547 NPN Transistor
  • IR LED & IR Transmitter
  • 100uF/25V Capacitor
  • 1000uF/25V Capacitor
  • 220 Resistor (x4)
  • 10K Resistor
  • 10K Trimmer Pot
  • 1N4007 PN Diode
  • 5V Relay
  • LED (Red, Green)
  • 9V Battery

PCB Design

For removing messy wiring and give a clean look, I designed a PCB prototype for this project. It is also helpful for troubleshooting that runs great without any errors. To design this PCB board, I used EasyEDA as it is too easy to use. For ordering PCB for this, I personally prefer PCBWay.

Gerber file for Motion Sensitive Automatic Light Gerber.

PCB View

Motion Sensitive Automatic Light 2D View
2D View
3D View

Order PCB From PCBWay

This project is sponsored by PCBs are required everywhere in the electronics industry. So it needs to be good enough and have to serve the purpose for which they are needed without costing exorbitant amounts. PCBway offers all your needs come true. PCBWay is one of the largest PCB (Printed Circuit Board) manufacturing companies in china. It offers PCB prototype, PCB Assembly, SMD Stencil, and Flexible PCB.

They ship to more than 170 countries worldwide and process more than 2100 PCB orders a day. It feels like PCBWay gives an excellent price and customer service factor in one single serving. I personally ordered PCBs from PCBWay for my projects for just 5 dollars. I’ve used other PCB manufacturers too, but PCBWay has been offering the most reliable and consistent that I have tried. What is also spectacular about PCBWay to me, as a maker and customer, is their service. From their friendly support staff to their intuitive, user-friendly website features, it all counts towards what makes PCBWay an ideal company and brand for any electronics hobbyists.

Standard quality for any product needs to be maintained using some parameters. PCBWay gives that opportunity by quality control in designing and manufacturing. At first, they ensure accuracy, clarity, validity of the PCB files that we sent to them.

Then all the boards will go through the most stringent tests other than the basic visual check. They adopt most of the testing and inspecting equipment used in the industry, such as Flying Probe Tester, X-Ray Inspection Machine, Automated Optical Inspection (AOI) Machine. PCBWay are having 50+ new engineers on the daily basis around the world using PCBs for their work, who trust for their reliable quality. They produce high-quality pink, orange, grey, even transparent solder mask. Moreover, according to people needs, they can also provide Black core PCB. Check it out for a High-Quality PCB solder mask. There are some pictures below of the new colours of solder musks.

Features of PCBWay

PCB Prototyping & Manufacturing: PCBWay produces FR-4 and Aluminum boards and advanced PCBs like Rogers, HDI, Flexible and Rigid-Flex boards, at a very reasonable price. Just check this Instant Quote to order premium PCBs for your hobby projects.

PCB Assembly: It not only offers PCB Prototyping but also offers PCB Assembly service. You can order a full PCB board with attached components by uploading your file. SMT & THT assembly starts from only 30$ including free stencil and worldwide shipping. The components can be sourced and provided by PCBWay, or by clients themselves.

Open Source Community: It not only offers PCB Prototype & Assembly service but also gives opportunities to students for sponsorships. I think this is so great. They feature their projects on the website also.

3D Printing & CNC: It also produces Rapid Prototyping like 3D printing, CNC Machining, Sheet Metal Fabrication, and Injection Molding. The quality of the product is too premium and reliable. And also the best part is that you will receive your order within a minimum of 3 days.

Services: PCBWay offers great servicing of their products. It takes only 3 to 15 days according to courier service to deliver your products. Also, it has a live support facility. Whenever you have any problems, you can always reach a live customer service person to respond to your emails or messages. They have the “Return and Refund” principle, for every unusable board caused by PCBWay, they will rebuild and refund the order soon.

Working Principle of Motion Sensitive Automatic Light

The working of an IR LED is to emit IR rays continuously. So when an object comes to these rays, some of these will reflect by this object and go back to the IR receiver.

Then LM358 op-amp compares the voltage between the IR receiver and the predefined value. If any voltage fluctuation is detected happened by the IR receiver, then the output of LM358 becomes high. The clock pin (pin 14) of 4017 IC is connected to the output pin (pin 1) of LM358 ic.

So the output of the op-amp is then received as an input to the 4017 ic and it changes the current state of the output pin (pin 2). The output of the 4017 decade counter is connected with the base of the BC547 NPN Transistor. The transistor acts as a switch, so the transistor then becomes high.

After that, the current can flow through the 5V relay and that’s how the circuit will turn on the connected load.

In the same process, when the IR receiver detects the second clock pulse, it becomes low. Thereafter the load connected with the 5V relay will turn off.

Applications of Motion Sensitive Automatic Light

  • Mostly used in washroom lights to switch on and off.
  • It is also can use in home appliances like AC, fan etc to reduce electricity bills.

5 thoughts on “Motion Sensitive Automatic Light Using 4017 & IR Sensor”

  1. Go through and complete the process to order PCBs. Download the gerber file from the mentioned.

Leave a Comment