Switch a relay from a web page — a tiny 3.3 V signal controlling a much larger circuit.
Project_7_ESP32_Relay_Web_Server.ino, then open it in the Arduino IDE (setup: Project 0b). Needs the ESPAsyncWebServer + AsyncTCP libraries and your Wi‑Fi credentials.
A relay is an electrically‑operated switch. A small coil current (from an ESP32 GPIO) flips a mechanical contact, connecting or disconnecting a separate higher‑power circuit — the two sides electrically isolated.




This project uses the asynchronous server libraries — install both:
Add each via Sketch → Include Library → Add .ZIP Library…, then restart the IDE.

Set your Wi‑Fi credentials, upload, open Serial Monitor at 115200, press EN/RESET:
============================================== Project 7: ESP32 Relay Web Server ============================================== 2 relay(s), mode: Normally Open (NO) Relay #1 -> GPIO 26 Relay #2 -> GPIO 27 Connecting to Wi-Fi: MyNetwork .... Wi-Fi connected! Open this address in your browser: http://192.168.1.42 ---------------------------------------------- [WEB] Relay #1 -> ON
Open the address; flip a toggle → the relay clicks and the clean line above prints (the original sketch printed a cryptic NO 11).

| Symptom | Likely cause | Fix |
|---|---|---|
Compile error on ESPAsyncWebServer | Libraries missing | Install ESPAsyncWebServer and AsyncTCP |
| Relay clicks, load doesn't switch | Wired to NC | Use COM → NO |
| Toggle seems inverted | NO‑mode inversion (normal) | Leave the sketch as‑is |
| No click at all | IN mis‑wired / module unpowered | IN → GPIO 26/27; VCC→VIN, GND→GND |
| Stuck on "Connecting…" | Wrong credentials / 5 GHz | Fix credentials; use 2.4 GHz |