Raspberry Pi 4B Ultrasonic Distance Sensor with LED Indicators and Buzzer
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves a Raspberry Pi 4B controlling three LEDs (red, green, and yellow), a piezo buzzer, and an HC-SR04 ultrasonic sensor. The Raspberry Pi is used to drive the LEDs and the buzzer, and to interface with the ultrasonic sensor for distance measurement.
Component List
LED: Two Pin (red)
- Pins: cathode, anode
- Description: A red LED used for visual indication.
LED: Two Pin (green)
- Pins: cathode, anode
- Description: A green LED used for visual indication.
LED: Two Pin (yellow)
- Pins: cathode, anode
- Description: A yellow LED used for visual indication.
HC-SR04 Ultrasonic Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: An ultrasonic sensor used for distance measurement.
Raspberry Pi 4B
- Pins: 3V3, 5V, GPIO2, GPIO3, GND, GPIO4, GPIO14, GPIO15, GPIO17, GPIO18, GPIO27, GPIO22, GPIO23, GPIO24, GPIO10, GPIO9, GPIO25, GPIO11, GPIO8, GPIO7, ID_SD, GPIO5, GPIO6, GPIO12, GPIO13, GPIO19, GPIO16, GPIO26, GPIO20, GPIO21, ID_SC, TR01_TAP, TR00_TAP, TR03_TAP, TR02_TAP, RUN, GLOBAL_EN
- Description: A single-board computer used to control the LEDs, buzzer, and interface with the ultrasonic sensor.
Piezo Buzzer
- Pins: pin 1, pin 2
- Description: A piezoelectric buzzer used for sound indication.
Wiring Details
LED: Two Pin (red)
- Anode: Connected to Raspberry Pi 4B GPIO21
- Cathode: Connected to Raspberry Pi 4B GND
LED: Two Pin (green)
- Anode: Connected to Raspberry Pi 4B GPIO16
- Cathode: Connected to Raspberry Pi 4B GND
LED: Two Pin (yellow)
- Anode: Connected to Raspberry Pi 4B GPIO20
- Cathode: Connected to Raspberry Pi 4B GND
HC-SR04 Ultrasonic Sensor
- VCC: Connected to Raspberry Pi 4B 5V
- TRIG: Connected to Raspberry Pi 4B GPIO23
- ECHO: Connected to Raspberry Pi 4B GPIO24
- GND: Connected to Raspberry Pi 4B GND
Raspberry Pi 4B
- GPIO16: Connected to LED (green) anode
- GPIO20: Connected to LED (yellow) anode
- GPIO21: Connected to LED (red) anode
- GPIO18: Connected to Piezo Buzzer pin 1
- GND: Connected to LED (red) cathode, LED (green) cathode, LED (yellow) cathode, Piezo Buzzer pin 2, and HC-SR04 Ultrasonic Sensor GND
- 5V: Connected to HC-SR04 Ultrasonic Sensor VCC
- GPIO23: Connected to HC-SR04 Ultrasonic Sensor TRIG
- GPIO24: Connected to HC-SR04 Ultrasonic Sensor ECHO
Piezo Buzzer
- Pin 1: Connected to Raspberry Pi 4B GPIO18
- Pin 2: Connected to Raspberry Pi 4B GND
Code
No code provided for this circuit.
This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and a section for code (if any). Each component is described with its connections to ensure clarity and ease of understanding.