Parking aid


This circuit is based around the PIC 16C84 (or PIC 16F84) microcontroller. This chip is actually a small computer contained in a single chip, including RAM memory, EEPROM, I/O ports, CPU and so on. When you buy this chip, it comes empty with no program on it. You have to compile the source code and download the resulting machine code into it, using a PC and a small programmer attached to the parallel port of the PC and the chip. To get yourself familiar with this stuff, I suggest you first read this link: Getting started with microcontrollers.

This circuit is a parking aid. Two infrared sensors (or at least one) are continuously sensing the distance between the back of your car and an obstacle (i.e. the other car). Feedback to the driver is given via sound through a speaker. There are six levels: the first level (starting level) sounds short low frequency beeps and long pauses to indicate that there is an obstacle further than about 1m40. The second level sounds long low frequency beeps when you are between 1m and 1m40 of the obstacle. The third, fourth and fifth level will get you higher in frequency (and shorter beeps) when you are nearing the other vehicle at resp. less than 1m, 75 cm and 50 cm. When you are closer than 25 cm, you are in level 6 where quick dual-tone sounds can be heared, indicating that you are about to crash. When there is no obstacle, no sound is heard except some soft ticking, indicating that the processor is running OK. When the device is put on (preferably through a switch or operated together with the back driving lights) a short dual tone is heard to confirm that the device is up and running.

The circuit makes use of the Sharp IR distance sensor GP2D02. This sensor is based on triangular measuring principles, and is designed to measures distances between 10 cm and 80 cm, but using some smart interpreting of the digital output value, we can get in practice a range of more than 140 cm.
If you want to use only one sensor, you should replace the line "#define TWO_SENSORS" with "#define ONE_SENSOR" in the source code. Otherwise the software would hang because it can't find the second sensor. The complete device consists of three units: two outdoor units (one of which contains the microprocessor, power supply, first sensor and some other components, the other one contains only the second sensor) and one indoor unit, which is basically just an audio amplifier with speaker and power supply.

There are only three wires necessary to connect the outdoor unit at the back of the car to the indoor unit close to the driver. If you use two sensors, you need four wires from the second sensor to the first sensor.

When using two sensors, the software will allways take the highest value of the two sensors for conversion to sound signals (this is the shortest distance).
The LCD output in the source code is only used if you run this software on the 'LCD Experimental board using PIC16F84' shown elsewhere on this site, not for this circuit. In this case, the output value of the sensor (or the highest output value of the two sensors) will be shown constantly on the LCD display.

More information about the Sharp IR distance sensor GP2D02 can be found here: Sharp IR GP2D02 sensor.
The two (or one) outdoor units should be build completely waterproof. I used a plastic housing with a hole, where I mounted a piece of glass to put the sensor behind. You get the best results when you mount the sensors vertically, with the IR light emitting diode upwards. It is advisable that you use shielded cable between the two outdoor units not longer than 1.4 meter.

I experienced that winding a peace of aluminium folio around the sensor and connecting this folio to ground, gave much better results. When the sensor is pointing to open air, it should give a reading of 1. Without the folio, the reading will vary randomly between 1 and 40. So when using the folio, we can start beeping at a much lower value, giving a higher range.

The schematics diagram.

Possible placement options.

Source code for this project

List of components

Some pictures:

The Sharp GP2D02 distance IR sensor.

Picture of the Sharp GP2D02 IR distance sensor.

The indoor unit (a LM386 based audio amplifier).

The indoor unit amplifies the sound signals from the microprocessor.

Outdoor unit 1. The Sharp sensor behind glass, the microprocessor and other components not visible on this picture.

The outdoor unit must be waterproof.

  Home         Back to Electronic Projects