ESP32-WiFi-TempSensor-Network
This project implements a WiFi-based temperature and humidity monitoring network using ESP32 microcontrollers. It consists of an ESP32 Access Point (AP) that receives data from one or more ESP32 Stations (STA). The stations collect environmental data using DHT11 sensors and transmit it to the AP using UDP protocol.

Features
- ESP32 Access Point creation
- WiFi communication using UDP
- Temperature and humidity monitoring using DHT11 sensor
- Multiple station support
- RSSI (Received Signal Strength Indicator) reporting
- Static IP configuration
Hardware Requirements
- At least 2 ESP32 development boards (1 for AP, 1+ for STA)
- DHT11 temperature and humidity sensor(s) (one per STA)
- Appropriate power supply for each ESP32
Software Dependencies
- Arduino IDE
- ESP32 board support for Arduino
- WiFi library (built-in with ESP32 board support)
- WiFiUdp library (built-in with ESP32 board support)
- DHT sensor library
Installation
- Install the Arduino IDE and ESP32 board support.
- Install the required DHT sensor library.
- Clone this repository or download the source code.
- Open the
.ino
files in Arduino IDE.
Configuration
Access Point (AP) Configuration
const char *ssid = "ESP_AP01";
const char *password = "ESP123456789";
IPAddress localDevIP(192, 168, 6, 100);
IPAddress gateway(192, 168, 6, 1);
IPAddress subnet(255, 255, 255, 0);
unsigned int localUdpPort = 61500;
Station (STA) Configuration
const char* ssid = "ESP_AP01";
const char* password = "ESP123456789";
int numNode = 1;
float numPeriod = 10000;
IPAddress localDevIP(192, 168, 6, 101);
IPAddress remoteDevIP(192, 168, 6, 100);
IPAddress gateway(192, 168, 6, 1);
IPAddress subnet(255, 255, 255, 0);
unsigned int localUdpPort = 61501;
unsigned int remoteUdpPort = 61500;
Ensure that the SSID and password match between AP and STA. Adjust IP addresses and UDP ports as needed.
Usage
- Upload the AP code to one ESP32.
- Upload the STA code to one or more other ESP32s.
- Power on all devices.
- The AP will create a WiFi network, and the STAs will connect to it.
- STAs will send temperature and humidity data to the AP at regular intervals.
- Monitor the Serial output on both AP and STAs for debugging information.
The STA sends data to the AP in the following format:
n=1&Counter=1&Temperature=25.50&Humidity=60.00
Network Structure
- The AP creates a WiFi network with the configured SSID and password.
- Each STA connects to this network with a unique IP address.
- STAs send UDP packets to the AP’s IP address and port.
- The AP receives these packets and can process or forward the data as needed.
Contributing
Contributions to improve the project are welcome. Please feel free to submit a Pull Request.
Profile
Check out my GitHub profile: Esmail Sarhadi
Project Link
View this project on GitHub: ESP32-WiFi-TempSensor-Network
Donation
If you find this project helpful, consider making a donation:
License
This project is open-source and available under the MIT License.