This project implements a WiFi-based temperature and humidity monitoring system using an ESP32 microcontroller. It utilizes a DHT11 sensor for environmental measurements and communicates the data to a remote device using UDP protocol.
.ino
file in Arduino IDE.Before uploading the code, make sure to configure the following parameters:
const char* ssid = "name";
const char* password = "pass";
int numNode = 1;
float numPeriod = 3000;
IPAddress localDevIP(192, 168, 8, 110);
IPAddress remoteDevIP(192, 168, 8, 102);
IPAddress gateway(192, 168, 8, 1);
IPAddress subnet(255, 255, 255, 0);
unsigned int localUdpPort = 61500;
unsigned int remoteUdpPort = 61501;
The ESP32 sends data in the following format:
Node=1 & Counter=1 & Temperature=25.50 & Humidity=60.00 & RSSI=-70
Send a UDP packet containing a number (in milliseconds) to change the transmission interval. For example, sending “5000” will change the interval to 5 seconds.
Contributions to improve the project are welcome. Please feel free to submit a Pull Request.
Check out my GitHub profile: Esmail Sarhadi
View this project on GitHub: ESP32-WiFi-TempSensor
If you find this project helpful, consider making a donation:
This project is open-source and available under the MIT License.