ESP32-Based Environmental Monitoring System with DS18B20, TDS, PH, and DO Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes various sensors, a relay, a pilot lamp, an LCD display, and an ESP32 microcontroller. The circuit is designed to interface multiple sensors with the ESP32, which processes the data and controls the relay and the pilot lamp. The LCD display is used to show the sensor readings.
Component List
- DS18B20: Digital temperature sensor.
- TDS Sensor: Measures the total dissolved solids in water.
- Pilot Lamp Red: Indicates the status of the relay.
- ESP32 38 PINS: Microcontroller with Wi-Fi and Bluetooth capabilities.
- Do Sensor: Measures dissolved oxygen in water.
- DC Power Source: Provides power to the circuit.
- PH Meter: Measures the pH level of a solution.
- 5v Relay: Controls the switching of high-power devices.
- Lcd 20x4 i2c: Displays information in a 20x4 character format.
Wiring Details
DS18B20
- signal: Connected to ESP32 pin 17/TX2
- GND: Connected to the common ground
- vcc: Connected to the common 5V power supply
TDS Sensor
- AI: Connected to ESP32 pin 32
- GND: Connected to the common ground
- 5V: Connected to the common 5V power supply
Pilot Lamp Red
- X1: Connected to the ground of the DC Power Source
- X2: Connected to the Normally Open pin of the 5v relay
ESP32 38 PINS
- GND: Connected to the common ground
- 5V/VIN: Connected to the common 5V power supply
- 17/TX2: Connected to DS18B20 signal pin
- 32: Connected to TDS Sensor AI pin
- 35: Connected to Do Sensor Out pin
- 34: Connected to PH Meter Signal pin
- 5: Connected to 5v relay In pin
- 22/SCL: Connected to Lcd 20x4 i2c SCL pin
- 21/SDA: Connected to Lcd 20x4 i2c SCA pin
Do Sensor
- Vcc: Connected to the common 5V power supply
- Gnd: Connected to the common ground
- Out: Connected to ESP32 pin 35
DC Power Source
- Ground: Connected to the common ground
- Positive: Connected to the common 5V power supply and the Common terminal of the 5v relay
PH Meter
- Signal: Connected to ESP32 pin 34
- VCC: Connected to the common 5V power supply
- GND: Connected to the common ground
5v Relay
- Normally Open: Connected to Pilot Lamp Red X2 pin
- Common terminal: Connected to the Positive pin of the DC Power Source
- Normally Closed: Not used
- In: Connected to ESP32 pin 5
- GND: Connected to the common ground
- VCC: Connected to the common 5V power supply
Lcd 20x4 i2c
- GND: Connected to the common ground
- 5v: Connected to the common 5V power supply
- SCA: Connected to ESP32 pin 21/SDA
- SCL: Connected to ESP32 pin 22/SCL
Documented Code
Do Sensor Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
5v Relay Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This documentation provides a comprehensive overview of the circuit, including the components used, their wiring details, and the code for the microcontrollers.