Arduino and ESP32-Based Smart Garden System with Soil Moisture and Environmental Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes various sensors, actuators, and microcontrollers. The circuit is designed to interface with multiple components such as a color light-to-digital converter, DC motors, a BME/BMP280 sensor, an ESP32 Devkit, and an Arduino UNO. The document includes a component list, wiring details, and the embedded code used in the microcontrollers.
Component List
TCS3472 COLOR LIGHT-TO-DIGITAL CONVERTER with IR FILTER
- Pins: LED, INT, SDA, SCL, 3V3, GND, VIN
- Description: A sensor that converts light to digital values, including an IR filter.
DC Motor
- Pins: pin 1, pin 2
- Description: A simple DC motor for mechanical movement.
BME/BMP280
- Pins: GND, SCL, SDA, VIN
- Description: A sensor for measuring temperature, humidity, and pressure.
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 development board for the ESP32 microcontroller.
MG996R
- Pins: GND, VCC, SIG
- Description: A high-torque servo motor.
Water Sensor
- Pins: -, +
- Description: A sensor for detecting the presence of water.
L298N DC Motor Driver
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
- Description: A dual H-bridge motor driver for controlling DC motors.
Adafruit TCA9548A
- Pins: 2SDA, 2SCL, 3SDA, 3SCL, 4SDA, 4SCL, 5SDA, 5SCL, 6SDA, 6SCL, 7SDA, 7SCL, VCC, GND, INPUTSDA, INPUTSCL, RESET, A0, A1, A2, 0SDA, 0SCL, 1SDA, 1SCL
- Description: An I2C multiplexer for expanding I2C bus capabilities.
Soil Moisture Interceptor
- Pins: AO, DO, GND, VCC
- Description: A sensor for measuring soil moisture levels.
Arduino UNO
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
- Description: A popular microcontroller board based on the ATmega328P.
Rocker Switch
- Pins: 1, 2
- Description: A simple on/off switch.
12v5ah Battery
- Pins: 12v +, 12v -
- Description: A 12V, 5Ah battery for powering the circuit.
Wiring Details
TCS3472 COLOR LIGHT-TO-DIGITAL CONVERTER with IR FILTER
- VIN: Connected to Arduino UNO Vin
- SDA: Connected to Adafruit TCA9548A 0SDA
- SCL: Connected to Adafruit TCA9548A 0SCL
DC Motor
- pin 1: Connected to L298N DC motor driver OUT2
- pin 2: Connected to L298N DC motor driver OUT1
DC Motor
- pin 1: Connected to L298N DC motor driver OUT4
- pin 2: Connected to L298N DC motor driver OUT3
BME/BMP280
- VIN: Connected to Adafruit TCA9548A VCC
- SCL: Connected to Adafruit TCA9548A 2SCL
- SDA: Connected to Adafruit TCA9548A 2SDA
ESP32 Devkit V1
- RX2: Connected to Arduino UNO D3
- TX2: Connected to Arduino UNO D2
MG996R
- SIG: Connected to Arduino UNO D11
MG996R
- SIG: Connected to Arduino UNO D10
MG996R
- SIG: Connected to Arduino UNO D9
MG996R
- SIG: Connected to Arduino UNO D6
MG996R
- SIG: Connected to Arduino UNO D5
Water Sensor
- -: Connected to Soil Moisture Interceptor GND
- +: Connected to Soil Moisture Interceptor VCC
L298N DC Motor Driver
- ENA: Connected to Adafruit TCA9548A VCC
- ENB: Connected to Adafruit TCA9548A VCC
- 5V: Connected to Adafruit TCA9548A VCC
- IN4: Connected to Arduino UNO D13
- IN3: Connected to Arduino UNO D12
- IN2: Connected to Arduino UNO D8
- IN1: Connected to Arduino UNO D7
- 12V: Connected to Rocker Switch pin 1
- OUT1: Connected to DC Motor pin 2
- OUT2: Connected to DC Motor pin 1
- OUT3: Connected to DC Motor pin 2
- OUT4: Connected to DC Motor pin 1
Adafruit TCA9548A
- INPUTSCL: Connected to Arduino UNO SCL
- INPUTSDA: Connected to Arduino UNO SDA
- 0SDA: Connected to TCS3472 COLOR LIGHT-TO-DIGITAL CONVERTER with IR FILTER SDA
- 0SCL: Connected to TCS3472 COLOR LIGHT-TO-DIGITAL CONVERTER with IR FILTER SCL
- 1SDA: Connected to TCS3472 COLOR LIGHT-TO-DIGITAL CONVERTER with IR FILTER SDA
- 1SCL: Connected to TCS3472 COLOR LIGHT-TO-DIGITAL CONVERTER with IR FILTER SCL
- 2SCL: Connected to BME/BMP280 SCL
- 2SDA: Connected to BME/BMP280 SDA
Soil Moisture Interceptor
- VCC: Connected to Arduino UNO 5V
- AO: Connected to Arduino UNO A0
Arduino UNO
- 5V: Connected to Soil Moisture Interceptor VCC
- Vin: Connected to TCS3472 COLOR LIGHT-TO-DIGITAL CONVERTER with IR FILTER VIN
- A0: Connected to Soil Moisture Interceptor AO
- SCL: Connected to Adafruit TCA9548A INPUTSCL
- SDA: Connected to Adafruit TCA9548A INPUTSDA
- D13: Connected to L298N DC motor driver IN4
- D12: Connected to L298N DC motor driver IN3
- D11: Connected to MG996R SIG
- D10: Connected to MG996R SIG
- D9: Connected to MG996R SIG
- D8: Connected to L298N DC motor driver IN2
- D7: Connected to L298N DC motor driver IN1
- D6: Connected to MG996R SIG
- D5: Connected to MG996R SIG
- D3: Connected to ESP32 Devkit V1 RX2
- D2: Connected to ESP32 Devkit V1 TX2
Rocker Switch
- pin 1: Connected to L298N DC motor driver 12V
- pin 2: Connected to 12v5ah Battery 12v +
12v5ah Battery
- 12v +: Connected to Rocker Switch pin 2
Code
Arduino UNO Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Documentation (documentation.txt)
This concludes the detailed documentation of the circuit, including the component list, wiring details, and embedded code.