Week 10 – Sara Al Mehairi

Concept

Credit: iStock

For this assignment, my goal was to create a miniature car sensor system using Arduino. The system uses ultrasonic sensors to detect objects/vehicles and provide feedback to the user using RGB LED, similar to the sensors used in modern cars for reversing or parking assistance. Components used include: Arduino Board, Breadboard, Ultrasonic Sensors, RGB LED, 330Ω Resistors, and Jumper Wires.

Overview

Ultrasonic sensors for linear position and distance measuring
Credit: Texas Instruments
if (distance <= 10) {
    //red
    analogWrite(redPin, 255);
    analogWrite(greenPin, 0);
    analogWrite(bluePin, 0);
  } else if (10 < distance && distance < 20) {
    //orange
    analogWrite(redPin, 255);
    analogWrite(greenPin, 50);
    analogWrite(bluePin, 0);
  } else {
    //green
    analogWrite(redPin, 0);
    analogWrite(greenPin, 255);
    analogWrite(bluePin, 0);
  }
  • Distance Measurement: With some googling, I learned that ultrasonic sensors emit high-frequency sound waves and measure the time it takes for the waves to bounce back after hitting an object. Based on this time measurement, the system calculates the distance to the obstacle.
  • Visual Feedback: The RGB LED is used to provide visual feedback to the user based on the distance readings from the sensors. The LED changes color to indicate the proximity.
  • Consistency: the Arduino continuously monitors the distance readings from the sensors & updates the LED color accordingly. In reality or with the vision I had in mind, this real-time feedback would help the driver to move the vehicle carefully, especially in tight spaces.

IMPLEMENTATION

As the vehicle/object moves, the ultrasonic sensors detect obstacles in the path and passes on distance measurements to the Arduino. The Arduino then processes the distance readings and controls the RGB LED to provide real-time visual feedback to the driver. This is possible thanks to the loop that continuously retrieves distance measurements & adjusts the LED colors accordingly. I also came across echoTime which represents the duration for which the ultrasonic sensor receives an echo signal after emitting a sound wave, pretty cool!
– Red: Stop the vehicle immediately.
– Orange: Proceed with caution, slowing down if necessary.
– Green: Continue driving as the path is clear.

Conclusion

Tiny but mighty, it was quite enjoyable to create this miniature system. Although I may have accidentally followed the description of next week’s assignment and realized it a few minutes ago, I learned a lot. As a driver, I understand the importance sensors play in parallel parking and avoiding hitting a curb. Therefore, I wanted to contribute to improving this aspect in terms of accuracy. After encountering some obstacles, I resorted to Core Electronics on YouTube as a guide for this assignment. Overall, I had hoped to attach the sensors to the front or rear bumper of an actual vehicle and test the accuracy, but step by step, I’ll hopefully create something greater!

Leave a Reply