ESP32-Based Smart Agriculture System with LoRa Communication
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates various sensors and communication modules with an ESP32 Devkit V1 microcontroller to monitor soil conditions and communicate data. The sensors include a PH Meter, an NPK Soil Sensor (mini), and a Soil Moisture Sensor. Communication is facilitated by an EBYTE LoRa E220 module. A 12V Battery (mini) provides power, which is regulated by a Step Up Boost Power Converter to supply the necessary voltages to the components. The ESP32 Devkit V1 serves as the central processing unit, interfacing with the sensors and the LoRa module to process and transmit data.
Component List
ESP32 Devkit V1
- Microcontroller with WiFi and Bluetooth capabilities.
- Pins: 3V3, GND, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23, EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, VIN.
NPK Soil Sensor (mini)
- Sensor for measuring nitrogen, phosphorus, and potassium content in the soil.
- Pins: VCC, GND, A, B.
Soil Moisture Sensor
- Sensor for measuring the volumetric water content in the soil.
- Pins: RS485 - A, VCC, GND, RS485 - B.
PH Meter
- Sensor for measuring the acidity or alkalinity of the soil.
- Pins: Signal, VCC, GND.
EBYTE LoRa E220
- Long Range (LoRa) communication module for transmitting data over long distances.
- Pins: M0, M1, RXD, TXD, AUX, VCC, GND.
GND
- Common ground reference point for the circuit.
- Pins: GND.
12V Battery (mini)
- Power source for the circuit.
- Pins: -, +.
Step Up Boost Power Converter, Adjustable Voltage Regulator
- Module to step up the voltage from the battery to the required levels for the circuit components.
- Pins: VOUT+, VOUT-, VIN+, VIN-.
Wiring Details
ESP32 Devkit V1
- 3V3 connected to PH Meter VCC and EBYTE LoRa E220 VCC.
- GND connected to Step Up Boost Power Converter VOUT-.
- D15 connected to EBYTE LoRa E220 AUX.
- D2 connected to EBYTE LoRa E220 M1.
- D4 connected to EBYTE LoRa E220 M0.
- RX2 connected to EBYTE LoRa E220 RXD.
- TX2 connected to EBYTE LoRa E220 TXD.
- D18 connected to Soil Moisture Sensor RS485 - A.
- D19 connected to Soil Moisture Sensor RS485 - B.
- VP connected to PH Meter Signal.
- D34 connected to NPK Soil Sensor (mini) A.
- D35 connected to NPK Soil Sensor (mini) B.
- VIN connected to Step Up Boost Power Converter VOUT+.
NPK Soil Sensor (mini)
- VCC connected to 12V Battery (mini) - and Step Up Boost Power Converter VIN-.
- GND connected to common GND net.
- A connected to ESP32 Devkit V1 D34.
- B connected to ESP32 Devkit V1 D35.
Soil Moisture Sensor
- RS485 - A connected to ESP32 Devkit V1 D18.
- VCC connected to 12V Battery (mini) + and Step Up Boost Power Converter VIN+.
- GND connected to common GND net.
- RS485 - B connected to ESP32 Devkit V1 D19.
PH Meter
- Signal connected to ESP32 Devkit V1 VP.
- VCC connected to ESP32 Devkit V1 3V3.
- GND connected to common GND net.
EBYTE LoRa E220
- M0 connected to ESP32 Devkit V1 D4.
- M1 connected to ESP32 Devkit V1 D2.
- RXD connected to ESP32 Devkit V1 RX2.
- TXD connected to ESP32 Devkit V1 TX2.
- AUX connected to ESP32 Devkit V1 D15.
- VCC connected to ESP32 Devkit V1 3V3.
- GND connected to common GND net.
12V Battery (mini)
-
- connected to NPK Soil Sensor (mini) VCC and Step Up Boost Power Converter VIN-.
-
- connected to Soil Moisture Sensor VCC and Step Up Boost Power Converter VIN+.
Step Up Boost Power Converter, Adjustable Voltage Regulator
- VOUT+ connected to ESP32 Devkit V1 VIN.
- VOUT- connected to ESP32 Devkit V1 GND.
- VIN+ connected to 12V Battery (mini) + and Soil Moisture Sensor VCC.
- VIN- connected to 12V Battery (mini) - and NPK Soil Sensor (mini) VCC.
GND (Common Ground Net)
- GND connected to PH Meter GND, NPK Soil Sensor (mini) GND, EBYTE LoRa E220 GND, and Soil Moisture Sensor GND.
Documented Code
No code has been provided for the microcontroller. The documentation of the code would typically include details on initialization, main loop, interrupt service routines, and any functions for handling sensor data or communication protocols. Since no code is available, this section cannot be completed.