ESP32-Based Smart Home Automation System with PIR Motion Sensor and Relay Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an ESP32 Devkit V1 microcontroller, a 4-channel relay module, multiple pushbuttons, a PIR motion sensor, an LED, bulbs, an AC source, and sockets. The circuit is designed to control various devices through the ESP32, with inputs from pushbuttons and a PIR motion sensor, and outputs to relays and an LED.
Component List
ESP32 Devkit V1
- Description: A microcontroller with Wi-Fi and Bluetooth capabilities.
- Pins: 3V3, GND, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23, EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, VIN
Relay 4 Channel 5v
- Description: A relay module that allows control of high voltage devices.
- Pins: GND, IN1, IN2, IN3, IN4, VCC, COM1, COM2, COM3, COM4, NO1, NO2, NO3, NO4, NC1, NC2, NC3, NC4
Pushbutton
- Description: A simple pushbutton switch.
- Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
PIR Motion Sensor (Wokwi Compatible)
- Description: A motion sensor that detects infrared radiation.
- Pins: VCC, OUT, GND
GND
- Description: Ground connection.
- Pins: GND
LED: Two Pin (green)
- Description: A green LED.
- Pins: cathode, anode
Bulb
- Description: A standard light bulb.
- Pins: GND, power
AC Source
- Description: An AC power source.
- Pins: +, -
Socket
- Description: A standard electrical socket.
- Pins: earth, life, neutral
Wiring Details
ESP32 Devkit V1
3V3 connected to:
- Relay 4 Channel 5v (VCC)
- PIR Motion Sensor (Wokwi Compatible) (VCC)
D2 connected to:
- LED: Two Pin (green) (anode)
D19 connected to:
- Relay 4 Channel 5v (IN4)
D21 connected to:
- Relay 4 Channel 5v (IN3)
D22 connected to:
- Relay 4 Channel 5v (IN2)
D23 connected to:
- Relay 4 Channel 5v (IN1)
D34 connected to:
- PIR Motion Sensor (Wokwi Compatible) (OUT)
D27 connected to:
- Pushbutton (Pin 3 (out))
D14 connected to:
- Pushbutton (Pin 3 (out))
D12 connected to:
- Pushbutton (Pin 3 (out))
D13 connected to:
- Pushbutton (Pin 3 (out))
GND connected to:
- Pushbutton (Pin 2 (in))
- LED: Two Pin (green) (cathode)
- GND (GND)
- Pushbutton (Pin 2 (in))
- Pushbutton (Pin 2 (in))
- Pushbutton (Pin 2 (in))
- Relay 4 Channel 5v (GND)
- PIR Motion Sensor (Wokwi Compatible) (GND)
Relay 4 Channel 5v
VCC connected to:
- ESP32 Devkit V1 (3V3)
IN1 connected to:
- ESP32 Devkit V1 (D23)
IN2 connected to:
- ESP32 Devkit V1 (D22)
IN3 connected to:
- ESP32 Devkit V1 (D21)
IN4 connected to:
- ESP32 Devkit V1 (D19)
GND connected to:
- ESP32 Devkit V1 (GND)
COM1 connected to:
- Socket (life)
COM2 connected to:
- Socket (life)
COM3 connected to:
- Bulb (power)
COM4 connected to:
- Bulb (power)
NO1 connected to:
- AC Source (+)
NO2 connected to:
- AC Source (+)
NO3 connected to:
- AC Source (+)
NO4 connected to:
- AC Source (+)
Pushbutton
Pin 3 (out) connected to:
- ESP32 Devkit V1 (D27)
- ESP32 Devkit V1 (D14)
- ESP32 Devkit V1 (D12)
- ESP32 Devkit V1 (D13)
Pin 2 (in) connected to:
- ESP32 Devkit V1 (GND)
PIR Motion Sensor (Wokwi Compatible)
VCC connected to:
- ESP32 Devkit V1 (3V3)
OUT connected to:
- ESP32 Devkit V1 (D34)
GND connected to:
- ESP32 Devkit V1 (GND)
LED: Two Pin (green)
anode connected to:
- ESP32 Devkit V1 (D2)
cathode connected to:
- ESP32 Devkit V1 (GND)
Bulb
power connected to:
- Relay 4 Channel 5v (COM3)
- Relay 4 Channel 5v (COM4)
GND connected to:
- AC Source (-)
AC Source
+ connected to:
- Relay 4 Channel 5v (NO1)
- Relay 4 Channel 5v (NO2)
- Relay 4 Channel 5v (NO3)
- Relay 4 Channel 5v (NO4)
- connected to:
- Bulb (GND)
Socket
life connected to:
- Relay 4 Channel 5v (COM1)
- Relay 4 Channel 5v (COM2)
neutral connected to:
- AC Source (-)
- Bulb (GND)
Documented Code
No code is provided for this circuit.