Skip to the content
PCBKitNew board
2 layers113.4 × 68.3 mmAutomatic AC Switch, the printed circuit board in 3D

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

2

README

README.md

Automatic-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

  1. Motion Detection: The PIR sensor detects changes in infrared radiation caused by movement.
  2. Signal Output: The sensor generates an output signal when motion is detected.
  3. Switching Control: The sensor output activates the relay driver or switching circuit.
  4. Load Activation: The relay contacts switch the connected AC load ON.
  5. Automatic Switching: When motion is no longer detected, the load switches OFF according to the sensor's configured delay and circuit behavior.

Block Diagram

text
       Human Motion
            │
            ▼
       PIR Sensor
            │
            ▼
    Switching / Driver
         Circuit
            │
            ▼
          Relay
            │
            ▼
      AC Electrical Load

🔧 Main Components

ComponentFunction
PIR sensor moduleDetects human motion
RelaySwitches the electrical load
Transistor or driverDrives the relay when required
ResistorsProvide biasing and current limiting
DiodeProtects the driver from relay coil back-EMF, when required
Power supplyProvides the required DC voltage
Terminal blocksProvide electrical connections
PCBHolds 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

text
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

StageStatus
Circuit schematicBased on project design
Footprint assignmentTo be verified
PCB layoutBased on current design progress
ERC/DRCTo be completed and verified
Manufacturing filesTo be generated
PCB fabricationNot claimed
Hardware testingNot 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
QtyValueFootprintReferences
3560RResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_HorizontalR3, R4, R5
3LEDLED_THT:LED_D5.0mmD1, D2, D3
110KResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_HorizontalR2
11N4007Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD4
12K2Resistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_HorizontalR1
1Arduino_Nano_ESP32Module:Arduino_NanoA1
1BC547Package_TO_SOT_THT:TO-92_InlineQ1
1CCapacitor_THT:CP_Radial_D22.0mm_P10.00mm_SnapInC1
1Conn_01x02_PinTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalJ1
1Conn_01x03_PinTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3_1x03_P5.00mm_HorizontalJ3
1Conn_01x03_PinHC-SR501-master:HC-SR501J2
1HLK-5M05Converter_ACDC:Converter_ACDC_Hi-Link_HLK-5MxxU1
1Relay_SPDTRelay_THT:Relay_1-Form-C_Schrack-RYII_RM3.2mmK1

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 mmPCB B1 V0.1, the printed circuit board in 3D

    PCB B1 V0.1

    praveenraj-rs/Power_Loom

    Project on Power Loom Automation

    24 parts1
  • 2 layers100 × 78 mmProjetoPI3, the printed circuit board in 3D

    ProjetoPI3

    EmmanuelRGuesser/PJ_Integrador_3

    Projeto de medidor de consumo enérgetico residencial desenvolvido para ESP32

    14 parts
  • 2 layers82 × 52 mmPir based night light, the printed circuit board in 3D

    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 mmEnergy management, the printed circuit board in 3D

    Energy management

    Lalith-8025/PCB_design_SOI_Assignment

    17 parts
  • 2 layers81 × 95.7 mmBRD2, the printed circuit board in 3D

    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 mmMashMachine V2.1 PT100, the printed circuit board in 3D

    MashMachine V2.1 PT100

    xrayer2000/MashMachine

    My own built brewing system for making wonderful beer at home

    51 parts1
  • 2 layers55 × 84.4 mmOpenReflowPlate, the printed circuit board in 3D

    OpenReflowPlate

    makingdevices/OpenReflowPlate

    An Open Reflow Plate machine for smd soldering

    71 parts6