Arduino UNO Based Ultrasonic Distance Measurement with Buzzer Alert
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates an Arduino UNO microcontroller with a buzzer and an HC-SR04 ultrasonic sensor. The Arduino UNO serves as the central processing unit, controlling the buzzer and reading distance measurements from the ultrasonic sensor. The buzzer is used as an output device to provide audible feedback, while the HC-SR04 is used to measure distances via ultrasonic waves.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.
Buzzer
- Description: An electromechanical component that produces sound.
- Pins: POSITIVE, NEGATIVE.
HC-SR04 Ultrasonic Sensor
- Description: A sensor that measures distance by emitting ultrasonic waves and measuring the time taken for the echo to return.
- Pins: VCC, TRIG, ECHO, GND.
Wiring Details
Arduino UNO
- 5V connected to HC-SR04 VCC.
- GND connected to HC-SR04 GND and Buzzer NEGATIVE.
- D4 connected to Buzzer POSITIVE.
- D3 connected to HC-SR04 ECHO.
- D2 connected to HC-SR04 TRIG.
Buzzer
- POSITIVE connected to Arduino UNO D4.
- NEGATIVE connected to Arduino UNO GND.
HC-SR04 Ultrasonic Sensor
- VCC connected to Arduino UNO 5V.
- TRIG connected to Arduino UNO D2.
- ECHO connected to Arduino UNO D3.
- GND connected to Arduino UNO GND.
Documented 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:
}
Note: The provided code is a template and does not include specific functionality. It should be populated with the setup and loop functions to initialize the pins and implement the desired behavior for the buzzer and ultrasonic sensor.