Sensor Project - Reverse Proximity Sensor

Display installed and powered by vehicle
My sensor project makes use of the HC-SR04 ultrasonic distance sensor, an Arduino Uno, Arduino Nano and a 16x2 LCD display. The purpose of this project is to provide distance data to the driver when reversing and also warn them when they're getting dangerously close to an object with a series of different tones from the buzzer and a warning to stop on display. 

The Arduino Nano is dedicated to reading from the sensor and calculating the distance before sending it over a serial link to the Arduino Uno. The Uno is dedicated to controlling the display, buzzer and changing the bar graph. The original plan was to run multiple sensors from the Nano, however the sensors I ordered from AliExpress didn't arrive in time for testing but there is still plenty of room for expandability.

The display shows the distance reading as reported by the Arduino Nano, along with a basic bar graph with range between  140cm and 20cm. After 20cm it displays a warning instead of the graph.

The project is powered by the vehicle and will only power up when the key is turned.

YouTube Demonstration Video: https://www.youtube.com/watch?v=IuXHZJRR4Qs
Code for Arduino Uno: https://henry.otago.online/files/SensorProject/Code1.txt
Code for Arduino Nano:  https://henry.otago.online/files/SensorProject/Code2.txt
Fritzing Project:  https://henry.otago.online/files/SensorProject/SensorProject.fzz

Fritzing Breadboard Layout showing serial link between boards, USB power header, sensor, buzzer and LCD.

Fritzing Schematic Layout


My test vehicle! 1998 Subaru Forester S/20 - No modern accessories whatsoever.
Sensor mounted to towball cap on the rear of the Forester
The sensor is easily removed this way, as it's only attached to the cap of my towball. This also means I could potentially fit this to another vehicle with very little changes required.






Spliced connections for the sensor and power through Cat5e Ethernet Cable  






View from front of vehicle. Seats are down for visibility, excess cable could be routed nicely for a clean look.







Testing setup on driveway with pallet acting as wall/other vehicle







Verifying accuracy with a measuring tape






Spot on! Will have to remove 15mm from reported distance to account for the excess metal on the towbar. 






 
Making on-the-fly adjustments during testing. The buzzer was added during this stage.


Reflection!
Q: Where did you get the idea from?
A: Going through the contents of the SparkFun kit, checking out the various included sensors and going through the various possibilities of them. Talked with Peter during class time and decided on a multi-dimensional sensor system for my car. Unfortunately, the other sensors I ordered didn't arrive in time so had to make do with one.

Q: What was hard and easy?
A: It was relatively easy to get readings from the sensor, it was difficult to get my head around making the two Arduino boards to talk to one another over serial.

Q: Did you have enough time to finish?
A: Plenty of time, but I seem to wait until the last minute.

Q: What would you do differently next time? 
A: More sensors! Would probably make the buzzer a bit louder and make it so the system only engages when the vehicle is in reverse. If I were to make this a permanent addition to my vehicle I'd use a waterproof sensor, mount it inside the bumper and hide the Ethernet and Arduinos, showing only the display in dash.

Q: Could this project be extended?
A: Yep! The Nano is ready to be connected to four more sensors and the Uno can also be used to read from the sensors. Plenty more pins available for add-ons such as LEDs and inputs from the car itself.

Q: Did you have to learn anything new?
A: Absolutely! Leaned a lot about communicating between boards and updating information on the display. 

References:

Comments

Popular posts from this blog

LED Project - Das Blinkenlights