Arduino Nano-Controlled Water Detection System with Servo Alert and Buzzer
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit is designed to interface a micro servo, a water sensor, and a buzzer with an Arduino Nano microcontroller. The system is powered by a 9V battery, which is controlled by an SPST rocker switch to turn the power supply on and off. The micro servo is controlled by the Arduino through a PWM signal, the water sensor provides input to the Arduino, and the buzzer is used for audible alerts. The circuit is intended for applications where water detection is critical, and an immediate response is required, such as a simple water level alarm system.
Component List
Micro servo 9G
- Description: A small and lightweight servo motor for precise angular movement.
- Pins: GND, +5V, PWM
Arduino Nano
- Description: A compact microcontroller board based on the ATmega328P, suitable for embedding into projects.
- Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
Water Sensor
- Description: A sensor for detecting the presence of water through electrical conductivity.
- Pins: Signal, VCC, GND
Buzzer
- Description: An electronic buzzer for generating audible alerts.
- Pins: PIN, GND
9V Battery
- Description: A standard 9V battery to provide power to the circuit.
- Pins: +, -
Rocker Switch (SPST)
- Description: A single-pole single-throw rocker switch to control the power supply.
- Pins: 1, 2
Wiring Details
Micro servo 9G
- GND connected to Arduino Nano GND
- +5V connected to Arduino Nano 5V
- PWM connected to Arduino Nano D10
Arduino Nano
- GND connected to Micro servo GND, Water sensor GND, Buzzer GND, and 9V battery -
- 5V connected to Micro servo +5V and Water sensor VCC
- D10 connected to Micro servo PWM
- D4 connected to Buzzer PIN
- D9 connected to Water sensor Signal
- VIN connected to Rocker Switch pin 1
Water Sensor
- Signal connected to Arduino Nano D9
- VCC connected to Arduino Nano 5V
- GND connected to Arduino Nano GND
Buzzer
- PIN connected to Arduino Nano D4
- GND connected to Arduino Nano GND
9V Battery
-
- connected to Rocker Switch pin 2
-
- connected to Arduino Nano GND
Rocker Switch (SPST)
- Pin 1 connected to Arduino Nano VIN
- Pin 2 connected to 9V battery +
Documented Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
The provided code is a template for the Arduino Nano and does not contain any functional code. The setup() function is intended to contain initialization code that runs once when the microcontroller is powered on or reset. The loop() function is intended to contain the main logic of the program, which runs repeatedly as long as the microcontroller is powered.
To complete this circuit's functionality, the user would need to add code to read the water sensor's signal in the loop() function, control the servo motor by sending PWM signals, and activate the buzzer under certain conditions (e.g., when water is detected by the sensor).