EE318 Electronic Design Lab, Project Report, EE Dept, IIT Bombay, April 2009 Ultrasonic Vehicle Parking Aid Display Group No: B05 Siddharth Bipin Shah (06007005) <email@example.com> Peeyush Jain (06007027) <firstname.lastname@example.org> Sanket Agarwal (06007028) <email@example.com> Kalyan Parhi (06007030) <firstname.lastname@example.org> Guide: Prof. L.R. Subramanyan Abstract: Our project topic is to design and implement an Ultrasonic Vehicular Parking Aid Display, which notifies the driver about obstacles coming in the way of parking. The device should be portable and easily installable into cars. In light of the emerging traffic situation where parking space is at a premium such a device can be very useful and also facilitate parallel parking easily. We have been successful in implementing the idea with the small modification that we are using two sensors rather than one. The technical details of this project follow later. Introduction: We are using ultrasonic sensors for sending high frequency (40 KHz) sound wave and receiving the wave reflected from any obstacle. This is fed into an amplifying-cumenvelope detector followed by a comparator circuit. The output of this circuit goes into the microcontroller. The microcontroller calculates the distance of the obstacle from the car and then intimates the same to the car driver through buzzer and LCD. Design of Circuit: Block Diagram- Microcontroller Unit Pulse Generation Envelope Detector and Comparator Nokia LCD Display Ultrasonic Transmitter Received Signal Amplification Buzzer The above block diagram describes the basic layout of our circuit. Ultrasonic Receiver Algorithmic Flow Diagram- Initialize LCD, Buzzer, Set counter values Send 10 Pulses first for the front part then for the rear part, and repeat it NO Is there any obstacle? YES Or else get the zone from the distance Zone 1/2/3/4 Buzzer beeps accordingly, LCD displays wall of thickness 1/2/3/4 Reset Counters. Display beam and no beeping of buzzer. Reset counters. Main Components: 1) Ultrasonic SensorsWe are using ultrasonic sensors, model nos. 14.4A01-TK017L63 (white) and 15C73-TK012L3 (black) of Audiowell Electronics, having centre frequency 40±1 KHz. The sensors’ voltage input capacity is 140V p-p which is required for long range transmission, like Radar, but since we are using it for vehicle parking, we do not require such long range. Also we are restricted by car battery voltage of 12V and hence we are giving it input signal of 8V p-p which yields good result for our application. The sensors have decay time of 1.2 ms which translates into roughly 20 cm loss in range, called the blind zone, of the sensor. 2) Amplifier-Envelope Detector-Comparator circuitThe initially received weak signal is fed through a DC-filtering capacitor, and with a level shifter to the next stage. The next stage consists of 3 high-pass active filters to filter out the low-frequency noise and 2 low-pass passive filters (having corner frequency of around 80 KHz) to ensure proper attenuation of high-frequency noise. After this the filtered and amplified signal is input to a peak detector, whose output is then send to a comparator which compares it with a variable reference. The final comparator output is connected to the microcontroller pin input for further processing. Level Shifter: The initial part of Amplifier stage which ensures that input voltage signal to the 1 HP filter is positive. This circuit involves a potential divider arrangement along with a capacitor, which smoothens out any voltage variations or spikes at the input. The output reference voltage of the circuit is 1.7 Volts. The receiver signal is superimposed on this voltage level and then amplified. This is done in order to prevent the negative half of the received signal from being cut out by LM324 amplifier which is a single supply amplifier. st High-Pass Active Filters: This stage consists of a non-inverting amplifier (using LM324) followed by 2 inverting amplifiers all with corner frequency of around 20 KHz to filter out the ambient noise. The feedback resistance of the 3rd and final stage amplifier is varied according to the overall gain required by the circuit. Also the maximum gain of each amplifier is frequency-limited to 25, assuming the unity gain bandwidth to be 1MHz. We have set gain of each stage less than 20 to avoid saturation of signal resulting in noise amplification. Low-Pass Passive Filters: This stage is contains 2 low pass filters having corner frequency of 80 KHz to ensure the high-frequency attenuation. The envelope detector: It is made up of a fast switching diode (1N4148 ,reverse recovery time < 4ns), and a resistor-capacitor pair in parallel with (1/RC) value , kept such that it is much less than the input signal frequency of 40 kHz , but is also much greater than the speed, at which the car can approach an obstacle, within our specified range. Approach velocity of the car (when parking) is typically in the range of 5-10km/hr i.e. 1.4 - 2.8 m/s .Hence a typical time interval to approach an obstacle, say from 2m initially to 1m is ∆t= ∆x/v= 1m/(3m/s) =.33s. So the lower limit is ≈ 1/∆t = 3Hz (in order of Hz). The frequency set is 3 kHz which is well above this lower limit, and also well below 40 kHz to ensure proper detection. Comparator: Voltage reference of the comparator can be varied using a potentiometer. The reference is set such that it is a compromise between the need of noise signal elimination and the received signal detection (maximizing range). 3) MicrocontrollerWe are using Atmega16 microcontroller for processing purpose. (Initially we planned to use PIC16F676 which was smaller but had the same current driving capability, but since the Programmer for PIC was not available in the lab, we decided to go for Atmega16. Also Atmega16 has 1 KB ram and 16 KB flash memory which comes in handy while programming). The useful features of this microcontroller being utilised are high current-driving & sinking capability, 4 general purpose input/output ports and the counters (two 8-bit and one 16-bit). We require high current driving capability to drive the transmitting sensor, which requires 8-V p-p square wave (which can be given by 2 pins) and 2-3 mA current for the specified distance range. 4) Nokia 3310 LCD We are using the above LCD for user-friendly display of the obstacle position. It is a 48x84 pixel LCD, organised as 6 rows of 8- bytes each and 84 columns. We are displaying a Car in the middle of the LCD. When there is no obstacle in the desired range the LCD simply shows beams coming out of the car in the front and the rear part. With an obstacle in the desired range, say in the front, the LCD shows wall in front of the car. The width of the wall changes proportionally depending upon the distance of the obstacle from the car and the width is maximum when the object is too near the car. 5) BuzzerWe are using a simple buzzer. The uC feeds the base of the NPN transistor (BC547) with common emitter connection which in turn drives the buzzer. 6) Voltage RegulatorWe are using Voltage Regulator LM7805 to supply 5V to the circuit down from 12V supplied by car batteries. The regulator employs internal current limiting, thermal shut down, safe operating area protection and good ripple rejection. Transmitter-Receiver Module Mainboard Circuit with connector for LCD, TransmitterReceiver Module, Buzzer, Volume Control Testing Procedure & Results: 1. Receiver circuitInitially we tested the receiver by transmitting 40 KHz from the signal generator. We found that the received signal contains noise of around 50 Hz. Also the signal strength was too weak, 10-15 cm distance between the sensors yielded receiver output of the order of few milli volts. Using a simple high pass filter did not help too. The output after the filter was clipped off below zero. Op-Amp LM324 was chosen as it operates in 0-5V range (does not require dual power supply). So we had to introduce a DC offset for the received signal which is input to the amplifier. We are using a voltage divider to create a Vreference of around 1.7 V. In spite of the dc offset, we found that the output waveform of the amplifier is significantly different from the input. The reason behind it was amplifier saturation which limits the amplification of the Input signal while amplifying noise. Assuming the unity gain bandwidth of the amplifier to be 1 MHz the gain at 4 KHz was found to be 25. So we used multiple amplifier stages each with a gain of roughly 2-20. Initially we used 4 stages. But properly setting the gain values of all the 4 stages was a problem as the output was saturated. So we came down to 3 amplifiers. The first two stages of the amplifier gain were set roughly equal to 20 each. For the 3rd and final stage we used variable resistance (100k pot.) to control the overall gain, All the stages have a corner frequency of 20 KHz. The voltage output of the final amplifier stage is around 2 V. At this stage we were getting good outputs. But we observed that the o/p contains high frequency noise also. So we decided to use passive low pass filter of corner frequency 80 KHz. The envelope detector uses a fast diode IN4148 and a parallel RC circuit connected to ground after that. The time constant RC value of the circuit is chosen so that it lies between 1/40 KHz and the reciprocal of time taken by the car to approach the obstacle, far separated from both limits. The comparator follows the detector. The reference i/p of the comparator is set by a voltage divider method. The reference is set, above the noise level, such that it allows only signal to pass through. The tuning of this stage and the final amplifier stage is done so as to obtain maximum range. Our circuit detects up to a range of 2 meters. The voltage outputs of the comparator are 0 V and 3.5 V, fed into the uC. 2. Microcontroller interfacingWe are using 2 transmitter-receiver pairs, one for the front part and other for the rear one through ports A & B. We are sending pulses of 39.77 KHz which lies in the specified centre frequency range of operation. We first transmitted 5-6 pulses but the range obtained was not quite satisfactory though we could measure nearer distances with it. We tried sending up to 15 pulses and found that 10 pulses would reasonably do a good job balancing both the trade offs. Using one pin for transmitting we get 4 V p-p output which resulted in a range of 1 m approximately. So to increase the transmitter output we use 2 pins instead of one so as to get a p-p voltage o/p of 8 Volts. But the range didn’t exactly increase by two times. The final range we got was approximately 2 meters. We are using a 8-bit counter for counting the no. of pulses and thereby the distance of the obstacle. We are using remaining pins of port B for JTAG programming. Port C of the uC is used for Nokia 3310 LCD display. We are using five pins from uC as ~RESET (external reset input), ~SCE (chip enable), SDATA (serial data input), SCLOCK (serial clock input) and DORC (data or command) pins. The serial interface is initialized when ~SCE is high. A negative edge on ~SCE enables serial interface and indicates the start of a data transmission irrespective of SCLOCK. DORC is the mode select bit. If it is low the current byte is interpreted as a command byte or else as a data byte. It is read with the eighth SCLOCK pulse. Also SDATA is sampled at the positive edge of SCLOCK. We are using vertical addressing mode rather than horizontal because it’s easier. When we were testing the LCD at first the pins were loose. So it did not work properly. Hence we fastened it. But even then the LCD was not working. We had to change the working voltage level of the LCD through programming by setting or resetting some Voutput (out of 7 Vop) values (a concept called turning on the charge pump).The total range between 3 V to 10 V at room temperature. So after addressing this problem the LCD started working properly. Also we are displaying the distance of the front and the rear part of the car from the respective obstacles in cm units. If there is no obstacle the distance shown is the maximum range that can be obtained. Car showing Beam when no obstacle in sight We are using a pin in port D (OC1A) as input to the buzzer. The buzzer is driven by an NPN transistor (BC 547), as it requires high current, with the volume of the buzzer being controlled by a resistor connected in series with it. We are using 16 bit timer counter for the buzzer. We have divided the entire detectable range of 1.6 meters into 4 zones of 40 cm each. As the car approaches an obstacle if the distance D between them is such that D > 1.6 m then the buzzer does not beep. This zone is known as Zone 0.The LCD displays beams for this case. If 1.2 m <D < 1.6 m then it beeps with some frequency and the Nokia LCD shows a wall of minimum thickness, say t, ahead (back) of the car. We label this zone as Zone 1. In zones 2 and 3 the thickness of the wall increases to 2t and 3t respectively and the buzzer frequency follows the same rule. In the region 4 when the car is within 40 cm distance of the obstacle the buzzer beeps with maximum frequency and the LCD shows a wall of maximum thickness. So the variable frequency employed in the buzzer really gives the driver an idea of how far or near he is from a target without even looking into the LCD. Also if both front and rear parts face obstacles the buzzer beeps according to the nearer obstacle thereby ensuring safety. For cutting out the effect of noise to bring in more reliability, while choosing to go for higher range, we are taking 2 sets of readings and choose the reading which gives more distance as noise seems to result in less distance. We have verified that this method gives us more stable values than the one that was previously used. The whole circuit draws a maximum current of about 50 mA from the supply. Also one more component we used during the course of the project was 16x2 Alpha Numeric LCD which didn’t appear in the final product. We displayed the distance calculated, in the uC, on the LCD. Conclusion and Further Improvement : In the original problem statement we proposed to use the ultrasonic sensor both as a transmitter and a receiver. But we could not implement it in our project. We tried to do it using CD4066 solid state switch and also using 2n2222 transistors. This method did not yield any favourable result. The failure may be due to 1) Our use of passive sensors (maximum input voltage is 140V) instead of using active sensors whose maximum voltage input range from 8-12V.This could have yielded in better result. 2) Input voltage level of 0-5V for a single sensor results in lower range and the decay time further reduces the effective range. 3) Better control switches than CD4066 may be required. We have achieved all our goals stated in the problem statement except using single sensor to serve dual purpose as stated above. We are finally getting a range of 2 meters which would be sufficient for our purpose. Again this range can be slightly increased by proper tuning and active sensors. References:  Datasheet - ATMega16, ATMEL  Datasheet – 48x84 pixels Matrix LCD Driver PCD8544, PHILIPS  Datasheet – LM324 Low Power Quad Operational Amplifiers, National Semiconductor  Ultrasonic Distance Measurement with MSP430, Texas Instruments  www.maxbotix.com  http://www.audiowell.com/productclass29.htm  http://www.e-arsenal.net/robotics/sonar.html  http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.2658  http://www.sensorsmag.com/articles/0399/0399_28/main.shtml  http://www.sensorsmag.com/sensors/article/articleDetail.jsp?id=321383  http://www.pepperl-fuchs.com/cps/rde/xchg/SID-266868B6AAD3F2BB/global/hs.xsl/186_reflexionstaster.htm?force=1  www.avrfreaks.com User Manual: Contents in the package Following are the components included in the system 1) 1X Main board 2) 2X Receiver-Transmitter Circuit 3) 1X LCD Display 4) 1X Buzzer 5) 1X Volume Control Knob 6) 4X Transducers 7) Cables for connection Description of components The Main board has three 6 pin connectors. The one marked with “Prog” is for programming the Main board and should not be used by the user at any point of time. The other two are for connecting the receiver-transmitter circuits. There are three 2 pin connectors as well. The one which has “Supply” marked on it is for connecting the power supply. The one with buzzer marked on it for connecting the buzzer to it and the one with volume marked on it is for connecting the volume control knob. Each of the 2 receiver-transmitter circuit has one 6-pin connector for connecting it with the Main board. Each of them has two connectors, 1 for transmitter and 1 for receiver. Connect the transducers with proper polarity as marked. The 4 transducers are piezoelectric ultrasonic tuned transducers. Interchanging the receiver and transmitter does not cause any problem as long as they are connected with proper polarity. Installation 1. Place the Main board box on the dashboard of the car. 2. To install the sensors, drill holes of the size of the sensor on the rear and front bumpers of the car. Drill 2 holes on each of the front and rear bumpers roughly 15 cms apart from each other, and equidistant from the centre. Align the sensors such that their front surface is vertical with the ground, so the sensors beam comes out straight ahead. 3. Now connect the wires of the transducers from the front and from the rear to the Receiver-Transmitter circuit marked with front and rear respectively. Ensure proper polarity in installation. 4. Now connect the Receiver-Transmitter circuits to the Main board with the 6 pin connectors as marked on the boards. 5. Connect the LCD to the Main board. 6. Connect the buzzer and the buzzer volume control knob to the Main board with the proper connectors. 7. Connect the power supply cable to the Reverse gear tail lamp of the car. Ensure proper polarity. Now connect it to the Main board. The installation is now complete. USAGE When you put the car in the parking mode the system starts up. The display shows a car with beam coming out both from the front and the rear. The distance displayed now is 200cm for both front and rear. This is the maximum range of the sensors. As you approach an obstacle and come within 2 metres of it, the display shows the corresponding exact distance on the LCD for the front or the rear as the case may be. As the distance reduces to less than 1.6m, the display shows a wall of small thickness, little far from the car, at the front or rear or both as the case may be. The buzzer starts beeping with a small frequency. As the distance at any sensor reduces below 1.2 metres, the thickness of wall on the LCD increases and the distance of the wall from the car reduces. The frequency of the buzzer increases. Similarly this happens when the distance falls below 80cm and 40cm. If the car is within 40 cm of an obstacle, the buzzer beeps with a very high frequency. The car may be too close to an object. The LCD displays the exact distance for both front and rear and the zone where an obstacle is. The thickness of the wall at front and rear are independent of each other. The frequency of the buzzer depends on the minimum of the two distances. Control the volume of the buzzer as per your comfort level with the volume control knob. IMP Note: The sensors have a blind zone of 20cm and system will not show a distance less than 20cm.
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project