Thursday, June 23, 2011

Schema and assembling of ultrasonic universal sensor


This device is able to detect persons and objects at a distance of about two meters. It can be used on a vehicle, reversing radar or to make industrial automation equipment, small robots, etc.. It features an LED bar indicating the distance in an analog manner and a buzzer alarm.


Specifications:
- Operation at 40 kHz ultrasound.
- Measuring the distance.
- Relay output 1 A 250 V.
- Digital output 0 / 4 V.
- Detection of objects between 0.2 and 2.5 m.
- Bar LED for visual indication of the distance.
- Buzzer for audible indication of the distance.

The ultrasonic sensor is a kind of radar, including a ceramic capsule TX emits a vibration at 40 kHz (above the range of sounds audible to the human ear) and a transducer RX tuned to this frequency and receiving the reflected sound by an object in front of the TX and RX. This system is used for different applications because it can detect the presence of an object or a person in a defined field (radius range): the signal picked up by the receiver undergoes when it detects a sudden change level. One can also measure the distance between the TX / RX of the object reflecting the ultrasound signal as the amplitude of the signal received by the RX is proportional to the distance crossed.

Our implementation
This article proposes to carry out a device based on this principle and to use several functions: it can make use of sensor installed on the rear bumper of your car to help you when you park (especially in an underground car park close ...) or to make an ultrasonic meter (yes, that's it: a real meter) stand-alone or connected to a measuring circuit A / D converter, or as proximity to allow a robot around obstacles. The circuit is an ultrasonic radar assisted by a microcontroller: it has inputs and outputs for achieving the functions described above, in particular, when it detects the proximity of a fixed or moving, the relay glue, an open collector transistor mounted and driven by a rectangular signal can sound a buzzer without electronics or a small speaker and LED lights. In addition, there is provided a digital output compatible with TTL and analog output: the first presents a DC voltage when the radar detects the proximity of someone or something, and the second provides a potential strictly correlated to the distance between the TX / RX and the body found. Three LED bar indicates the estimated distance. But delve a little that.

How does it work?
The method used in this assembly is to spread through the air vibration (ultrasonic wave) to 40 kHz using a ceramic capsule tuned to that frequency, then capture the reflected waves from the nearby object, the reception is performed by a second transducer which, when the first is somewhat based on the speaker, in fact plays the role of a microphone. Indeed, the ceramic membrane is subjected to pressure (acoustic, but at 40 kHz it is far from the audible sound) of air generated by the reflected ultrasound: the intensity of that pressure is inversely proportional to the distance that produce ultrasound by compressing the air (the material and condition of the surface of the reflective object characterize porosity that absorbs more or less the ultrasound received from and sent to the TX RX). In any case, the terminals of the transducer RX, one recovers a variable voltage produced from the pressure on the ultrasonic ceramic membrane (the famous piezoelectric phenomenon: the voltage is proportional to the pressure deforming the membrane, as with a microphone, which is also a piezoelectric model, precisely), more precisely, the amplitude and frequency of this voltage depends on the amount, intensity and time of delivery of components reflected . At rest, that is to say when the radar is not in motion (the vehicle is stopped, for example) and is in a stable air (no wind or fan, or object person or moving), tension remains constant, that is to say that its amplitude and frequency remain unchanged. But when an object enters the field of radar range ultrasound (0.2 m to 2.5 m), the voltage varies. You can read this tension and its variations in the straightening in order to obtain the DC component, it is easy to discriminate the condition of rest of the intrusion of an object in the field: indeed, across the rectifier is note a change in voltage obtained.
As for outputs, they behave as we have explained above, and they each have a characteristic that the table in Figure 4 details. Rather see how the detection system by analyzing the circuit diagram and the program resident in the PIC16F630 microcontroller programmed EV125 including the "routine" (sub-program) on the ultrasonic radar itself.

The circuit diagram
The electrical diagram of Figure 1 shows the place that the PIC micro capsules to manage the TX and RX with the help of a few operational amplifiers.
After initialization of the lines I / O, the resident program launches the PIC "routine" simulating the operation of the ultrasonic radar: using an internal timer, the PIC produces a component that sends 40 kHz its online RC5 (initialized as output) to the transistor T3, which amplifies an NPN current to drive the piezo transmitter capsule.
During this time he is preparing for the RA3 controls cyclic (configured as input) which reads the voltage changes, note that the RX receiver capsule is not interfaced directly with the microphone but the signal has to pass to through a network whose function is to amplify the analog voltage obtained from the reflected waves, the filter and the right to extract a DC component. Specifically, the electrical signal produced by the RX is applied (through C5 and R11) to pin 2 of IC2A, mounted an operational inverting amplifier whose voltage gain G is:



G = R24: R11

component is again amplified and amplified by reverse IC2B whose gain G depends on the time of the report:



G '= R25: R12

The resulting tension is compared with a constant reference IC2c located in a third operation mounted this time non-inverting comparator: when the potential from the received signal exceeds a threshold determined by the potential applied to pin 9, the 8 increases from zero to about 12 V.
Give a helping zoom on the polarization of the operational network IC2A, IC2B, IC2c: it was designed to provide a specific reference to each and both have their first non-inverting input polarized with a little less than 6 V (obtained by Bridge R19/R20, powered R1/C13 after the filter) and it makes sense for when amplifying analog signals, there must be (at rest) leaving at half the supply voltage, so to ensure equal excursion of the half wave positive and negative. Of 6 V and used to IC2A IC2B the bridge R5/R6 takes the potential as a reference to the comparator, it is a slightly lower voltage (about 5.8 V) than the one standing at the exit of IC2B, which provides that the comparator switches when the peak of the signal from the capsule receiving more than 200 mV positive.
Whenever the signal in question exceeds the threshold, the comparator provides a positive pulse and when it falls below the zero formed by the fictional 6 V and polarizing IC2A IC2B, the comparator output maintains its own low level (about 0 V) . One can deduce from this mode of operation that is essentially a IC2c-wave rectifier, or if you prefer, a detector: its role is to make variable unidirectional voltage end of the capsule RX and draw the rectangular pulses PIC can read. Since the amplitude of these pulses is about 12 V and the input lines of the PIC will not accept more than 5.5 V, it was necessary to insert the zener ZD1 which, together with the current limiting resistor R26, limited to 5.1 V the potential applied to RA3.
Since we came to this line of PIC, the program reads cyclically to check for pulses due to the return of the reflected wave at 40 kHz, note that when the arrival of the pulse is detected, a "routine" develop the corresponding data by measuring the average value of line voltage by the pulse.
Rather, the micro check the width and pulse interval to determine the intensity of the reflected signal to the RX. The measure concerns the A / D converter internal to the PIC that we attribute to the line RA3 during the initialization phase, the converter has a resolution of ten bits and can be paired with up to eight I / O (read in multiplex) and it also helps to define, with the potential applied to RA0, the reference voltage sampling. For us, with the trimmer RV1 we define the voltage range that the A / D and we choose to convert the sensitivity of the conversion: when you turn the cursor to the positive 5 V, the circuit becomes less sensitive and vice versa . The amplitude of the reference scale of the converter is directly proportional to the sensitivity, that is to say, the distance of radar detection, and therefore with the trimmer RV1 we can define the distance covered by the sensor and choose between 0.2 meters and 2.5 meters.
The A / D converter determines the digital data that is read by the main program to assess the distance and control outputs based on the latter. Let's see, one after the other, how these outputs are supported:
- The line RA2, for starters, is forced to logic high when the detected object distance is between the minimum and maximum distance perceptible; otherwise (subject too far or too close) RA2 goes to logic zero; LD4 LED lights when the radar detects the proximity of an object between 0.2 m and a distance dependent sensitivity set with the trimmer RV1. As for the relays, it sticks shortly after ignition of LD4 and goes to rest with a slight delay compared to the extinction of the LED. Note that the software considers exceeded the minimum distance when it detects that the signal picked up by the capsule and amplified by RX IC2A IC2B and is just below the maximum, which he considers to be beyond the maximum distance when, in Depending on the setting of RV1, the signal arrives on RA0 with an amplitude less than the minimum threshold. RA2 line, responsible for monitoring and LD4 T1 driver as the transistor T4, an NPN used as a "buffer" (buffer) to control the digital output: Dout line provides a logic that follows the alternation or the logic zero when RA2 is at logic low and logic one (about 4 V) when the logic high level.
- The software also provides an analog output that provides a potential whose amplitude is directly proportional to the distance at which the object is detected (but of course within 0.2 m to 2.5 m) in August (the name of the analog output) determines a voltage obtained by means of a "routine" (subroutine) generating a PWM waveform whose duty cycle is directly proportional to the distance detected or, if you will, conversely proportional to the amplitude of the component read by the A / D converter of the microphone. The pulses coming out of RC3 are filtered by low pass cell composed of R22 and C11, the ends of the cell so we find a well smoothed dc voltage whose amplitude follows the duty cycle of the PWM wave and therefore the amplitude is more important than the signal read by the capsule RX is low (and the distance is large) and vice versa.
The potential is applied to the input of an operational (IC2d) mounted in a "buffer" non-inverter which shall return with the same amplitude of the pin 13 from which, through R13, it reached in August and is read by the RA1. The role of "buffer" is to allow to drive in August with the devices consume a few dozen mA without loading RC3 line that could not provide a current greater than these few mA.
- A final release is scheduled for controlling the buzzer: it corresponds to the transistor T2, an NPN, the base is controlled by the microcontroller through its online RC4, the buzzer is particularly useful in reversing radar mode to help with the parking cars (in fact, this buzzer sounds different depending on the distance where the obstacle). Here's how it works: If the radar does not detect or if the object is located beyond the radius of -2.5 m-range, line RC4 goes to logical zero, the transistor is off and the buzzer is silent; However, when the distance between RX and obstacle is less than 2.5 m, launched the first micro alarm by switching the logical condition of the line RC4 (typically 0.5 s to high logic level and 0 5 s at low logic level) and alternating conduction and saturation T2, which determines the emission of an intermittent sound from the buzzer connected to the points and BUZ-BUZ +. Finally, if the radar and the detected object is too close-less than 0.2-m, RC4 is set to logic 1, the transistor is always saturated and the buzzer sounds continuously.
- The microcontroller can also order a wide LED which express in their own way (analog bar three, LD1, LD2, LD3) the distance between RX and object or obstacle. They are controlled by internal converters, each of which has set a different threshold.
LD3 lights up when the object is within walking distance (but at least 0.2 m), with LD2 LD3 lights when the object is further away (typically in excess of a meter) and LD1 is s' add the other two (ie LD1, LD2 and LD3 are all three on) when the object is detectable at the maximum distance (2.5 m).
Below 0.2 m all three are off. During operation it may happen that one or more LED does not light up steadily: this typically occurs when the object or obstacle is moving or is at a distance do not correspond to any of the thresholds set.
Well, well, since you now know in detail the operation of all outputs, you'll put it to use depending on the application you intend for the device.
If you want to use the interaction of three types of signs, know for example that with the cursor RV1 mid race in August provides only 0.8 V when LD3 is on, that is to say whether the radar detects an object at a distance just less than 0.5 m. Conclude this analysis of the circuit diagram indicating that the entire assembly works under a supply voltage between 12 and 15 V to be applied to points 12 V and GND (a car battery, reversing radar mode, is ideal) ; D3 protects the circuit against accidental reversal of polarity and prevents the flow of current as the power input to the rest of the circuit. The regulator VR1 is giving a 78L05 5 V stabilized needed to operate the microphone, the trimmer and the sensitivity of the transistor used as "buffer" for digital output.

Figure 1: Diagram of the ultrasonic sensor





Figure 2a: Layout diagram of the components of the plate of the ultrasonic sensor.
Figure 2b: Design, scale 1, the circuit board of the plate the ultrasonic sensor.
Figure 3: Photograph of a prototype of the plate of the ultrasonic sensor..


Component List
R1 ...... 47
R2 ...... 47
R3 ...... 47
R4 ...... 220
R5 ...... 10 k
R6 ...... 270 k
R7 ...... 1 k
R8 ...... 1 k
R9 ...... 1 k
R10 ..... 1 k
R11 ..... 1 k
R12 ..... 1 k
R13 ..... 1 k
R14 ..... 1 k
R15 ..... 1 k
R16 ..... 1 k
R17 ..... 1 k
R18 ..... 1 k
R19 ..... 15 k
R20 ..... 15 k
R21 ..... 15 k
R22 ..... 15 k
R23 ..... 15 k
R24 ..... 22 k
R25 ..... 22 k
R26 ..... 22 k
RV1 ..... 10 k trimmer MO
C1 ...... 100 nF multilayer
C2 ...... 100 nF multilayer
C3 ...... 100 nF multilayer
C4 ...... 100 nF multilayer
C5 ...... 10 nF ceramic
...... C6 10 nF ceramic
C7 ...... 18 pF ceramic
C8 ...... 18 pF ceramic
C9 ...... 10 uF 35 V electrolytic
C10 ..... 10 uF 35 V electrolytic
C11 ..... 10 uF 35 V electrolytic
C12 ..... 100 uF 25 V electrolytic
C13 ..... 100 uF 25 V electrolytic
C14 ..... 470 uF 25 V electrolytic
LD1 ..... LED 3 mm red
LD2 ..... LED 3 mm red
LD3 ..... LED 3 mm red
LD4 ..... LED 3 mm red
ZD1 ..... Zener 5.1 V 400 mW
D1 ...... 1N4148
D2 ...... 1N4148
D3 ...... 1N4007
X1 ...... 8 MHz quartz
IC1 ..... PIC16F630-EV125 already programmed in the factory
IC2 ..... TLV274
VR1 ..... 78L05
T1 ...... BC547
T2 ...... BC547
T3 ...... BC547
Q4 ...... BC547
RY1 ..... 12 VDC 10 A relay contact 1
TX ...... ultrasound transmitter capsule
RX ...... capsule receiving ultrasonic

Misc:
2 supports 2 x 7
A horizontal strip 12-pole male
A plastic housing
The two capsules ultrasound can be mounted on the PCB vertically or horizontally (in the latter case, they must be on pins or solder tails vertical components) can also be placed at a distance (in this case is the link to the plate by means of shielded cables). Remember the three "straps" wired J1, J2 and J3.

OUTPUT FUNCTION Use ...
Relay Normal conduction between COM and NC, will close between COM and NO each time Dout goes to logic high and returns to rest with a slight delay compared to the return to zero volts in doubt. ... Linked to or instead of doubt, as contact-intrusion alarm systems or to start playback of a message or open a turnstile or gate when a person or vehicle s' approach.
Dout Normally at logic low level, takes the high logic level (4 V) when the presence of a body at a distance of 0.2 to 2.5 m is detected. ... Linked to or instead of the relay output, which is modeled on virtually any change of status.
LD4 Dout following states: ON when the radar detects a body at a distance of 0.2 to 2.5 m; off when there is nothing to be detected or if the object is closer than 0.2 m further than 2.5 m. ... As signaling devices to understand that an object has entered the range of the radar sensor in use as a burglar, reports the status of the output.
August Provides a voltage directly proportional to the distance of the object detected, ranging from 0 V (when the object is not to over 0.2 m) to 4 V when it is 2.5 m or more. ... To drive a needle microammeter whose scale can be graduated in decimetres, or a digital voltmeter or circuit capable of visualizing the tension, the goal is to achieve an ultrasonic meter.
Buzzer (BUZ + / -) Order a buzzer sounding in the impulse so if an object is detected within 2.5 m and continuously if the detected object is less than 0.2 m if the distance exceeds 2.5 m buzzer remains silent. ... When the circuit is mounted on a vehicle as radar back (parking aid): the sound pulse alerts the driver that the vehicle is approaching a wall or another vehicle, the continuous sound means that the obstacle is very close and must stop.
LD1, LD2, LD3 Form a bar indicating the distance: the distance for which they light up depends on the setting of the trimmer, LD3 indicates the smallest distance, LD2 (lit with LD3) and when the intermediate distance LD1, LD2 and LD3 are on all three c is that the obstacle is the maximum distance, all three are off if an obstacle is less than 0.2 m. ... As an indicator of distance gives a rough guide depending on the setting and in some cases it may be useful: for example, the circuit can be used as a reversing radar for parking (it allows a visual assessment of the distance is an obstacle, to be used with or instead of buzzer buzzer).
Figure 4: The output functions.
The practical realization
Once we realized the single-sided printed circuit (Figure 2b gives a scale drawing of the plate) or that one is provided, it goes first three "straps" J1 , 2 and 3, the four pins for the two capsules and two piezoelectric materials integrated circuit and then verifies the quality of the first weld (or short-circuit between tracks or pads or cold weld joints).
It inserts integrated circuits until all welds have been completed.
Then mount all the components in a certain order by looking frequently 2a and 3, and the list of components. Insertion and welding pose no particular problems, they require only a little care, but still take great care to the polarity (as defined in assembly) polarized components (diodes, zener, LED-if you deport Use of the pair rouge/noir-, electrolytic capacitors, transistors and regulator in a plastic box half moon and of course at the end integrated circuits).
Be careful, some resistors are mounted vertically. Mount in a second step the most bulky components such as trimmer, quartz, connector, relay and two capsules piezo. About the latter: first mount the capsule TX (it is marked with an S or T) and the RX (which is marked with an R). If in doubt the TX is not shielded at the rear, while the RX is shielded on the side where the legs out soldering (that in order to avoid interference), you can deport them away from the plate , but then connect them with cable, the hot spot going to the + and the braid to ground (for RX mass is of course the shield).
The connector 12-pin 2.54 mm pitch can be omitted and son can be welded directly to the pellets.
When all this is done, push the two integrated circuits in their sockets, orienting landmarks keyed out their U-R2 for the PIC to IC1 and IC2 for around R22. The PIC is available already programmed at the factory.
Check at least twice systematically (identification of components, respect for values, polarity and weld quality), you will not regret it because the installation work the first time.
Power to the circuit (if used on a vehicle, feed it with the on-board battery) from a small power supply providing a voltage of 12 to 15 VDC for a current of 100 mA at least.
In any case, mount a delayed 500 mA fuse. By Car (reversing radar), take the 12 V after ignition of the fuse box Neimann, so that the power is turned off when you do not need it because the vehicle is not supposed to drive (this avoids the discharge the battery of the car!). When the power is on, put the cursor RV1 mid race and stand in front of the capsule: Verify that beyond 0.2 m and up to a few meters the sensor detects you (you'll know because you hear over and glue the LEDs will light up depending on the distance at which you are or have placed the obstacle).

No comments:

Post a Comment

Thematic Links :