Ever fumbled for the light switch in the dark? With a PIR sensor and WiFIRCard — a tiny ESP32-S3 board with Wi-Fi, IR, and dual onboard relays — you can make your lights smart enough to switch on when you enter and off when you leave.
Its compact, credit-card size design makes it easy to drop into any DIY project, while built-in relays let you control appliances directly without extra modules. Simple, power-saving, and a fun way to explore home automation.
Wiring Connections :We have to connect PIR motion sensor with board using GPIO and power pins. Also connect load like light bulb which we are interested to operate based on motion, you can change as per your applications. Follow below wiring connections,
1)Wiring connection for PIR Interfacing with WiFIRcard :
2)Wiring connection of Bulb/Load :For this connection you can use any one relay channel from two options available. For each relay there are three pins NO (Normally OPEN), NC (Normally CLOSED) and C (COMMON) for wiring electrical device.Relay 1 -> NO1, C1, NC1Relay 2 -> NO2, C2, NC2
WARNING:Electrical wiring should be installed or serviced only by a qualified professional. Improper handling may result in shock, fire, or injury.
Go to Arduino Software Downloads.
Download the latest stable release (Arduino IDE 2.x) for your operating system.
Install it:
- Windows: Run the
.exe
installer. - macOS: Drag the
.app
to Applications. - Linux: Extract the
.tar.xz
file and runinstall.sh
.
Open Arduino IDE → File ➜ Preferences (Windows/Linux) or Arduino IDE ➜ Preferences (macOS).
In “Additional Board Manager URLs”, paste:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
(If other URLs exist, separate them with a comma.)
Go to Tools ➜ Board ➜ Board ManagerSearch for esp32. Select “ESP32 by Espressif Systems” and click Install (or Update if prompted).
Now, esp32 based boards installed. For confirmation we can check various ESP32 boards as below,
Download or copy example provided in code section to Arduino IDE. We have to select suitable board for WiFIRCard, so choose ESP32 S3 Dev Module.Go to Tools ➜ Board ➜ ESP32 ➜ choose ESP32S3 Dev Module
Now select suitable com port, here we have used native USB so you will get option as shown below. Also, enable USB CDC on Boot to monitor any data over serial port. Keep rest default and click upload button to transfer code.
Finally testing motion detect and switching light ON if activated else switch OFF light.
Comments