Circuit Documentation
Summary
This circuit is designed to interface various sensors, actuators, and modules with an Arduino UNO microcontroller. It includes servomotors, a DC motor driver connected to mini metal gear motors, an ultrasonic sensor, an IR sensor, a soil moisture sensor with a probe, a water pump, a relay module, and an ESP32 for potential wireless communication. The circuit is powered by a 12V battery, with voltage regulation provided by the Arduino UNO and the L298N motor driver module. The circuit appears to be designed for a system that requires motion control, distance sensing, soil moisture detection, and potentially remote communication or control.
Component List
Microcontrollers
- Arduino UNO: A microcontroller board based on the ATmega328P, commonly used for building digital devices and interactive objects that can sense and control objects in the physical world.
- ESP32 (30 pin): A microcontroller with Wi-Fi and Bluetooth capabilities, suitable for a wide variety of applications ranging from low-power sensor networks to more demanding tasks such as music streaming.
Sensors
- HC-SR04 Ultrasonic Sensor: A sensor that measures distance by emitting an ultrasonic wave and measuring the time taken for the echo to return.
- IR Sensor: An infrared sensor typically used for obstacle detection or line tracking.
- Soil Moisture Module: A sensor used to measure the moisture content in soil.
- YL-69 Sonda: A probe that works in conjunction with the soil moisture module to detect the presence of water in the soil.
Actuators
- DC Mini Metal Gear Motor: A small DC motor with a gearbox for increased torque.
- Servomotor SG90: A small and lightweight servo motor capable of precise control.
- 5v Mini Water Pump: A small pump used for moving water, typically used in DIY projects for irrigation or water features.
Power
- Battery 12V: A 12-volt battery that provides the main power source for the circuit.
Motor Driver
- L298N DC Motor Driver: A module that allows for the control of two DC motors or one stepper motor.
Relay
- 5v Relay: An electromechanical switch used to control a high power circuit with a low power signal.
Wiring Details
Arduino UNO
- 5V: Powers the servomotors, relay, ultrasonic sensor, IR sensor, and soil moisture module.
- GND: Common ground for all components.
- Vin: Connected to the 5V pin of the L298N motor driver for voltage regulation.
- Digital Pins (D0-D11): Various connections to sensors, relay, and motor driver for control signals.
- Analog Pin (A0): Reads the analog signal from the soil moisture module.
DC Mini Metal Gear Motors
- IN1/IN2: Controlled by the L298N motor driver to set the direction and speed of the motors.
Battery 12V
- +/-: Provides power to the L298N motor driver and indirectly to the Arduino through Vin.
L298N DC Motor Driver
- 5V: Regulated voltage output used to power the Arduino UNO.
- 12V: Input from the 12V battery to power the motors.
- GND: Common ground.
- IN1-IN4: Control inputs from the Arduino UNO to control motor direction.
- OUT1-OUT4: Outputs to the DC Mini Metal Gear Motors.
Servomotors SG90
- VCC: Powered by the 5V output from the Arduino UNO.
- GND: Common ground.
- SIG: Control signal from the Arduino UNO.
HC-SR04 Ultrasonic Sensor
- VCC: Powered by the 5V output from the Arduino UNO.
- GND: Common ground.
- ECHO/TRIG: Connected to the Arduino UNO for distance measurement.
IR Sensor
- VCC: Powered by the 5V output from the Arduino UNO.
- GND: Common ground.
- Out: Sends the detection signal to the Arduino UNO.
Soil Moisture Module and YL-69 Sonda
- VCC/Ground: Powered by the 5V output from the Arduino UNO.
- Analog: Sends the moisture level to the Arduino UNO.
5v Mini Water Pump
- Positive/Negative Pin: Controlled by the 5V relay to turn the pump on and off.
5v Relay
- VCC: Powered by the 5V output from the Arduino UNO.
- GND: Common ground.
- In: Control signal from the Arduino UNO.
- Common Terminal/Normally Open: Controls the power to the water pump.
ESP32 (30 pin)
- GND/Vin: Common ground and power from the Arduino UNO.
- TX0/RX0: Serial communication with the Arduino UNO.
Documented Code
Arduino UNO Code (sketch.ino)
void setup() {
}
void loop() {
}
Note: The provided code for the Arduino UNO is a template with empty setup and loop functions. To fully document the code, the specific functionalities and logic for sensor readings, motor control, and communication with the ESP32 would need to be implemented and described.
ESP32 Code
No code was provided for the ESP32 microcontroller.