Arduino UNO Based Ultrasonic Distance Measurement with Buzzer Alert
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit consists of an Arduino UNO microcontroller, an HC-SR04 Ultrasonic Sensor, and a buzzer. The Arduino UNO serves as the central processing unit, controlling the operations of the ultrasonic sensor and the buzzer. The HC-SR04 Ultrasonic Sensor is used to measure distance by emitting ultrasonic waves and receiving the echo. The buzzer is an output device that can provide audible feedback based on the sensor readings or other logic defined in the Arduino's code.
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.
HC-SR04 Ultrasonic Sensor
- Description: A sensor for measuring distance via ultrasonic sound waves.
- Pins: VCC, TRIG, ECHO, GND.
Buzzer
- Description: An electromechanical component that emits sound when powered.
- Pins: PIN, GND.
Wiring Details
Arduino UNO
- 5V connected to HC-SR04 VCC.
- GND connected to HC-SR04 GND and Buzzer GND.
- D2 connected to HC-SR04 TRIG.
- D6 connected to HC-SR04 ECHO.
- D8 connected to Buzzer PIN.
HC-SR04 Ultrasonic Sensor
- VCC connected to Arduino UNO 5V.
- TRIG connected to Arduino UNO D2.
- ECHO connected to Arduino UNO D6.
- GND connected to Arduino UNO GND.
Buzzer
- PIN connected to Arduino UNO D8.
- 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 contain any functional logic. It needs to be populated with the setup and loop functions to control the HC-SR04 Ultrasonic Sensor and the buzzer based on the sensor readings.