Introduction: Rangefinder for Garage Parking With Arduino

This simple project will help you park your car in the garage by displaying the distance from objects in front of your car's bumper.
A 'Stop' message will tell you when it's time to stop.
The project is based on the usuals HC-SR04 or Parallax Ping))) (tm) ultrasonic rangefinders and an Arduino board.
I used the Leonardo but it should work on any other original or compatible board.

For the display I chose a matrix version for its size and for aesthetic reasons.

Step 1: What You Need...

Picture of What You Need...

To build this project you need:

  1. An Arduino board:
    An original or compatible board should work as the code doesn't make use of specialized pins/function.
    You can find it everywhere on the internet or maybe you have one unused in a drawer in your lab.
  2. An HC-SR04 or Parallax Ping))) ultrasonic rangefinder:
    They are commonly used with Arduino projects so, probably, you already have it.
    Anyway here are some links:
    - Parallax Ping))) on Parallax
    - HC-SR04 on Sparkfun
    - Parallax Ping)) on Pololu
    - HC-SR04 search result from Ebay
  3. The Four matrix display:
    I bought it from IOTMODULES on Ebay: 4 Way MAX7219 DOT MATRIX
    In case the link doesn't work try contact them on their Ebay store.
  4. Soldering skills, of course :)

Step 2: Build the Project...

Picture of Build the Project...

Download the arduinorangefinder.pdf schematic diagram.
You can find attached also the HC-SR04 pdf and the ping))) pdf, only for your reference.

The electronic diagram is very simple, follow it exactly.
I suggest to extend the wirings for the display and sensor of about 1 meter (see image1) so you can place them more easily later.

In the image2 you can see how to solder the power supply pins for the display and sensor: +5V from the display and Vcc from the sensor needs to be soldered togheter.
Every other pin must have its own terminal.

Image5 is the Ping))) version of the project.

Go to the next step when ready...

Step 3: Arduino Code...

Picture of Arduino Code...

It's time to work on the Arduino side.

Download the attached fourMatrix-master library (please use this library also if you already have it installed, this one was edited to support more functionalities) and install it from the IDE (sketch->import library).

Now load the MeasureDistance.ino sketch and let's look into it, there are several lines you can edit:
the most important is the sensor type, uncomment only the line that match your sensor.

Then set the distances as you prefer, you can modify them later when the project will be in place.

With a little of work the code could display distances in Inches too, there is a sub ready for this.
Just recalculate distances from centimeters to inches and change these lines:

  ...  <br>  cm=pingIn(5);<br>  ...  <br>  m.printMsgToMatrix(Blank + String(LPcm) +"In ",0);  <br>  ...

Upload the code and check if all works.
If you get trouble please double check wirings and connections.

Step 4: The Project at Work...

Picture of The Project at Work...

Measure the height of the most prominent part of the bumper of your car from the floor.
Attach the sensor close to the wall, to the height you measured.

I used a polystyrene foam sheet in which I made a slot for the sensor (see image).

Now place the display so you can see it from your car.

Try to enter by car and check the distances, adjust them in the Arduino code and reupload it if need.

Comments

ScottD172 (author)2017-08-10

HOW IN THE WORLD DID YOU FIND THAT LIBRARY?

Great work. Stupendous. I have been searching high and low for a library that can work with the 4 digits in a row. I did a nice scrolling clock but had to cut them apart and rotate them 90 degrees each. NOBODY seemed to have a library that could drive that 8x32 (4-module) unit. And they do not cut apart easily.

So EXCELLENT WORK!

AppsByDavideV (author)ScottD1722017-08-11

Hi ScottD172,

thank you :)
But i must say this library is not mine. I just sligtly modified it for my needs.

Credits to:
Iotmodules https://github.com/iotmodules/fourMatrix

hs3xha (author)2016-12-18

Thank you.

andhikategas (author)2016-11-24

If i want to change the matrix display with lcd display, is it still working ? and what about the source code . thx

Hi,

of couse you can use an LCD modifying the code. The goal of the matrix was to read it at an higher distance (few meters).
At this moment i haven't an LCD to develop the new code but it should be simple with a little of programming skill.
Just send the measure referring the LCD library and connect the LCD following examples on internet.

Bye

JoeP151 (author)2016-11-22

The wife NEEDS this!

Jdukate (author)2016-11-15

This is awesome great project!!!

AppsByDavideV (author)Jdukate2016-11-15

Hi Jdukate, thanks :)

About This Instructable

4,672views

119favorites

License:

Bio: I like to develop android apps and electronics devices that can be controlled by that apps. My first pc was a commodore VIC20 hacked to ... More »
More by AppsByDavideV:Rangefinder for Garage Parking With ArduinoAndroid personal Home ServerArduino 4WD Rover Bluetooth Controlled by Android Phone/tablet
Add instructable to: