Smart PIR Motion Light Control With WiFIRCard

by bruscreator in Circuits > Microcontrollers

510 Views, 1 Favorites, 0 Comments

Smart PIR Motion Light Control With WiFIRCard

pir_wifircard.PNG

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.

Supplies

wifircard.jpg

Hardware or Tools Needed:

  1. WiFIRCard
  2. PIR Motion Sensor
  3. Light Bulb with Holder
  4. Wires


Software Required:

  1. Arduino IDE

Wiring Connections

final_real_overview.PNG
wifircard_pir_interfacing.PNG
wifircard_relay_lightbulb_connection.PNG

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 :

WiFIRcard => PIR

5V ---> VCC

GP43 ---> OUT

GND ---> GND


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.

  1. Relay 1 -> NO1, C1, NC1
  2. Relay 2 -> NO2, C2, NC2

Installing Arduino IDE

arduino_ide.PNG

Go to Arduino Software Downloads.

Download the latest stable release (Arduino IDE 2.x) for your operating system.

Install it:

  1. Windows: Run the .exe installer.
  2. macOS: Drag the .app to Applications.
  3. Linux: Extract the .tar.xz file and run install.sh.


Adding ESP32 Boards in Arduino

file_preferences.png
preference_urladd.png
board_manager.jpg
esp32_board_install.png

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 ToolsBoardBoard Manager, search for esp32. Select “ESP32 by Espressif Systems” and click Install (or Update if prompted).

Once esp32 based boards installed, you can confirm by checking if various boards listed under ESP32 options as shown.


Coding and Testing

esp32_s3_board_select.png
esp_native_com.png
upload_code.png

Download or copy example provided to Arduino IDE. We have to select suitable board for WiFIRCard, so choose ESP32 S3 Dev Module.

Go to ToolsBoardESP32 ➜ choose ESP32S3 Dev Module


Now select suitable com port, here we have used native USB so you will get option as shown. Also, enable USB CDC on Boot to monitor any data over serial port. Keep rest default and click upload button to transfer code.

Working

Smart PIR Motion Light Control with WiFIRCard | ESP32-S3 DIY

Finally testing motion detect and switching light ON if activated else switch OFF light.