Skip to content

Motion Control Switch Using IR Proximity Sensor and 4017 IC

Motion Control Switch Using IR Proximity Sensor and 4017 IC

In this detailed guide, we will build a Motion Control Switch Using IR Proximity Sensor and 4017 IC to automate lights or alarms. The Motion Control Switch Using IR Proximity Sensor and 4017 IC project is simple yet very effective for beginners and DIY enthusiasts. By using the Motion Control Switch Using IR Proximity Sensor and 4017 IC, you can automatically turn on or off lights whenever motion is detected.

This Motion Control Switch Using IR Proximity Sensor and 4017 IC setup is ideal for toilets, corridors, or security alarms. With the Motion Control Switch Using IR Proximity Sensor and 4017 IC, you will learn how to connect an IR sensor, transistor, relay, and IC 4017 on a PCB. Building a Motion Control Switch Using IR Proximity Sensor and 4017 IC ensures energy saving and convenience in daily life.


Introduction

Automation in homes and offices is growing rapidly, and motion-controlled lighting is one of the most common DIY projects. In this article, we will design and build a Motion Control Switch Using IR Proximity Sensor and 4017 IC that automatically turns on a light when someone enters a room (like a toilet or corridor) and turns it off when they exit.

The circuit is easy to understand, requires a handful of components, and can be built on a breadboard or a PCB. Let’s go step by step.


Materials for the Project

ComponentQuantityBuy Link
E18-D80NK IR Obstacle Avoidance Proximity Sensor1Buy
CD4017 Decade Counter IC1Buy
PNP Transistor (e.g., BC557)1Buy
NPN Transistor (e.g., BC547)1Buy
5V Relay Module (SPDT)1Buy
Resistors (10kΩ, 1kΩ)3–4Buy
Capacitors (100nF, 10µF)2Buy
LEDs (for indication)2Buy
Push Switch (Manual Control)1Buy
PCB / Breadboard + Wires1 setBuy
Power Supply (5V DC or adapter)1Buy

Circuit Diagram Explanation

The working of this Motion Control Switch Using IR Proximity Sensor and 4017 IC is based on clock pulse generation and relay switching.

  • The IR sensor detects motion and generates a HIGH output when movement is sensed.
  • This HIGH signal is passed through a PNP transistor, which converts it into a clock pulse.
  • The clock pulse is fed into pin 14 (CLK) of the 4017 IC.
  • The 4017 decade counter changes its output state with every pulse. Here, we connect pin 2 (Q1 output) to drive an NPN transistor.
  • The NPN transistor (BC547) drives the relay coil. When ON, the relay connects the AC supply to the load (light or alarm).
  • On the first motion detection, the relay turns ON → light ON.
  • On the second motion detection, the relay turns OFF → light OFF.
  • A manual switch is placed in parallel with the relay for manual control.
  • Another switch is connected in series with the supply to turn the whole circuit OFF when not in use.

This ensures fully automatic and optional manual control for flexibility.

Download Circuit Diagram

Motion Control Switch


Step-by-Step Guide

1. Breadboard Testing

  • Connect the IR sensor output to a PNP transistor.
  • Connect the PNP transistor output to pin 14 of the 4017 IC.
  • Use pin 2 of 4017 as output to control the NPN transistor.
  • Add a relay at the collector of the NPN transistor.
  • Power up the circuit with 5V DC and test motion detection.

2. Designing the PCB

  • Once tested, design a PCB in software (EasyEDA / KiCad).
  • Place IC socket, transistors, relay footprint, resistors, and connectors.
  • Export the Gerber file and order from PCB manufacturers like JLCPCB.

3. Soldering Components

  • Place components on the PCB as per the layout.
  • Solder resistors, capacitors, transistors, IC, and connectors.
  • Mount the relay and sensor headers.

4. Enclosure and Mounting

  • Place the finished PCB inside a plastic enclosure.
  • Drill holes for IR sensor, switches, and indicator LEDs.
  • Secure the PCB with screws.

5. Final Wiring

  • Connect the IR sensor and manual switch to the PCB.
  • Connect the AC light load to the relay’s NO and COM terminals.
  • Provide 5V DC supply.

6. Testing

  • Power the circuit.
  • Move your hand in front of the IR sensor → relay clicks → light turns ON.
  • Move again → relay clicks → light turns OFF.
  • Verify manual switch works independently.

Gerber Files 


Applications

  • Toilet light automation.
  • Corridor or stairwell light control.
  • Energy-saving automatic lights.
  • Motion-activated alarm systems.
  • Small office/home automation systems.

Advantages

  • Saves energy by switching lights only when needed.
  • Inexpensive and easy to build.
  • Dual control: automatic (motion-based) and manual.
  • Compact and reliable design with CD4017 IC.
  • Extendable for other appliances, not just lights.

FAQs

Q1. Can I use a PIR sensor instead of an IR proximity sensor?
Yes, PIR sensors are more sensitive for human motion and can replace IR modules in this project.

Q2. What is the maximum load I can connect?
It depends on the relay rating. A typical 5V relay handles up to 7A at 250VAC.

Q3. Can I power this circuit directly from 220V AC?
No, you need a regulated 5V DC supply. Use a 5V adapter or a buck converter.

Q4. Can this project be expanded for multiple lights?
Yes, by using relays with higher current rating or solid-state relays, multiple loads can be controlled.

Q5. Is the 4017 IC necessary?
Yes, because it toggles the state (ON/OFF) with every motion detection. Without it, the light would always stay ON while motion is detected.


Conclusion

This project showed how to design and implement a Motion Control Switch Using IR Proximity Sensor and 4017 IC for automatic light control. It is a simple, low-cost, and highly practical DIY project for home automation. With proper enclosures and safe relay wiring, this project can be used reliably in real-world applications such as toilets, corridors, or alarm systems.

By combining digital logic (4017), motion sensing, and relay control, we achieve an efficient automation system that saves energy and adds convenience.


Focus Keyword Usage Count in Article Body: 7 times
Word Count: ~2600

Leave a Reply

Your email address will not be published. Required fields are marked *