Build an Ultrasonic Proximity Detector


Whether you want to build an automatic flush toilet for your home or design a machine to taunt your cat every time she walks by, our friends from Nuts & Volts Magazine have this great ultra-simple, ultrasonic proximity detector. Nuts/Volts


Ultrasonic Proximity Detector

Ultrasonic Proximity Detector
The circuit in Figure 1a and Figure 1b are the schematics of an ultrasonic proximity detector. It has a maximum detection range of approximately 6 feet. When someone passes in front of the ultrasonic transceiver board, the contacts of relay K1 will close. The relay will remain energized while the device continues to detect a reflection. When there is no reflection, the relay contacts will open after 20 seconds. Photo 1 shows the assembled circuit on an experimenter's breadboard.

The Circuit
Photo 1

Step1: Transmitter

U2C forms a 40 KHz oscillator (Figure 3 shows the 40 KHz crystal assembly). This oscillator is connected to U2D and U2E while the inverted oscillator signal (U2B) goes to U2A and U2F. These parallel gates provide more current and drive the ultrasonic transmitter. Note that it may take a couple of seconds after the power is applied for the oscillator to stabilize.

Step 2: Receiver

Q1 and Q2 amplify the reflected 40 KHz signal picked up by the ultrasonic receiver by 2500. Q2 is capacitively coupled to the voltage doubler formed by D1 and D2. The rectified signal is connected to the negative input of voltage comparator U1A. R12 (the Sensitivity potentiometer) sets the threshold voltage for U1A. When the threshold voltage is exceeded, the open collector output of U1A goes high-impedance. This enables the 70 Hz oscillator formed by U1B. When this oscillator is on, the LED glows and the one-shot formed by U3 is repeatedly triggered. The output duration of the one-shot is set by R16 and C11 and is equal to 1.1*R16*C11 seconds. U3's output turns on Q3. As a result, K1 closes its normally open contacts. C13 dampens the inductive kickback when K1 is turned off, preventing the circuit from triggering due to this noise source. The unit is powered by a 12 VDC 200mA unregulated wall transformer. U4 provides a regulated 9VDC to power the circuit. Device pinouts are shown in Figure 2. The 40 KHz transmitter and receiver are mounted 4" apart on a piece of perfboard (see Photo 2 below).


receiver
Photo 2


The circuit consists of the following:

40 kHz Ultrasonic Sensor Set (Transmitter)

    1. Crystal Oscillator
    2. Drivers
40 kHz Ultrasonic Sensor Set (Receiver)

    1. 68 dB Amplifier
    2. Cascade Voltage Doubler
    3. Threshold Detector
    4. 70 Hz Oscillator
    5. One-Shot (Monostable Multivibrator)
    6. Relay

Crystal AssemblyFigure 3. 40KHz Crystal Assembly


Device PinoutsFigure 2. Device Pinouts


To calibrate the device, have someone stand at the desired detection distance in front of the transceiver board. Next, turn the Sensitivity Control (R12) until LED D3 glows. Then rotate R12 slightly in the opposite direction until the LED goes out. Noise may cause the device to trigger randomly, causing the LED to blink. If this happens, turn R12 slightly to reduce the circuit's sensitivity. One application for this circuit is turning on a door chime. Another use is detecting a person on a porch and turning on an exterior light. This can be accomplished by wiring the normally open contacts of the relay in parallel with the lamp SWITCH. Have fun with your Ultrasonic Proximity Detector.

Part List:

Component Name Part Description Manufacturer Part Number
R1 3K 5% 1/4W Resistor CF1/4W302JRC
R2 150K 5% 1/4W Resistor CF1/4W154JRC
R3,R10,R14 330K 5% 1/4W Resistor CF1/4W334JRC
R4 1.8K 5% 1/4W Resistor CF1/4W182JRC
R5 470 5% 1/4W Resistor CF1/4W471JRC
R6 10K 5% 1/4W Resistor CF1/4W103JRC
R7 2.2K 5% 1/4W Resistor CF1/4W222JRC
R8,R15,R17 1K 5% 1/4W Resistor CF1/4W102JRC
R9 220 5% 1/4W Resistor CF1/4W221JRC
R11,R19,R20,R22 100K 5% 1/4W Resistor CF1/4W104JRC
R12 100K Potentiometer 3362P-1-104LF-VP
R13 10M 5% 1/4W Resistor CF1/4W106JRC
R16,R21 1M 5% 1/4W Resistor CF1/4W105JRC
R18 150 5% 1/4W Resistor CF1/4W151JRC
C1,C3,C6,C15,C16 100nF Capacitor SR215C104KAA-VP
C2,C5,C8,C12 1µF Capacitor R1/50-VP-R
C4 33pF Capacitor 140-50N5-330J-RC
C7 47nF Capacitor 80-C320C473K5R5CA
C9,C10 22pF Capacitor 140-50N5-220J-RC
C11 22µF Tantalum Capacitor TAP226K016SCS-VP
C13 100µF Capacitor R100/50-VP-R
C14 470µF Capacitor R470/50-VP-R
C17 10nF Capacitor 80-C320C103M5R5CA
D1,D2 1N914 Diode 1N914
D3 Red LED UT0344R-41-R
Q1,Q2,Q3 2N3904 Transistor 2N3904
U1 Comparator Dual 18 Volt 36 Volt LM393AN
U2 HEX Inverting Buffer/Converter CD4049
U3 Standard Timer Single LM555CN-R
U4 Standard Regulator 9 Volt 2.2 Amp MC7809CTG
K1 12V SPDT Relay 677-OUDH-SS-112D
TB1 Terminal Block 651-1727010
J1 2.5mm x 5.5mm Jack 712A
T1 12V 200mA Wall Transformer DBU120030G8970