Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Smart Soil Monitoring System with ESP32 and Arduino Mega

View and Edit Project In Cirkit DesignerImage of Smart Soil Monitoring System with ESP32 and Arduino Mega

Circuit Documentation

Summary

This circuit integrates various sensors and modules with an Arduino Mega 2560 and an ESP32 Devkit V1. The sensors include an NPK Soil Sensor, Soil Moisture Interceptor, pH Meter, Water Sensor, and a 16X2 LCD for display. Additionally, a 4X4 Membrane Matrix Keypad is used for user input. The circuit is powered by a 12V power supply and includes a potentiometer for adjustable voltage.

Component List

  1. NPK Soil Sensor (mini)

    • Pins: VCC, GND, A, B
    • Description: Measures the nitrogen, phosphorus, and potassium levels in the soil.
  2. ESP32 Devkit V1

    • 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
    • Description: A microcontroller with Wi-Fi and Bluetooth capabilities.
  3. Arduino Mega 2560

    • Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, PWM pins, AREF, SDA, SCL
    • Description: A microcontroller board based on the ATmega2560.
  4. Soil Moisture Interceptor

    • Pins: AO, DO, GND, VCC
    • Description: Measures the moisture content in the soil.
  5. Water Sensor

    • Pins: -, +
    • Description: Detects the presence of water.
  6. pH Meter V1.1

    • Pins: DATA, VCC, GND
    • Description: Measures the pH level of a solution.
  7. 16X2 LCD

    • Pins: VSS, VDD, V0, RS, RW, E, D0-D7, A, K
    • Description: A 16x2 character LCD display.
  8. 4X4 Membrane Matrix Keypad

    • Pins: R1, R2, R3, R4, C1, C2, C3, C4
    • Description: A keypad with 4 rows and 4 columns for user input.
  9. Potentiometer

    • Pins: GND, Output, VCC
    • Description: A variable resistor used to adjust voltage.
  10. 12V Power Supply

    • Pins: +, -
    • Description: Provides 12V power to the circuit.
  11. Resistor

    • Pins: pin1, pin2
    • Description: A 20 Ohms resistor.
  12. RS-485 Module

    • Pins: VCC, B, A, GND, RO, RE, DE, DI
    • Description: A module for RS-485 communication.

Wiring Details

NPK Soil Sensor (mini)

ESP32 Devkit V1

Arduino Mega 2560

Soil Moisture Interceptor

Water Sensor

pH Meter V1.1

16X2 LCD

4X4 Membrane Matrix Keypad

Potentiometer

12V Power Supply

Resistor

RS-485 Module

Documented Code

Arduino Mega 2560 Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This code is a basic template for the Arduino Mega 2560. The setup() function is used to initialize any settings or configurations, and the loop() function contains the main code that runs repeatedly.