This is a personal IoT project that monitors temperature, humidity, and air quality in real-time using an Arduino UNO R4 WiFi, a DHT11 sensor, and an MQ135 air quality sensor. The data is uploaded every 20 seconds to the cloud using ThingSpeak, where it is visualized with live charts.
Built as a personal project to apply embedded systems, cloud communication, and sensor data processing — ideal for smart climate education initiatives and IoT learning.
- Arduino UNO R4 WiFi
- DHT11 Temperature & Humidity Sensor
- MQ135 Air Quality Sensor
- Breadboard + Jumper Wires
- ThingSpeak (for cloud data storage and visualization)
- Reads temperature, humidity, and air quality every 15 seconds
- Wireless data upload to ThingSpeak using built-in WiFi
- View real-time graphs on a web dashboard
- Dynamic data visualization
- Auto-refreshing dashboard with historical tracking
This guide will walk you through setting up the Environmental Monitoring System using an Arduino UNO R4 WiFi, DHT11, and MQ135 sensors. The system uploads data to ThingSpeak and displays it in real-time charts.
Use the wiring diagram in this repo to connect your sensors to the Arduino UNO R4 WiFi:
| DHT11 Pin | Arduino UNO R4 WiFi |
|---|---|
| VCC | 5V |
| DATA | D2 |
| GND | GND |
| MQ135 Pin | Arduino UNO R4 WiFi |
|---|---|
| VCC | 5V |
| AOUT | A0 |
| GND | GND |
- Open the
iot_monitoring.inofile in the Arduino IDE - Select Arduino UNO R4 WiFi under
Tools > Board - Connect your board via USB-C
- Click Verify (✓) to compile
- Click Upload (→) to upload the code to your board
Edit the top of your .ino file and replace the placeholder values with your own credentials:
char ssid[] = "YOUR_WIFI_NAME";
char pass[] = "YOUR_WIFI_PASSWORD";
unsigned long channelID = YOUR_CHANNEL_ID; // e.g., 3008831
const char *writeKey = "YOUR_WRITE_API_KEY";You can find your Channel ID and Write API Key in the API Keys tab of your ThingSpeak dashboard.
- Go to
Tools > Serial Monitor - Set the baud rate to
115200 - Confirm that your device:
- Connects to Wi-Fi
- Reads temperature, humidity, and air quality
- Uploads data to ThingSpeak every 20 seconds
Sample output:
Connecting to Wi-Fi...
Connected! IP: 192.168.1.15
Temp: 24.5°C Humidity: 61.2% Air Quality: 408
Upload OK
Visit your live dashboard:
👉 https://thingspeak.mathworks.com/channels/3008831
Make sure your fields are labeled:
- Field 1: Temperature (°C)
- Field 2: Humidity (%)
- Field 3: Air Quality (Analog)
The graphs update automatically every 20 seconds with real-time data.
[View Real-Time Environmental Data on ThingSpeak] https://thingspeak.mathworks.com/channels/3008831
MIT License