I have looked around everywhere on the web and I could never find instructions to build a decent, easy and useful parking sensor for my car.
So I decided to make my own.
I made use of a Adafruit Pro Trinket 16mHz 5V for the reason it is supper small and its input voltage is perfect for working on a normal 12V car battery without the need of any additional power options or hardware, and also I have like 20 of them lying around. I then took a 16x2 LCD and added a I2C backpack to it to reduce the need of wires to talk to the LCD, If you do not have the back pack, no problem just wire the LCD normally and remove the back pack from the code and add your connections.
I also connected a Buzzer with a 150R Resistor to pin 12 of the Trinket.
Reality is that we do not always pay attention to our dash instruments and sometimes a loud beeping noise is more useful. Along with the buzzer I also programmed the LCD to switch its back light on and of in conjunction with the buzzer just to give it extra visual effect and also at the same time eliminating the need for a flashing LED.
The Ultrasonic Sensor SR-HC04 was placed inside a small Plastic enclosure and then screwed down onto the bottom of my bumper where it is out of sight, I parked my car close to a wall so I could measure the distance from the sensor pick up to the wall face just before my car bumper touched the wall, I then took this distance and added it to my sensors measurement to basically make the zero point or 0 cm at the point where the rear of the bumper ends. This gives me a good and accurate distance to measure objects from.
The Trinket has been programmed to display your distance on the LCD and it updates every second, when the sensor comes close to an object the LCD will flash a WARNING signal, and if you reach the limits of your bumper being save the buzzer will sound and the LCD back light will flash.
I placed the Trinket with the LCD and the back pack also in a nice smooth plastic enclosure that I mounted on my dash, using 4 core wire to connect to the sensor at the rear.
The connection to the battery of the car to power the unit I routed along with my ignition so that the trinket only powers up when the car is powered up.
If you do use my code just remember to download the library for the back pack from GitHub, it is called hd44780ioClass/hd44780_I2Cexp.h.
- Connect Buzzer positive to pin 12;
- Sensor trigger pin to pin 13;
- Sensor echo pin to pin 11;
I hope somebody finds this as useful as I did.