DIY Parking Assist System
The aim of this Instructable is to create a parking assistant device using an SLG46531 - GreenPAK™ programmable mixed-signal IC and the SHARP GP2Y0A60SZLF distance measuring sensor. Many modern vehicles come with this feature, but the techniques described in this Instructable will allow anyone to create their own removable parking assistant device.
Below we described steps needed to understand how the solution has been programmed to create a parking assist system. However, if you just want to get the result of programming, download GreenPAK Designer software to view the already completed GreenPAK design file. Plug the GreenPAK Development Kit to your computer and hit the program to create the system.
Theory Behind Sensing
The GP2Y0A60SZLF sensor is a distance-measuring component with an operational range between 10-150 cm. It includes a signal processing circuit and has a small size of 22 x 8.0 x 7.2 mm. Its analog output makes it a great fit for the GreenPAK to work with.
This sensor works by measuring the light reflected off of the surface of an object to determine the object’s distance from our sensor. Neither temperature, variation of the reflectivity of the object, nor duration of the reading influence the measurements.
The GP2Y0A60SZLF can be purchased in a module with the necessary circuit components included, as shown in Figure 1. If the user purchases the sensor separately, they will need to include the circuitry shown in Figure 2.
The GP2Y0A60SZLF datasheet provides the graph shown in Figure 3, depicting the voltages given as an output of the sensor in presence of a white sheet of paper.
Addressing Different Materials
Since every material has different reflection characteristics, the versatility of this sensor becomes a concern and needs verification.
Cars come in different shapes, sizes, and colors, so we charted the sensor´s behavior in front of different materials to make sure it is compatible with as many materials as possible. Figure 3 shows our results, which are displayed as a graph in Figure 4.
Developing the GreenPAK Design File
To start testing the device we will stick to the output voltages given in the datasheet (Figure 3). Fortunately, the values remain similar according to distance regardless of which material.
For now, we will select the following distances:
- 20 cm should give us an output voltage of 1.9 V
- 50 cm should give us an output voltage of 0.95 V
- 150 cm should give us an output voltage of 0.50 V
All of the values used in the .gp file were chosen from the Datasheet. Nevertheless, the practical characterization of the sensor using other materials tells us that there is no real significant difference in the voltage of the readings. Therefore it is possible to use the graph in the datasheet to apply this Instructable concept to get a good general distance sensor. If needed, it can be adjusted to work with a certain material under certain conditions.
The alarm will go off under the following conditions:
- 150cm distance will make a beeping sound with a frequency of 1 Hz
- 50cm distance will make a beeping sound with a frequency of 5 Hz
- 20cm distance will make a beeping sound with a frequency of 10 Hz
Pin 6 in the GreenPAK design is connected to all 3 of the analog comparators as shown in Figure 5. Thanks to the ACMP gain options, the user can select threshold values from 50mV to 4.8V.
To create the 3 different buzzer frequencies, we used one counter and one inverting D-flip flop per buzzer. For instance, CNT1 outputs a pulse every 500ms. Those pulses clock inverting DFF4, which creates a 1Hz square wave. The same technique was used to create a 5Hz and 10Hz square wave.
Figure 6 illustrates the functionality of the design.
Channel 1: Pin 6 (ANALOG_IN)
Channel 2: Pin 17 (BUZZER_OUT)
Schematic
The whole system consists of the GreenPAK, the GP2Y0A60SZLF proximity sensor and a 5 Volt Buzzer. Figure 7 shows how the circuit needs to be connected.
Conclusion
This Instructable explores the capabilities of the GreenPAK in the automotive industry. Using a simple and reliable design, this system can be implemented in newer models as well as in a standalone system that can be integrated into older models.
The differences in the voltage readings between different materials are small, which enable us to generalize the values without having to worry about the material of the object in proximity to the automobile.
The core design presented in this Instructable can be modified to fit different requirements without much trouble, and it would still be reliable with most materials.
This design did not consume all of the internal resources of the GreenPAK chip, so the user can add additional functionality to this design if desired.