Arduino Reverse Obstacle Sensor for Cars




Introduction: Arduino Reverse Obstacle Sensor for Cars

This is an instructable for making your car reverse/backing/parking obstacle sensor. The full story in on my blog:

With this obstacle sensor, you can find out your car's distance to another car behind it while backing. You can get as close to another car as a foot with the help of the sensor, yet not hit the car while backing.

The distance to your obstacle is displayed on an LCD monitor in foot/inch, mm, and bar graph. You will also hear an audio alert. As you get closer to your obstacle the audio alert beeps more frequently.

Step 1: Step 1 Care for Principle of Operation?

As a physicist, I have to lecture on the principle of the sonic ranger a bit. It is a rather simple device, the small cousin of the police speed gun! The sonic ranger sends a few pulses of supersonic waves and waits for the waves to bounce back from an object in front of it. Once it detects the reflected sound, it knows how much time it took the waves to travel a round trip from the ranger to the obstacle and back. With speed of sound at around 340m/s, you can calculate the distance to an object. You can also find velocity if you measure distance at two consecutive times and do distance change over time. Bats use their sonic ranger to fly in pitch black caves or catch food! Mr. English also tried the same technique with no apparent training and failed miserably. One episode of Stan Lee's super heroes also featured a blind person using his tongue clicks to tell what's around! That's it for sonic ranger intro!

Step 2: Step 2 List of Parts

I've listed the parts here:

1. One arduino Duemilanove or UNO (many vendors sell this)
2. One Phi-1 shield kit for arduino
3. One RJ11 jack and breakout board. I made some breakout boards myself and used the RJ11 jack from the Phi-1 kit. But you can buy from sparkfun: Rj11 jack and RJ11 breakout board . You have to observe which pin is which with a multimeter.
4. One four-wire phone cable. Just go to a dollar store and make sure you're not getting two-wire cables.
5. One Ping or other ultrasonic sensor from parallax . Alternatively you can also buy this one from sparkfun . You will have to make sure you're connecting the PWM pins to arduino. I don't have this.
6. One 1uF 25V capacitor. You can get it anywhere you buy the other parts.
7. Either a car power adapter that outputs center-positive 9V to 12V or a 9V battery with a connector from here .
8. Maybe some tape to secure the sensor to the back of your car.

Step 3: Step 3 Assemble and Test the Phi-1 Shield

This is covered somewhere else. Here is its documentation so you can just follow the steps. Make sure you solder on the buzzer on top right corner, and one RJ11 jack on the bottom right corner, like in this picture:

This instructable has the steps to assemble the shield.

After assembly, test the shield with test code found on this page:

The test code will ask you to adjust LCD contrast, press all buttons, and test out the buzzer and real time clock. You can try the alarm clock code and Morse code translator code on that page too. they don't need any more hardware than you already have on the shield.

Step 4:

Solder the RJ11 jack on its breakout board, both of which you purchased from sparkfun.
Connect phone cord between the shield and the RJ11 jack with breakout board.
Without plugging the shield on arduino, use a multimeter to test the continuity so you know which wire goes from the shield to which spot on the breakout board. Here is the picture of the sparkfun RJ11 breakout board:

Step 5: Step 5 Connect Sonic Ranger to Arduino

You will need a cable or solder three wires to the sonic ranger. I found this connector in my drawer but if you don't have one, go to a surplus store. Old CD-roms also have these wires. Make sure you get the right pin to the sonic ranger. Test with mulitmeter. I used my own breakout board so all signals are marked. Since the cable is only 3-pin, I had to feed 5V on the X pin on my shield. I jumped the x pin to 5V. If you have a cdrom cable you have 4 pins and can switch out pin orders easily with a small jeweler's screw driver. The output of the sonic ranger should go to arduino channel 2 Y, which is connected to analog 3.

Stick a 1uF capacitor (cylinder at the left end of the red-black-white wire) between 5V and GND to filter out noise. Trust me, this is not optional! Observe polarity of your cap.

Step 6:

Download arduino IDE if you don't have one from

I have made two versions of the program, a fully interactive one with menu and adjustable parameters. Another version is a nutshell, if you're interested in learning how things work quick.

Full version - interactive with menu and parameters

Nutshell version - powers up and works no parameters to adjust

Step 7: Step 7 - Field Test

Now take everything to your car. Tape your wire where necessary. Tape the sensor on the rear bumper cover facing straight, not tilting up or down. Make sure when you are parked in front of a car, you can detect it. Here is test pictures:

Step 8: Step 8 - Make It More Permanent

I made a small casing for the sensor so I can stick some 3M command stuff in its back with "velcro" so I can easily attach it to my car and remove it during a rainy day!

You are done!

For more projects with arduino and the Phi-1 shield, visit me at

Be the First to Share


    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge
    • Plywood Contest

      Plywood Contest
    • Microcontroller Contest

      Microcontroller Contest



    3 years ago on Step 5

    Question regarding the capacitor: I ran a 10ft length of 4 wire RJ11 and the HC-SR04 sensor returned a reading of zero. I did not have a capacitor installed. Does the capacitor filter the noise to allow the uno to read the signal?


    5 years ago

    Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Uno"

    Phi_1_test_sonic_ranger_v2_nutshell.pde:23:22: fatal error: WProgram.h: No such file or directory

    compilation terminated.

    Error compiling.

    This report would have more information with

    "Show verbose output during compilation"

    enabled in File > Preferences.

    I am getting this error


    11 years ago on Introduction

    Wow, my first every instructables post became a featured project!
    I will be mounting the detector with the new (black plastic housing) on my car this weekend and see if I can back towards a garage door within a foot, which I can never do with the high trunk and poor rear view inside my cabin, and then try it blindfolded!

    electric guy
    electric guy

    Reply 6 years ago

    saw this in makezine;
    um do I have to have the capacitor and phone wire?

    electric guy
    electric guy

    Reply 6 years ago

    what pins do the LCD screen go in?


    Reply 9 years ago on Introduction

    how did it stand up to time? Did you end up waterproofing it?


    7 years ago on Introduction

    I'm also concerned about the water/weather-proof capacity of the ultrasonic sensor. I'm more likely to use a device of this nature to let my wife know when she's too far into the garage, or not far enough. As such, the weather-proof capacity isn't all that important. Seeing the display would be impossible at any appreciable distance, but I'll bet the code for a graduated set of super-bright LEDs would be pretty easy. Make it logarithmic perhaps so the first ten or twenty feet change two lights while the last ten feet will advance five or more?

    I built a similar device to attach to my velomobile, measuring the distance of overtaking vehicles. If the spacing was below a certain point, the Arduino would trigger a camera pointed at the distance display and a second camera pointed at the license tag of the offending vehicle. Poor coding on my part meant that the lag made the photo results virtually useless, but it was a fun project anyway. (not weatherproof!)


    10 years ago on Introduction

    As an arduino owner looking for innovative ideas and a soon-to-be learner driver, this may well be something I give a go!