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 ft. 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 inches 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)
(P/N 136654)
  • a. Crystal Oscillator
  • b. Drivers

  • 40 kHz Ultrasonic Sensor Set (Receiver)
    (P/N 139492)
  • a. 68 dB Amplifier
  • b. Cascade Voltage Doubler
  • c. Threshold Detector
  • d. 70 Hz Oscillator
  • e. One-Shot (Monostable Multivibrator)
  • f. 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:
    Part Description Jameco P/N
    R1 3K 5% 1/4W Resistor 690970
    R2 150K 5% 1/4W Resistor 691382
    R3,R10,R14 330K 5% 1/4W Resistor 691462
    R4 1.8K 5% 1/4W Resistor 690929
    R5 470 5% 1/4W Resistor 690785
    R6 10K 5% 1/4W Resistor 691104
    R7 2.2K 5% 1/4W Resistor 690945
    R8,R15,R17 1K 5% 1/4W Resistor 690865
    R9 220 5% 1/4W Resistor 690700
    R11,R19,R20,R22 100K 5% 1/4W Resistor 691340
    R12 100K Potentiometer 254036
    R13 10M 5% 1/4W Resistor 691817
    R16,R21 1M 5% 1/4W Resistor 691585
    R18 150 5% 1/4W Resistor 690662
    C1,C3,C6,C15,C16 100nF Capacitor 544921
    C2,C5,C8,C12 1µF Capacitor 330941
    C4 33pF Capacitor 2112903
    C7 47nF Capacitor 2112911
    C9,C10 22pF Capacitor 2112920
    C11 22µF Tantalum Capacitor 545852
    C13 100µF Capacitor 29964
    C14 470µF Capacitor 93827
    C17 10nF Capacitor 2112938
    D1,D2 1N914 Diode 36311
    D3 Red LED 152751
    Q1,Q2,Q3 2N3904 Transistor 178597
    U1 LM393 212177
    U2 4049 13055
    U3 LM555 27423
    U4 7809 876352
    K1 12V SPDT Relay 2112946
    TB1 Terminal Block 2112954
    J1 2.5mm x 5.5mm Jack 281842
    T1 12V 200mA Wall Xfmr 249236