A simple IoT temperature and humidity sensor based on ESP32-C3 and DHT11.
The device measures temperature and humidity, sends the data to a backend server, and from there it can be forwarded, for example, to a Telegram bot.
- Reads temperature and humidity from the DHT11 sensor
- Connects to Wi-Fi using WiFiManager (automatic configurator)
- Sends data to a server via HTTPS (with
X-Api-KeyandX-Device-Idheaders) - LED indicator while sending data
- Serial Monitor logging for debugging
- ESP32-C3 (ESP8266/ESP32 can also be used with minor pin adjustments)
- DHT11 sensor (can be replaced with DHT22 for better accuracy)
- LED indicator (
LED_PIN)
- Install required libraries in Arduino IDE / PlatformIO:
DHT sensor libraryWiFiManagerWiFiClientSecureHTTPClient
- Set your values in the code:
#define API_KEY "your_api_key" #define DEVICE_ID "your_device_id"
- Flash the firmware to the ESP32-C3.
- On the first run, the device will create an access point ESP32_AP with password 12345678 — connect and configure your Wi-Fi credentials.
-
ESP32 connects to Wi-Fi.
-
Every 30 seconds, it reads data from the DHT11.
-
Data is sent to the server via a POST request in JSON format:
{
"deviceId": "xxxx-xxxx-xxxx-xxxx",
"temperature": 24.5,
"humidity": 55.0
}The backend receives the data and forwards it to a Telegram bot, so you can easily check the temperature and humidity in your room.

