Arduino Nano-Controlled Ultrasonic Sensing and Water Pump Activation System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates various components controlled by an Arduino Nano microcontroller to interface with ultrasonic sensors, relay modules, current sensors, and mini water pumps. The ultrasonic sensors are used for distance measurement, while the relay modules control the power to the mini water pumps. The ACS712 current sensors monitor the current flow to the pumps. The Arduino Nano serves as the central processing unit, managing the inputs and outputs of the circuit.
Component List
- Arduino Nano: A compact microcontroller board based on the ATmega328P, featuring digital and analog I/O pins.
- Ultrasonic Sensor (x2): Sensors that measure distance by emitting ultrasonic waves and timing the echo received.
- 5v Relay (x2): Electromechanical switches that allow a low-power signal to control a higher power circuit, typically used for switching on/off devices.
- ACS712 Current Sensor 5A 20A 30A (x2): Hall-effect-based linear current sensors that provide voltage output proportional to the sensed current.
- 5v Mini Water Pump (x2): Small pumps that operate at 5 volts, suitable for moving water in small-scale applications.
Wiring Details
Arduino Nano
- 5V: Powers the VCC pins of ultrasonic sensors, relay modules, and current sensors.
- GND: Common ground for ultrasonic sensors, relay modules, current sensors, and mini water pumps.
- D11/MOSI: Connected to the Trigger pin of the first ultrasonic sensor.
- D12/MISO: Connected to the Echo pin of the first ultrasonic sensor.
- D9: Connected to the Trigger pin of the second ultrasonic sensor.
- D10: Connected to the Echo pin of the second ultrasonic sensor.
- D8: Controls the "In" pin of the first relay module.
- D7: Controls the "In" pin of the second relay module.
- A1: Reads the output from the first ACS712 current sensor.
- A0: Reads the output from the second ACS712 current sensor.
Ultrasonic Sensors
- +VCC: Powered by the Arduino Nano 5V pin.
- Trigger: One sensor's Trigger pin is connected to D11/MOSI, and the other to D9 on the Arduino Nano.
- Echo: One sensor's Echo pin is connected to D12/MISO, and the other to D10 on the Arduino Nano.
- GND: Common ground with the Arduino Nano.
5v Relay Modules
- VCC: Powered by the Arduino Nano 5V pin.
- GND: Common ground with the Arduino Nano.
- In: One relay's In pin is controlled by D8, and the other by D7 on the Arduino Nano.
- Normally Open: One relay's Normally Open pin is connected to a mini water pump's positive pin, and the other relay similarly to the other pump.
- Common Terminal: One relay's Common Terminal is connected to the second pin of the first ACS712 current sensor, and the other relay to the second pin of the second ACS712 current sensor.
ACS712 Current Sensors
- VCC: Powered by the Arduino Nano 5V pin.
- GND: Common ground with the Arduino Nano.
- OUT: One sensor's OUT pin is connected to A1, and the other to A0 on the Arduino Nano.
- 1: Powered by the Arduino Nano 5V pin.
- 2: One sensor's second pin is connected to the Common Terminal of the first relay, and the other sensor's second pin to the Common Terminal of the second relay.
5v Mini Water Pumps
- Positive Pin: One pump's positive pin is connected to the Normally Open pin of the first relay, and the other pump's positive pin to the Normally Open pin of the second relay.
- Negative Pin: Common ground with the Arduino Nano.
Documented Code
Arduino Nano Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The provided code is a template and does not contain any functional implementation. It needs to be populated with the logic to control the ultrasonic sensors, relay modules, and read from the current sensors.