Objective
Build a Wi-Fi controller that shows temperature and humidity on an OLED and toggles a relay from a web page.
How it works
The ESP32 joins your Wi-Fi and serves a small web page. Pressing the button on the page sends a request that flips the relay. The DHT22 is polled every 2 s and the readings are shown on the OLED and the page.
Components you'll need
| Component | Qty | Availability | Price | |
|---|---|---|---|---|
ESP32 DevKit V1 | ×1 | In stock | $8.12 | |
DHT22 Temperature & Humidity Sensor | ×1 | In stock | $2.73 | |
| 1-Channel Relay Module | ×1 | In stock | $0.79 | |
0.96" OLED Display (I2C) | ×1 | In stock | $3.99 | |
| Jumper Wire Set (120 pcs) | ×1 | In stock | $2.99 | |
Breadboard medium | ×1 | In stock | $0.99 | |
| Bought one by one | $19.61 | |||
All of these come in IoT Kit (ESP32).
Circuit & connections
The full wiring diagram and pin-by-pin connections.
Code
The complete, tested sketch (18 lines), ready to upload.
Step-by-step instructions
4 illustrated steps:
- 1Set up the IDE
- 2Breadboard the circuit
- 3Flash and find the IP
- 4Control it
Troubleshooting
Fixes for the problems makers hit most often on this build.




