Free electronic circuit | Almost Ultrasonic Motion Sensor

Almost Ultrasonic Motion Sensor | Security System

This sensor uses the sound generator in the RCX to make a 15kHz audio tone, which is almost ultrasonic. The tone is received with circuitry similar to my Sound sensor. The output of a crystal microphone MIC is amplified and then only the very high frequencies are further amplified (see plot). This signal is enveloped detected with a diode D1 and capacitor C1. The voltage on the capacitor will equal the average volume of high frequency sound the microphone is picking up at any moment. Motion of objects near to the RCX and microphone cause the volume level to vary as the signal path and distance between them changes. The variation in level is further amplified and fed to the RCX. The RCX sees a level of about 31 when there is no motion, and peaks to over 50 when there is rapid significant motion.

The circuit diagram is below. An LM324 quad Opamp is used for all stages, and the diodes are all 1N4148s.

This is a plot of the frequency response of the High Frequency Amplifier stage. The gain has been set to peak at about 15kHz so that interference from other sounds is minimized.

Here is a photo of my finished sensor. I built it on a piece of PC board and mounted it inside of a LEGO #5391 9V Battery Box. The microphone is attached to the end with double face foam tape.

Here is how I tested the circuit. The RCX has a Visual Basic program that produces a 15kHz tone and watches the input for levels over 33. If is sees one, it turns on an output which just has a light hooked up to it. The operating range depends on many mechanical factors. It can pickup motion of large objects 8" away while small objects may need to be only a few inches between the RCX and the microphone.

Here is the very simple VB code:

.BeginOfTask 0  .SetSensorType 1, 3  .SetPower "0", 2, 7  .Loop 2, 0   .PlayTone 15000, 25   .If 9, 1, 0, 2, 33    .On "0"   .Else    .Off "0"   .EndIf  .EndLoop  .EndOfTask

No comments:

Post a Comment