Arduino UNO Ultrasonic Distance Sensor with LED and Buzzer Alert System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, an HC-SR04 Ultrasonic Sensor, a green LED, and a buzzer. The circuit is designed to interface these components with the Arduino UNO, which controls their operation based on the provided embedded code.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
HC-SR04 Ultrasonic Sensor
- Description: A sensor used for measuring distance using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
LED: Two Pin (green)
- Description: A green light-emitting diode.
- Pins: cathode, anode
Buzzer
- Description: An audio signaling device.
- Pins: PIN, GND
Wiring Details
Arduino UNO
- 5V: Connected to VCC of HC-SR04 Ultrasonic Sensor
- GND: Connected to GND of HC-SR04 Ultrasonic Sensor, GND of buzzer, and cathode of LED
- D13: Connected to anode of LED
- D11: Connected to PIN of buzzer
- D10: Connected to ECHO of HC-SR04 Ultrasonic Sensor
- D9: Connected to TRIG of HC-SR04 Ultrasonic Sensor
HC-SR04 Ultrasonic Sensor
- VCC: Connected to 5V of Arduino UNO
- GND: Connected to GND of Arduino UNO
- TRIG: Connected to D9 of Arduino UNO
- ECHO: Connected to D10 of Arduino UNO
LED: Two Pin (green)
- cathode: Connected to GND of Arduino UNO
- anode: Connected to D13 of Arduino UNO
Buzzer
- PIN: Connected to D11 of Arduino UNO
- GND: Connected to GND of Arduino UNO
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is where you initialize your components and settings, and the loop() function is where the main logic of your program runs repeatedly.
This document provides a comprehensive overview of the circuit, including the components used, their wiring details, and the embedded code for the Arduino UNO.