This project is a wireless data acquisition system that monitors water quality (pH) and environmental metrics (Temperature, Humidity, Pressure, Gas Resistance). It uses an ESP32 to read sensor data and transmits it over WiFi (TCP/IP) to a Python client script running on a computer.
- Microcontroller: ESP32 Development Board
- Environmental Sensor: BME680 (I2C)
- Liquid Sensor: Analog pH Sensor (Generic)
- Power: 3.3V / 5V source
| Sensor | ESP32 Pin | Note |
|---|---|---|
| BME680 SDA | GPIO 18 | I2C Data |
| BME680 SCL | GPIO 19 | I2C Clock |
| BME680 VCC | 3.3V | |
| BME680 GND | GND | |
| pH Signal | GPIO 34 | Analog Input (ADC1) |
| pH VCC/GND | 5V/GND | Check your specific sensor voltage |
Note: The pH sensor is connected to GPIO 34 because it is an input-only pin connected to ADC1, which is safe to use while WiFi is active.
- Open the
.inofile in Arduino IDE. - Install the required libraries via Library Manager:
Adafruit BME680 LibraryAdafruit Unified Sensor
- Important: Update the
ssidandpasswordvariables with your WiFi credentials. - Upload the code to your ESP32.
- Open the Serial Monitor (Baud 115200) to find the IP Address.
- Make sure you have Python installed.
- Open the Python script.
- Update the
ESP_IPvariable to match the IP address shown in the Arduino Serial Monitor. - Run the script:
python client.py
- The ESP32 connects to WiFi and starts a TCP Server on Port 80.
- It reads the pH voltage (calibrated with neutral/acid points) and BME680 data.
- The Python script connects to the ESP32 IP address.
- The ESP32 streams the formatted data string to the Python console every 2 seconds.