Ultrasonic range finding - components

"Danny T" <danny@nospam.oops> wrote in message
news:41e6d593$0$41658$ed2619ec@ptn-nntp-reader03.plus.net...
Hi all,

I want to build a simple ultrasonic range counter. I've got
400ST/400SR
transducers. I found a simple schematic here:

http://fly.srk.fer.hr/~nix/Projects/Sonar/Sonar_Shematic.gif
Not a schematic, more of a block diagram.

But I don't need the LCD. I just want to send 40Mhz pulses, wait a few
ms, then start listening for the start of the reply. Can anyone
suggest
the components suitable for the amplifier shown here? As I understand
it, I can detect the range from the time taken between my pulsing, and
the echo, so all I need to do is drive a PIC input high. Somewhere
else
I read that I need to amplify the signal by around 1000 times to do
this?

I did this a little while back. It's more difficult than it first
appears, but not as bad as some people here would have you believe.
Usable results can be obtained without varying the gain on the receiver
amplifier or bandpass filtering the received signal, but it would be
better to have those things in an ideal world.

My device worked well at 8' - 10' which was plenty good enough for robot
work. One interesting thing that I uncovered while working with these
devices was that the transducers are very narrow banded. They are
practically deaf at frequencies that stray very far from their center
frequency (usually around 40KHz, but can be much higher in industry
applications). This is like getting free bandpass filtering by the
device itself. Look up Q factor as it pertains to tuned circuits for
more information on this phenomena. They are not completely immune to
noise (such as hand clapping near the transducer), but with careful
processing of your data you can filter out the garbage. Normal ambient
noise in a house caused virtually no problems.

I used a 741 op-amp as the first stage of amplification and then fed
that straight into one side of a 393 comparator to square up the pulses
and push them up to near 5V. The other input of the comparator had a
voltage divider that set the pins voltage just a few (10-15) millivolts
higher than the DC idling output of the 741. The output of the
comparator was fed to the RB0 interrupt pin on a PIC so that the
received pulses arrival could be timed accurately.

I would send about 5 or 6 cycles of 40KHz signal out the sending
transducer (connected to two PIC pins for generating a 10V signal across
the transducer) and then started a timer running in the PIC (actually
just cleared it to 0). Wait a millisecond or so for the sending
transducer to quit "ringing" and to blank out the directly received
signal. I then turn on the interrupts and the ISR takes snapshots of
the timer and sticks them in a circular queue. At main level I just
crunch on the timer snapshot values at leisure. Granted this is not
ideal if you are seeking extreme precision, but it's plenty good enough
to help keep from running into things.

You really need to have an oscilloscope for playing with this stuff.
This is fairly involved project and you may wish to do something a bit
easier first, like adding sensors to your wheels so you can measure how
far you've traveled and how fast you're going. It also makes it easier
to travel in straight lines. Another thing, infrared sensors are good
for a couple of feet and work fairly well for distance measurement close
up AIUI. They would also be much easier to process.
 
"Danny T" <danny@nospam.oops> wrote in message
news:41e78006$0$73800$ed2619ec@ptn-nntp-reader03.plus.net...
Anthony Fremont wrote:

I did this a little while back. It's more difficult than it first
appears, but not as bad as some people here would have you believe.
Usable results can be obtained without varying the gain on the
receiver
amplifier or bandpass filtering the received signal, but it would be
better to have those things in an ideal world.

I understand, but I'd like to start simple. If I can build something
that's confused by handclaps, I'll post back here and find out why ;-)
You don't need to, it's because handclapping contains a broad range of
frequencies, some of them ultrasonic.

If I'm given a complex schematic to build, I won't understand the
purpose of every component, but building simple and adding to it, I
reckon I'll learn more :)
Yes, experimentation can teach you something in minutes that you may
never understand by just reading about it.

My device worked well at 8' - 10' which was plenty good enough for
robot
work. One interesting thing that I uncovered while working with
these
devices was that the transducers are very narrow banded. They are
practically deaf at frequencies that stray very far from their
center
frequency (usually around 40KHz, but can be much higher in industry
applications). This is like getting free bandpass filtering by the
device itself. Look up Q factor as it pertains to tuned circuits
for
more information on this phenomena. They are not completely immune
to
noise (such as hand clapping near the transducer), but with careful
processing of your data you can filter out the garbage. Normal
ambient
noise in a house caused virtually no problems.

Sounds good. I'm not too bothered by noise for now - if I can get
something up and running, I've then got a "test" bed for plugging
"noise
reduction" in.
As with all but the simplest projects, you want to do things in
managable stages. For example, I spent quite a few hours trying to
understand op-amps. What I learned is that being an expert on op-amp
behavior and usage is a whole career field in itself. :-o However, I
was able to get my 741 to do what I wanted which was to amplify the
output of the transducer. The circuitry involved is quite simple.

At these frequencies, the 741 was not the best choice for the job. It
*was* what I had available and the datasheet indicated that it would
work at those frequencies, albeit with much reduced gain. Normally, I
would have expected that I would have needed to follow the 741 with some
kind of band-pass or high-pass audio filter to keep out the lower
frequencies (and even some pre-741 passive filtering. But my scope
showed that to be unnecessary since the transducers were doing a nice
job of filtering out noise on their own.

I used a 741 op-amp as the first stage of amplification and then fed
that straight into one side of a 393 comparator to square up the
pulses
and push them up to near 5V. The other input of the comparator had
a
voltage divider that set the pins voltage just a few (10-15)
millivolts
higher than the DC idling output of the 741. The output of the
comparator was fed to the RB0 interrupt pin on a PIC so that the
received pulses arrival could be timed accurately.

Sounds easy enough. The 741 I understand just amplifies, but I don't
understand the 393. Does it just go high/low if one side is higher
than
the other?
Yes. It operates very much like an op-amp with very high gain. I
haven't done so yet, but I'd imagine that audio wouldn't sound too good
coming out of it. ;-)

I would send about 5 or 6 cycles of 40KHz signal out the sending
transducer (connected to two PIC pins for generating a 10V signal
across
the transducer) and then started a timer running in the PIC
(actually
just cleared it to 0). Wait a millisecond or so for the sending
transducer to quit "ringing" and to blank out the directly received
signal. I then turn on the interrupts and the ISR takes snapshots
of
the timer and sticks them in a circular queue. At main level I just
crunch on the timer snapshot values at leisure. Granted this is not
ideal if you are seeking extreme precision, but it's plenty good
enough
to help keep from running into things.

I'd like the range to be a bit more accurate than yours, probably 5-20
inches. What would you suggest is better to increase this - bandpsas
filtering (you sugggest this isn't all that important) or altering the
gain? What's the best way to alter the gain? Any particular components
(or at least, any specs I might need) for this? :)
20 inches is no problem, but the problem with 5 inches is the
turn-around time for the signal is less than 1mS. It's workable, but
you start running into the issue of the receiver hearing the directly
transmitted signal first, and not a reflection. I would suggest using
the Sharp IR sensors for the close in stuff and edge detection (so you
won't roll off a table for example). Check these out:
http://www.acroname.com/robotics/info/articles/sharp/sharp.html

You really need to have an oscilloscope for playing with this stuff.

I know, but they're not quite as cheap as a multimeter, so when I've
decided electronics is for me, I'll think about getting one :)
A scope is probably the best single instrument you can own for tinkering
with this stuff. You can pick them up really cheap on e-bay. You don't
need a 650Mhz tripple beam scope, but a dual trace with 20 - 50MHz
bandwidth would be nice for your robotics/electronice/microcontroller
tinkering. You can get them so cheap that you could sell it if you
decide you don't like electronics and not really lose any money.

This looks pretty nice, heck I might bid on it ;-D
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&category=45005&item=3865841987&rd=1
I have a 20ish year old Hitachi 65MHz scope that I got used about 15
years ago. There are plenty of scopes out there for less than $100.00
that will work fine and go a long way towards saving your sanity while
working with PIC chips. ;-)
 
My device worked well at 8' - 10' which was plenty good enough for robot
work. One interesting thing that I uncovered while working with these
devices was that the transducers are very narrow banded. They are
practically deaf at frequencies that stray very far from their center
frequency (usually around 40KHz, but can be much higher in industry
applications). This is like getting free bandpass filtering by the
device itself. Look up Q factor as it pertains to tuned circuits for
more information on this phenomena. They are not completely immune to
noise (such as hand clapping near the transducer), but with careful
processing of your data you can filter out the garbage. Normal ambient
noise in a house caused virtually no problems.


Sounds good.
;-)

I'd like the range to be a bit more accurate than yours, probably 5-20
inches. What would you suggest is better to increase this - bandpsas
filtering (you sugggest this isn't all that important) or altering the
gain? What's the best way to alter the gain? Any particular components
(or at least, any specs I might need) for this? :)

I think here a mistake is made:
to get high time accuracy,
or in other words to get lots of information,
you need the highest possible bandwidth !!
So you need a Dirac puls (infinity bandwidth) and you can detect very
accurate. The yields both for transmitting and reception.
Why do you think they use high bandwitdhs in medical ultrasound (upto
100 MHz) or Radar (upto 10 GHz ?)

I've here a very old digitizer, you can put pictures on it, point with a
special pen to positions on the foto, and the distances on the picture
are measured ultrasone with an accuracy better then 0.1 mm !! AFAIK the
receiver is just a 40 kHz transducer, electrical match to get the
highest possible bandwidth (yes, you must both mechanical and electrical
do impedance matching), and then great trick: the transmitter is a very
small spark bridge, generating almost dirac pulses.

So the very narrow bandwidth only serves 1 goal:
to detect if there's an echo or not,
but not what time travelled the echo.

This is not completly true. In fact the amount of information available
is time*bandwidth. So another (but quiet inpractical way) is to use a
small bandwidth over a large time. But then you've to correlate the
incoming signal with the transmitted signal over the total time. This
used in radar (tsirp modulation).

An other problem with high Q-systems (or in fact the same problem),
whatever sound you put in, you always get you cenntral frequency out ;-)

Stef Mientki
 
"Lord Garth" <LGarth@Tantalus.net> wrote in message news:8%SGd.18886

Post yours on alt.binaries.schematics.electronic ...
I don't really have a full schematic, the majority of the circuit is
identical to the schematic I posted in my own thread looking for some
help. The subject line is "Need help with op-am/comparator circuit" and
the group is sci.electronics.basics. And like I said, it's virtually
identical to the one in the PDF except I had an LCD.

The above link does not have the source code in the pdf with the
schematic. In my opinion, it is incomplete without the code. A hex
file would be nice too so that no compiler is needed.

It was just a tinker toy project, but I could probably dig up the code.
The HEX file wouldn't really be helpfull without an exact schematic of
my circuitry. Besides, it's not a finished product anyway, just a proof
of concept demo. It prints a "P" on the LCD indicating an outgoing
ping, it then just displays the high portion of TMR1 for all the echos
captured, which is a rough estimation of feet to target.
 

Welcome to EDABoard.com

Sponsor

Back
Top