Circuit Documentation
Summary of the Circuit
This circuit is designed to interface an HC-SR04 Ultrasonic Distance Sensor with an Arduino UNO microcontroller to measure distances. The distance readings can trigger an event that activates a Piezo Buzzer. The Arduino UNO is responsible for controlling the sensor and the buzzer, processing the distance measurements, and executing the embedded code to determine the buzzer's behavior.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Purpose: Acts as the central processing unit for the circuit, reading sensor data and controlling the buzzer.
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- Description: An ultrasonic sensor capable of measuring distance by emitting ultrasonic waves and measuring the time taken for the echo to return.
- Purpose: Measures the distance to an object and sends this information to the Arduino UNO.
Piezo Buzzer
- Description: An electronic device that emits a tone when voltage is applied.
- Purpose: Provides an audible alert when triggered by the Arduino UNO, based on the distance measured by the HC-SR04 sensor.
Wiring Details
Arduino UNO
- 5V connected to HC-SR04 VCC
- GND connected to HC-SR04 GND and Piezo Buzzer pin 2
- A0 connected to HC-SR04 TRIG
- A1 connected to HC-SR04 ECHO
- D9 connected to Piezo Buzzer pin 1
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- VCC connected to Arduino UNO 5V
- TRIG connected to Arduino UNO A0
- ECHO connected to Arduino UNO A1
- GND connected to Arduino UNO GND and Piezo Buzzer pin 2
Piezo Buzzer
- pin 1 connected to Arduino UNO D9
- pin 2 connected to Arduino UNO GND
Documented Code
void setup() {
}
void loop() {
}
File: sketch.ino
Note: The provided code is a template and does not include specific functionality. It needs to be completed with the logic for initializing the HC-SR04 sensor, reading distance values, and controlling the Piezo Buzzer based on the distance readings.