

Automatic AC Switch
The Automatic AC Switch Using PIR Sensor is an electronics project designed to automatically control an electrical load based on human motion detection.
- Size
- 113.4 × 68.3 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 17
- Nets
- 38
- Pads
- 72
- Tracks, vias
- 94, 0
- Pours
- 2
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 13 Oct 2026
- Updated
- 13 Oct 2026
Overview
Automatic AC Switch is an open-source printed circuit board by Manideep136, from the Manideep136/Automatic-AC-Switch-using-PIR-sensor repository on GitHub. It is a 2-layer board of 113.4 × 68.3 mm with 17 parts on 38 nets, routed with 94 tracks and 0 vias.
It is built around the HLK-5M05 and BC547. Its parts include 5 resistors, 4 diodes, 3 connectors, 1 capacitor and 1 IC. It belongs with the ESP32 and AVR (ATmega, ATtiny) boards of this library.
Main components
2README
README.mdAutomatic-AC-Switch-using-PIR-sensor
📌 Project Overview
The Automatic AC Switch Using PIR Sensor is an electronics project designed to automatically control an electrical load based on human motion detection.
The Passive Infrared (PIR) sensor detects movement within its sensing range and provides a trigger signal to a switching circuit. The switching circuit controls a relay, which can be used to switch an AC-powered load such as a lamp or other suitable appliance.
This project focuses on schematic design, PCB layout, component placement, routing, and PCB design verification using KiCad.
🎯 Objectives
- Design an automatic motion-based switching circuit.
- Interface a PIR sensor with a relay driver circuit.
- Create the circuit schematic using KiCad.
- Assign appropriate footprints to electronic components.
- Design and route a custom PCB.
- Perform Electrical Rules Check (ERC) and Design Rules Check (DRC).
- Prepare the PCB design for potential manufacturing.
⚙️ Working Principle
- Motion Detection: The PIR sensor detects changes in infrared radiation caused by movement.
- Signal Output: The sensor generates an output signal when motion is detected.
- Switching Control: The sensor output activates the relay driver or switching circuit.
- Load Activation: The relay contacts switch the connected AC load ON.
- Automatic Switching: When motion is no longer detected, the load switches OFF according to the sensor's configured delay and circuit behavior.
Block Diagram
Human Motion
│
▼
PIR Sensor
│
▼
Switching / Driver
Circuit
│
▼
Relay
│
▼
AC Electrical Load🔧 Main Components
| Component | Function |
|---|---|
| PIR sensor module | Detects human motion |
| Relay | Switches the electrical load |
| Transistor or driver | Drives the relay when required |
| Resistors | Provide biasing and current limiting |
| Diode | Protects the driver from relay coil back-EMF, when required |
| Power supply | Provides the required DC voltage |
| Terminal blocks | Provide electrical connections |
| PCB | Holds and interconnects the components |
The exact component list and values depend on the final schematic and selected PIR sensor, relay, and power supply.
🖥️ Software and Tools
- KiCad – Schematic and PCB design
- KiCad Schematic Editor
- KiCad PCB Editor
- Footprint and symbol libraries
- 3D PCB Viewer
- Electrical Rules Check (ERC)
- Design Rules Check (DRC)
🧩 PCB Design Workflow
1. Schematic Design
The circuit schematic is created in KiCad, including the PIR sensor interface, switching circuit, relay driver, and power connections.
2. Footprint Assignment
Suitable footprints are assigned according to the actual component packages and datasheets.
3. Component Placement
Components are arranged to provide clear signal paths, practical connector access, and suitable separation between low-voltage and mains-voltage sections.
4. PCB Routing
Copper tracks are routed according to the schematic connections and the electrical requirements of the circuit.
5. Ground Plane
A GND copper zone can be added where appropriate to provide a common ground return for the low-voltage circuit.
6. Design Verification
ERC and DRC are used to identify electrical connection issues, clearance violations, unconnected nets, and other layout problems.
7. Manufacturing Preparation
Gerber and drill files can be generated after the PCB layout has been finalized and verified.
📐 PCB Design Considerations
- Use footprints that match the actual components.
- Check relay coil voltage and contact ratings.
- Verify the PIR sensor's operating voltage and output logic.
- Provide adequate trace widths for the intended current.
- Maintain appropriate creepage, clearance, and isolation between mains and low-voltage circuits.
- Keep high-voltage and low-voltage copper areas properly separated.
- Use connectors rated for the intended voltage and current.
- Verify the relay's contact arrangement (COM, NO, and NC) before connecting the load.
🔍 Design Verification Checklist
- Schematic completed
- Footprints verified
- Component placement checked
- Copper routing completed
- ERC completed
- DRC completed
- Relay pinout verified
- PCB clearances and isolation reviewed
- Board outline and silkscreen checked
- Gerber and drill files generated
📂 Suggested Repository Structure
Automatic-AC-Switch-PIR/
│
├── README.md
├── Schematic/
│ └── Automatic_AC_Switch.kicad_sch
├── PCB/
│ └── Automatic_AC_Switch.kicad_pcb
├── Images/
│ ├── schematic.png
│ ├── pcb-layout.png
│ └── 3d-view.png
├── BOM/
│ └── BOM.csv
└── Gerber/
└── Manufacturing_Files/🚧 Project Status
| Stage | Status |
|---|---|
| Circuit schematic | Based on project design |
| Footprint assignment | To be verified |
| PCB layout | Based on current design progress |
| ERC/DRC | To be completed and verified |
| Manufacturing files | To be generated |
| PCB fabrication | Not claimed |
| Hardware testing | Not claimed |
Update the status table to reflect the actual progress of your project before publishing it.
🚀 Future Improvements
- Add adjustable motion-detection delay.
- Add sensitivity adjustment, if supported by the PIR module.
- Optimize PCB size and component placement.
- Add mounting holes and clear connector labels.
- Improve enclosure integration.
- Fabricate and test the PCB under appropriate safety conditions.
⚠️ Safety Notice
This circuit may control AC mains voltage, which can cause electric shock, serious injury, or fire. Maintain appropriate isolation and mains-rated component selection. Do not handle or modify an energized circuit. Mains-side PCB design and testing should be reviewed and performed by a qualified person using suitable safety procedures. For a beginner project, consider using a certified, enclosed AC switching module or a low-voltage demonstration load.
📚 Learning Outcomes
This project provides practical experience with:
- Electronic schematic design
- PCB footprint selection
- Component placement and routing
- Relay-driver circuit design
- Copper zones and grounding
- ERC and DRC verification
- PCB documentation and manufacturing preparation
🛠️ Project Tools
Design Software: KiCad Project Type: Electronics and PCB Design Application: Motion-activated electrical switching Output: Schematic, PCB layout, and optional manufacturing files
Note: This repository documents the PCB design. Fabrication and hardware testing should only be marked complete after they have actually been performed.
Parts
17| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | 560R | Resistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_Horizontal | R3, R4, R5 |
| 3 | LED | LED_THT:LED_D5.0mm | D1, D2, D3 |
| 1 | 10K | Resistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_Horizontal | R2 |
| 1 | 1N4007 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D4 |
| 1 | 2K2 | Resistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_Horizontal | R1 |
| 1 | Arduino_Nano_ESP32 | Module:Arduino_Nano | A1 |
| 1 | BC547 | Package_TO_SOT_THT:TO-92_Inline | Q1 |
| 1 | C | Capacitor_THT:CP_Radial_D22.0mm_P10.00mm_SnapIn | C1 |
| 1 | Conn_01x02_Pin | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_Horizontal | J1 |
| 1 | Conn_01x03_Pin | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3_1x03_P5.00mm_Horizontal | J3 |
| 1 | Conn_01x03_Pin | HC-SR501-master:HC-SR501 | J2 |
| 1 | HLK-5M05 | Converter_ACDC:Converter_ACDC_Hi-Link_HLK-5Mxx | U1 |
| 1 | Relay_SPDT | Relay_THT:Relay_1-Form-C_Schrack-RYII_RM3.2mm | K1 |
Questions
How big is the Automatic AC Switch PCB?
It measures 113.4 × 68.3 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Automatic AC Switch use?
17 parts, built around the HLK-5M05 and BC547. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Automatic AC Switch KiCad files?
From the Manideep136/Automatic-AC-Switch-using-PIR-sensor repository on GitHub, at the commit this page was made from: the board is Automatic AC Switch/Automatic AC Switch.kicad_pcb and its schematic Automatic AC Switch/Automatic AC Switch.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Automatic AC Switch design in my own project?
Its repository states no licence, so its author keeps all rights: ask Manideep136 before reusing the design.
Similar boards
- 2 layers97 × 80 mm

- 2 layers100 × 78 mm

ProjetoPI3
EmmanuelRGuesser/PJ_Integrador_3
Projeto de medidor de consumo enérgetico residencial desenvolvido para ESP32
14 parts - 2 layers82 × 52 mm

Pir based night light
goku-g/night_light_controller
Night light control system based on PIR sensor and ESP32.
11 parts - 2 layers164 × 126.7 mm

- 2 layers81 × 95.7 mm

BRD2
mFulmini/engineer
Tutaj znajduje się część pracy inżynierskiej w postaci oprogramowań jednostek brzegowych, rysunków, schematów elektrycznych oraz poglądowych zrzutów ekranu.
25 parts - 2 layers100.9 × 82 mm

MashMachine V2.1 PT100
xrayer2000/MashMachine
My own built brewing system for making wonderful beer at home
51 parts1 - 2 layers100 × 98 mm

- 2 layers55 × 84.4 mm
