Arduino Nano-Based Dual Ultrasonic Sensor System with Battery-Powered Buzzer
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino Nano microcontroller interfacing with two HC-SR04 ultrasonic sensors, a piezo buzzer, a TP4056 battery charger, an LM340T5 7805 voltage regulator, a 18650 Li-Ion battery, and a toggle switch. The Arduino Nano is programmed to control the sensors and the buzzer. The TP4056 manages the charging of the 18650 Li-Ion battery, and the LM340T5 7805 regulates the voltage supplied to the Arduino Nano.
Component List
Arduino Nano
- Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
- 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
HC-SR04 Ultrasonic Sensor
- Description: A sensor used for measuring distance using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
Piezo Buzzer
- Description: A simple buzzer that can be used to produce sound.
- Pins: pin 1, pin 2
18650 Li-Ion Battery
- Description: A rechargeable lithium-ion battery.
- Pins: Positive, Negative
TP4056
- Description: A lithium battery charger module.
- Pins: OUT-, B-, B+, OUT+, IN-, IN+
LM340T5 7805
- Description: A voltage regulator that outputs a steady 5V.
- Pins: Vout, Vin, GND
Toggle Switch SPST
- Description: A single-pole single-throw switch used to control the circuit.
- Pins: L1, COM
Wiring Details
Arduino Nano
- D3 connected to ECHO of the first HC-SR04 Ultrasonic Sensor.
- D5 connected to TRIG of the first HC-SR04 Ultrasonic Sensor.
- D9 connected to pin 2 of the Piezo Buzzer.
- VIN connected to Vout of the LM340T5 7805.
- GND connected to:
- GND of the first HC-SR04 Ultrasonic Sensor.
- GND of the second HC-SR04 Ultrasonic Sensor.
- pin 1 of the Piezo Buzzer.
- OUT- of the TP4056.
- 5V connected to:
- VCC of the first HC-SR04 Ultrasonic Sensor.
- VCC of the second HC-SR04 Ultrasonic Sensor.
- A6 connected to TRIG of the second HC-SR04 Ultrasonic Sensor.
- A5 connected to ECHO of the second HC-SR04 Ultrasonic Sensor.
HC-SR04 Ultrasonic Sensor (First)
- ECHO connected to D3 of the Arduino Nano.
- TRIG connected to D5 of the Arduino Nano.
- GND connected to GND of the Arduino Nano.
- VCC connected to 5V of the Arduino Nano.
HC-SR04 Ultrasonic Sensor (Second)
- ECHO connected to A5 of the Arduino Nano.
- TRIG connected to A6 of the Arduino Nano.
- GND connected to GND of the Arduino Nano.
- VCC connected to 5V of the Arduino Nano.
Piezo Buzzer
- pin 2 connected to D9 of the Arduino Nano.
- pin 1 connected to GND of the Arduino Nano.
18650 Li-Ion Battery
- Positive connected to B+ of the TP4056.
- Negative connected to B- of the TP4056.
TP4056
- OUT- connected to GND of the Arduino Nano.
- OUT+ connected to L1 of the Toggle Switch.
- B+ connected to Positive of the 18650 Li-Ion Battery.
- B- connected to Negative of the 18650 Li-Ion Battery.
LM340T5 7805
- Vout connected to VIN of the Arduino Nano.
- Vin connected to COM of the Toggle Switch.
- GND connected to GND of the Arduino Nano.
Toggle Switch SPST
- L1 connected to OUT+ of the TP4056.
- COM connected to Vin of the LM340T5 7805.
Code Documentation
Arduino Nano Code
File Name: sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
File Name: documentation.txt
This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used in the Arduino Nano.