Arduino UNO Based Ultrasonic Distance Measurement with OLED Display and Alert System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit is designed around an Arduino UNO microcontroller and includes a variety of peripheral components. The peripherals include two HC-SR04 Ultrasonic Distance Sensors, a Piezo Buzzer, a red LED, and a 0.96" OLED display. The circuit is likely intended for distance measurement with visual feedback on the OLED display and auditory feedback via the Piezo Buzzer and LED indicator.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- Provides digital and analog I/O pins
- Powers and controls the peripheral components
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- Two instances of this sensor are used for distance measurement
- Each sensor has four pins: VCC, TRIG, ECHO, and GND
Piezo Buzzer
- An electromechanical component that produces sound
- Has two pins for electrical connection
LED: Two Pin (red)
- A simple red LED with an anode and cathode for indicating statuses
0.96" OLED
- A small display for visual output
- Communicates with the Arduino via I2C (SCK, SDA)
Wiring Details
Arduino UNO
- 3.3V connected to OLED VDD
- 5V connected to both HC-SR04 VCC pins
- GND connected to OLED GND, LED cathode, Piezo Buzzer pin 2, and both HC-SR04 GND pins
- A4 (SDA) connected to OLED SDA
- A5 (SCK) connected to OLED SCK
- D7 connected to LED anode
- D6 connected to Piezo Buzzer pin 1
- D5 connected to HC-SR04 ECHO (first sensor)
- D4 connected to HC-SR04 TRIG (first sensor)
- D3 connected to HC-SR04 ECHO (second sensor)
- D2 connected to HC-SR04 TRIG (second sensor)
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- VCC connected to Arduino 5V
- TRIG connected to Arduino D4 (first sensor) and D2 (second sensor)
- ECHO connected to Arduino D5 (first sensor) and D3 (second sensor)
- GND connected to Arduino GND
Piezo Buzzer
- Pin 1 connected to Arduino D6
- Pin 2 connected to Arduino GND
LED: Two Pin (red)
- Anode connected to Arduino D7
- Cathode connected to Arduino GND
0.96" OLED
- VDD connected to Arduino 3.3V
- GND connected to Arduino GND
- SCK connected to Arduino A5
- SDA connected to Arduino A4
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:
}
Additional Notes (documentation.txt)
No additional documentation was provided for the code.