this code is for Low Pressure Aeroponic system control code.This code can control DS18B20(water temp sensor), Analog TDS / EC Sensor, BMP280 (Air Environment Sensor), and 12v submersiable pump.For pump u need 5v relay module to connected with esp32. u need relay module
Note: This README was generated with the help of AI because English is not my first language.
An automated Low Pressure Aeroponics (LPA) control system built with an ESP32. This project manages a high-capacity (1100 L/H) water pump for a 50L mint cultivation box using precision interval timing, while continuously monitoring environmental sensors to ensure optimal growing conditions.
- Asynchronous Timing: Uses non-blocking
millis()logic to manage pump cycles and sensor polling simultaneously without freezing the microcontroller. - Automated Pump Cycle: Runs an optimized aeroponic misting schedule (30 seconds ON, 50 seconds OFF).
- Thermal Safety Override: Continuously monitors nutrient water temperature. If the water hits 35°C, the pump cycle is overridden and shut down to prevent root damage, automatically ignoring the standard DS18B20
85.00boot error. - TDS Compensation: Dynamically calculates Total Dissolved Solids (ppm) using the live water temperature to correct the analog EC sensor readings.
- Environmental Monitoring: Tracks air temperature and barometric pressure inside the growing environment.
- Microcontroller: ESP32 Development Board
- Pump: 12V DC Submersible Pump (1100 L/H)
- Relay: 1-Channel 5V Relay Module (Active-LOW)
- Sensors:
- DS18B20: Waterproof Digital Temperature Sensor (Water)
- Analog TDS/EC Sensor: (Nutrient Concentration)
- BMP280: I2C Barometric Pressure & Temperature Sensor (Air)
| Component | ESP32 Pin | Notes |
|---|---|---|
| Relay (Pump) | GPIO 26 |
Triggers on LOW signal |
| DS18B20 | GPIO 4 |
Requires a 4.7kΩ pull-up resistor |
| TDS Sensor | GPIO 32 |
Analog input |
| BMP280 SDA | GPIO 21 |
Standard I2C Data line |
| BMP280 SCL | GPIO 22 |
Standard I2C Clock line |
(Note: The BMP280 uses the I2C address 0x76 in this configuration).
Before uploading the code, ensure the following libraries are installed via the Arduino IDE Library Manager:
OneWire(by Paul Stoffregen)DallasTemperature(by Miles Burton)Adafruit BMP280 Library(by Adafruit)Adafruit Unified Sensor(by Adafruit)
- Wire the components according to the pin configuration table.
- Install the required libraries in the Arduino IDE.
- Upload the
.inosketch to your ESP32. - Open the Serial Monitor at 115200 baud to view live sensor telemetry and pump status logs.
- Current Version: Local autonomous control and serial monitoring.
- Next Phase: Integration with Firebase Realtime Database via Wi-Fi to allow for remote pump control and live cloud-based sensor dashboards.