This project is a simple but effective car parking sensor system built using an Arduino board, an ultrasonic distance sensor, a buzzer, and an RGB LED. The sensor continuously measures the distance to the nearest object (e.g., a wall or another car) and provides both auditory and visual feedback to help with parking.
- Real-time distance measurement using an ultrasonic sensor
- Variable-pitch sound alerts via a buzzer (higher pitch = closer object)
- RGB LED status indication:
- π΄ Red: Object very close (under 20cm)
- π‘ Yellow: Caution zone (20β50cm)
- π’ Green: Safe distance (50β100cm)
- π΅ Blue: No object detected / out of range
- Arduino Uno
- Ultrasonic sensor (HC-SR04)
- Passive buzzer
- RGB LED (common cathode)
- The ultrasonic sensor (HC-SR04) is connected to digital pins
6(trigger) and5(echo). - The buzzer is connected to digital pin
7. - The RGB LED is connected to PWM-enabled pins
9(Red),10(Green), and11(Blue). - The sensor reads distance in centimeters.
- If the distance is greater than 100cm, the LED turns blue and no sound is emitted.
- If the object is within 100cm, the buzzer emits a beep with a frequency that increases as the object gets closer.
- The RGB LED color reflects the distance range.
