Temperature dashboard and relay control with ESP32
Read a DHT11 sensor, show temperature and humidity on your dashboard, and switch a relay from your phone.
You need: ESP32 dev board, DHT11 sensor, 1-channel relay module, jumper wires.
- In the dashboard, add a device and three keywords:
temp(float, sensor),hum(float, sensor) andrelay(bool, both). Copy the device API key. - In Arduino IDE install AetheriumIoT and DHT sensor library by Adafruit from the Library Manager.
- Wire DHT11 DATA to GPIO 4 and the relay IN pin to GPIO 26. Connect VCC and GND as marked on each module.
- Open File › Examples › AetheriumIoT › RelayAndSensor and fill in your WiFi name, password, API key and server address.
- Upload to the ESP32. Values appear on the dashboard every 5 seconds, and the relay follows the switch.
const char* WIFI_SSID = "YOUR_WIFI";
const char* WIFI_PASS = "YOUR_PASSWORD";
const char* API_KEY = "PASTE_DEVICE_API_KEY";
const char* SERVER = "your-server.com";