Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Ultrasonic Transducer Alarm

Status
Not open for further replies.

hugoender

New Member
I would like to create an ultrasonic alarm. Yes, I have done a search through these forums and found some posts on this subject. However, they do not have what I need/want.

Basically, I have the transducers, 555 timers, PICs, transistors, etc. I believe I have all the components required to make a simple alarm system. I will place this alarm system in a hallway/doorway and have it switch a relay when someone walks by. I will then connect this relay to a wireless doorbell that I have laying around. This way, when someone trips the alarm, the relay will "press" the doorbell button (by press I mean close the circuit as if the button were pressed) which will in turn send the signal wirelessly to the doorbell box in my room which will then output the sound.

I just want some general direction and if possible even a rough schematic of how to carry this out. The ultrasonic transducers operate at 40kHz so I can use the 555 timer to create this or even a small PIC (such as the 12F509) to make sure I have the exact frequency and not have to tune it. I know I will need two ultrasonic transducers (a short distance apart) one to transmit the signal and the other to receive the reflected signal.

What I am not too sure on is how to make the receiver side. I am guessing I will need transistors or an op amp to amplify the signal coming from the ultrasonic receiver transducer. How do I get it to activate when the frequency it receives is different from the 40kHz being transmitted?

Any help will be greatly appreciated. I am very excited to start this project but since I still do not have time to sit down and start prototyping/calculating, I can only come here and inquire as to how I should go about it before I actually start :)
 
Last edited:
A PIR motion sensor will do what you want.
Don't use a power-hungry relay, use a transistor to "press the button" on the wireless doorbell. The output of a PIR motion sensor might press the button.
 
How do I get it to activate when the frequency it receives is different from the 40kHz being transmitted?
Use an XOR gate with the original 40 KHz, followed by a low pass filter to a PIC A/D input.

When the frequencies are exactly the same (no motion) the phase detector output will be steady (at some value, you don't care). When the phase detector output begins to change, you have motion (doppler effect but you already know that). The frequency of this phase detector output (after the low pass filter) will occur at the difference between transmitted and received frequencies.:)

Note that this method does not require the transmitted frequency to be accurate.:D
 
A PIR motion sensor will do what you want.
Don't use a power-hungry relay, use a transistor to "press the button" on the wireless doorbell. The output of a PIR motion sensor might press the button.

Well I don't have a PIR motion sensor so for now an ultrasonic transducer will have to do (although I have thought about purchasing a couple of PIR sensors).

I like your idea of the transistor. I just bought a relay so I didn't even think about using a transistor as a switch. But you are right, I should.


Use an XOR gate with the original 40 KHz, followed by a low pass filter to a PIC A/D input.

When the frequencies are exactly the same (no motion) the phase detector output will be steady (at some value, you don't care). When the phase detector output begins to change, you have motion (doppler effect but you already know that). The frequency of this phase detector output (after the low pass filter) will occur at the difference between transmitted and received frequencies.:)

This is a little over my head but I am up for the challenge. Digital is not my strong suite and so I would have to do some research on gates (I know theoretically what a XOR gate does but not how to apply it) and how they are to be connected in a circuit. Are you saying that I connect a 40kHz signal to one input and then the received signal on the other input so that when there is a difference in frequency it outputs a digital 1? Or do I have to convert the analog signal to a digital one before connecting it to an XOR gate? If I have to convert, is that what the PIC A/D input is for? I do not know much about the A/D input of the PIC (apart from that it exists). I just started using PICs and haven't had much time to go that in depth with it. Any help or clarification on this would be great. I love learning new stuff :)

As far as the low pass filter is concerned, am I creating an RC filter with a cutoff at 40kHz or what? Is this low-pass filter the part of the circuit that allows the difference in transmitted and received frequencies to pass through? A little explanation on the exact function of this low pass filter in this circuit would be great.

Thank you guys for your replies. I really appreciate it.
 
You first amplify the received signal and make it a square wave. Then put it on one side of the XOR. You original 40 kHz goes on the other side. The output of the XOR is a digital 1 when the phases are opposite, and a digital 0 when they are the same. In between it's a mix of 1's and 0's in proportion to the phase difference.

The output of the XOR gets filtered with a low pass filter, maybe 1000 Hz. The output of the filter is an analog signal according to the phase difference between the two inputs to the XOR. If the frequencies are different, then the analog signal will contain the difference between frequencies.

A person traveling within the field should generate frequencies up to 600 Hz (4 feet per second). You also don't want to react to very low frequencies, since atmospheric conditions might trigger you.

If you want to do more in analog, then add a low pass filter at about 20 Hz before detection, and use a comparator to trigger on the resulting signal.
 
Last edited:
1) How would you make the signal a square wave?

2) The origianl 40kHz that goes on the other side would be an analog signal right? So does that mean that gates accept analog signals and not just digital signals?

3) How did you calculate the frequency and it's corresponding speed (for example, the 600Hz = 4 ft/s)?

Thank you very much for all this info. I do not understand the last section of what you typed (the low pass filter at 20Hz and the comparator. I have heard of comparators but am not completely familiar with them) but I will do some more research before asking questions on it.
 
The comparator circuit senses input voltage levels, and therefore transistions when input level exceeds a predetermined threshold (Set by designer). Compare circuits are either high or lowat there output, thus sine in, and sine exceeds threshold, comparator outputs a high. When sine falls below threshold comparator output goes low. Ergo, sine in square out. Word of caution here: In the case of sine inputs it is wise to use a comparator with hysteresis to prevent false triggering. I think a schmidt trigger device does this.
Schmitt trigger - Wikipedia, the free encyclopedia
 
Last edited:
1) The return signal would be made a square wave by amplifying it and applying it to a Schmidt trigger as Mikebits says.

2) The original 40 kHz that goes in the other side was probably digital at some point. Otherwise amplify and Schmidt trigger as in (1).

3) The speed of the person divided by the speed of sound in air (about 300 m/s) determines the Doppler shift. The round trip distance for the sound is actually increasing/decreasing at twice the rate of the person's movement. So if the person is moving at 1 m/s the Doppler shift is 2/300. Multiply this figure by 40 kHz and you have a shift (40,000*2/300), about 270 Hz. (1 m/s is probably the fastest you'll see someone move indoors; 0.05 m/s is probably a good lower bound, or 13 Hz.)
 
This actually works pretty well:

https://www.electro-tech-online.com/custompdfs/2008/07/k49-1.pdf

and here's an "interesting" design:

**broken link removed**

Thank you very much for those links. They were very helpful. The thing with just building it from someone else's schematic is that I am not learning much. That is why i want to make my own schematic (even if it ends up looking like one of these by the time I am done). I want to understand every part of the project.

One thing that holds me back from understanding a lot of things are transistors. I know you can use them to amplify voltage, current, and even as a switch but I don't know what the difference in configurations are and when one is used over another (common emitter, common follower, etc.). Don't worry, I am not expecting to be hand fed and so I will do my own research on this topic.

Edit: It is a sad day when you have graduated from a reputable university with a degree in electrical engineering and you do not know the most basic of things :(

I do however know how to make an RF transceiver! (my senior project) :)
 
Last edited:
Well here is a rough sort of flow diagram on how I think my circuit might be able to work. I made this in paint but I think I did a damned good job :D

Let me know if there is anything I am missing besides the obvious components like resistors, capacitors, etc.

I believe the signal coming out of the 555 timer is essentially a square wave correct? If so, I would not have to convert analog to digital. Or does the reflected signal come back analog and so I have to convert it to digital before passing it through the XOR gate? Also, is it okay to connect the output of the XOR gate to a transistor?

Thanks again for all of your help.

Edit: The ultrasonic transducers will not be placed facing each other. They will be placed next to each other so that the signal has to bounce off the target and come back to the receiving transducer.
 

Attachments

  • ultrasonic alarm.GIF
    ultrasonic alarm.GIF
    10.6 KB · Views: 252
Last edited:
That circuit will never work. Without some way of locking the two signals together, they will never be in phase with each other. An XOR will only work if you can guarantee it is phased and frequency locked. Due to the fact that a 555 is thermally unstable your two oscillators will never be the same frequency. Even if the frequency was dead nuts on, you would still have to be phase locked.
 
That circuit will never work. Without some way of locking the two signals together, they will never be in phase with each other. An XOR will only work if you can guarantee it is phased and frequency locked. Due to the fact that a 555 is thermally unstable your two oscillators will never be the same frequency. Even if the frequency was dead nuts on, you would still have to be phase locked.

I knew it was too easy :)

Time to brain storm again.
 
See here is your problem. Notice in the diagram, both inputs to the XOR are same frequency but different phase so XOR outputs a false detection.

In order for this to even have a hope of working, you need to use the same oscillator for your TX and RX, see modified image of your original drawing.

I do not know how to calculate doppler shift, I think it is V= (deltawavelength/wavelength)x speed of light

V is velocity but I am not sure of the units. meter/sec maybe?
 

Attachments

  • XOR.gif
    XOR.gif
    9.4 KB · Views: 201
  • ultrasonic%20alarm copy.gif
    ultrasonic%20alarm copy.gif
    9.4 KB · Views: 232
The XOR itself will almost always have a voltage on its output. You have detected a moving object when that voltage changes. You need a band pass filter at the output of the XOR so you only respond to frequencies between about 20 Hz and 500 Hz. I explained this earlier. If you read it and still don't understand, please ask questions.

I also explained how to calculate Doppler shift. If I need to further clarify, please ask questions.

The speed of light has nothing to do with the Doppler shift of sound.
 
Last edited:
The XOR itself will almost always have a voltage on its output. You have detected a moving object when that voltage changes. You need a band pass filter at the output of the XOR so you only respond to frequencies between about 20 Hz and 500 Hz. I explained this earlier. If you read it and still don't understand, please ask questions.

I also explained how to calculate Doppler shift. If I need to further clarify, please ask questions.

The speed of light has nothing to do with the Doppler shift of sound.

I understood your side of it but i was wondering if I could do this without the filter. I thought the XOR gate only outputed high when inputs differed and remained low when inputs were equal. I know low does not mean 0V but if the difference between low and high is reasonable enough, then i can just add a resistor so that the low voltage is dropped enough so that it does not "activate" the transistor while the high voltage is still large enough after the drop to activate the transistor.

Correct me if I am wrong in anything I have said. I do not mean to dismiss the information you have given me, I am just merely playing around with the circuit to gain a better understanding of what is possible and what is not. I really appreciate all of your input. It has been very helpful.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top