Help with an ultrasonic range finder

lazzymonk

New Member
Hi all

I hoping someone can help me. I have 2 sets of untrasonic transmitters and receivers that I want to use as range finders for a small robot im playing with.

Problem is, I cant figure out how to use them. I found the follwing page that has an example circuit and code, but I dont understand the code (its not picaxe code). and im not sure if the circuit will work with a picaxe.

http://www.micro-examples.com/public/microex-navig/doc/090-ultrasonic-ranger.html

Anybody done any done anything like this before? or able to help?

Thanks
 

Dippy

Moderator
What is your level of electronics and code writing?

Do you know about producing a signal using PWM ?

Once you have produced the correct frequency you will have to amplify it to drive those U/S devices.
I've seen a similar use of an inductor in some apps.

Then , when receiving, you'll probably need to have good filtering and plenty of gain. Then some method for detecting the signal and there are several methods.
Then you'll have to write the code to do the pulsing and timing the reflected signal.

Or you could pay a few quid and get a proper one.
Rev-Ed sell them and for a greater variety check out Devantech Ltd (Robot Electronics).

Some time ago I found on the Devantech site the schematic for one of their rangefinders. It used a MAX232 (or clone) as a driver in a cunning way I seem to recollect.

In that example code he/she has several advantages over PICAXE.
1. Using compiled code he can stop his timer very quickly, far faster than PICAXE can do it.
2. He can do very fast ADCing, maybe >50x faster than PICAXE.
His results will be a lot more accurate than you could do.
Not much point analysing his code much more, it's fairly basic stuff but if anyone wants to impress us with their C knowledge then I'm sure we'll love to hear :)

Downside, range limited with no gain and maybe not brilliantly reliable without some nice filtering.

I'd be tempted to find a better circuit.
Maybe there is something on the Parallax site? Stamp BASIC is similar to PICAXE BASIC.
 
Last edited:

BeanieBots

Moderator
Making a US range finder is not for the faint hearted unless you can find a decent circuit to simply copy. Even then, it is quite a complex thing to get right and layout and component choice can be critical on the receiver side.
You will also NEED a good oscilloscope.
You can't just put one on an output, one on an input, write a bit of code and magically have a range finder. There's a lot more to it than that. It's like just having an aerial and a speaker when you want a radio.
If your electronics experience is not strong, put those transducers to one side for now and buy a module such as the SRF04/SRF05 or SRF08 from Devantech or similar.
These modules have frequently been used with PICAXE and there are plenty of example code snippets.
 

Dippy

Moderator
Impressive.

The trouble is as said by BB concerning the build.
A novice without the skill or test gear will have enormous trouble.
It could involve a thread lasting weeks.:(

An intermediate step wold be use a specialised chip like this.
http://ie.farnell.com/prowave/pw0268/smd-sonar-ranging-smd-ssop20-20/dp/1007371
Read the Technical Data Sheet,

I would still suggest going for the ready-made solution. Small, neat, good quality and, best news, it'll work.
Whatever you choose; good luck.
 

lazzymonk

New Member
Well from you guys expert advice, I have decided off the shelf is going to be the better option for me.

I appreciate the help, im sure you will have saved me lots of time and money.
 
Top