Dangerous Prototypes

In development => Project development, ideas, and suggestions => Topic started by: zippys123 on November 25, 2011, 10:07:12 am

Title: DIY ultrasonic range finder
Post by: zippys123 on November 25, 2011, 10:07:12 am
Hi guys,

 i have been trying this project  low cost diy ultrasonic range finder i came across this (sorry guys i cant insert URL DPforum does not allow )
i want to build in house for my friends in a college starting a robotics projects but limited
money but have components from lab if anyone can help simplfy this would be really helpfull
and can the PIC chip replaced with an attiny?


thanks guys find the attachments below...
Title: Re: DIY ultrasonic range finder
Post by: BrentBXR on November 28, 2011, 12:15:26 am
how low cost? You can find some pretty decent pre-built range finder boards for cheap.
Title: Re: DIY ultrasonic range finder
Post by: flubberlab on November 28, 2011, 01:33:01 am
Looks interesting to do it all from scratch. Here is an alternative if you want some really low-cost pre-built stuff.

Some of the older Polaroid cameras used real ultrasonic range detection--up to 30 feet, I think. Just tear out the appropriate parts and add your controller chip.

I have been finding the cameras--especially the Spectra model--occasionally at local thrift stores (e.g. Goodwill) for less than $5. The big round ultrasonic transducer is visible and easily identifiable.

Other consumer products that use ultrasonic detection are home intrusion alarms and garage car parking systems. I have found both in thrift stores for cheap as well.
Title: Re: DIY ultrasonic range finder
Post by: BrentBXR on November 28, 2011, 01:52:45 am
I dont see why you wouldnt be able to use an AVR instead of a PIC. AVRs and PICs are basically the same, the differences can be fixed using a different model or whatever.

I dont understand what the MAX232 is doing. It has the communication likes (both TIN and TOUT) going to one ultrasonic speaker? Is that perhaps to generate higher voltage? Also do you have more details on this? Non of the parts are marked, how do you know what resistors to use, caps to use, and so on.. Or even what voltage that VCC should be.
Title: Re: DIY ultrasonic range finder
Post by: jbeale on November 28, 2011, 05:02:13 am
It's fun to design and build things yourself, but just be aware of what's out there...  The Pololu ultrasonic rangefinders are under $25 each (complete unit, assembled), see for example: http://www.pololu.com/catalog/product/726/pictures (http://www.pololu.com/catalog/product/726/pictures) 
They have a family of units, with different beam widths and ranges.  The data sheet includes the complete schematic they use, have a look. Besides the transducer it's basically a PIC16F676, a LM324 quad opamp, and a BAV99DW (pkg. of 4 matched diodes).
http://www.pololu.com/file/0J68/LV-MaxS ... asheet.pdf (http://www.pololu.com/file/0J68/LV-MaxSonar-EZ0-Datasheet.pdf)
Title: Re: DIY ultrasonic range finder
Post by: zippys123 on November 28, 2011, 07:45:47 am
it's based on this guys check it out
http://www.robot-electronics.co.uk/htm/srf04tech.htm (http://www.robot-electronics.co.uk/htm/srf04tech.htm)
Title: Re: DIY ultrasonic range finder
Post by: Gael on November 28, 2011, 11:21:24 am
[quote author="BrentBXR"]I dont understand what the MAX232 is doing. It has the communication likes (both TIN and TOUT) going to one ultrasonic speaker? Is that perhaps to generate higher voltage? Also do you have more details on this? Non of the parts are marked, how do you know what resistors to use, caps to use, and so on.. Or even what voltage that VCC should be.[/quote]

Hello!

The MAX232 in US rangers is a "classical" trick. It's used as an amplifier to drive the piezo US emitter which ideally needs a differential "high" voltage swing to "ring" properly.
The TTL signal from the PIC is converted by the MAX232 in a +-10V (Then 20V in total amplitude) voltage swing thanks to the charge pumps.

Hope this helps,

++
Gael
Title: Re: DIY ultrasonic range finder
Post by: bearmos on November 30, 2011, 04:08:13 pm
Interesting to do a range finder from scratch, i noticed there weren't any values on the schematic? 

Re MAX323: at first, I was wondering how the RS232 slew rate of 30V/uS might affect things, but it looks like the LM324's slew rate is only 0.5V/us, so it shouldn't be an issue.

What's the advantage of using higher voltages, stronger waves == more distance, or is it a function of the specific transducer you're targeting?  For example, I think the pololu design simply uses 5V.
Title: Re: DIY ultrasonic range finder
Post by: Gael on December 02, 2011, 09:09:43 am
Hello!

An emission with more "pressure" gives a longer range and also a better/simpler reception stage.
Title: Re: DIY ultrasonic range finder
Post by: erdabyz on December 03, 2011, 12:57:27 am
[quote author="zippys123"]it's based on this guys check it out
http://www.robot-electronics.co.uk/htm/srf04tech.htm (http://www.robot-electronics.co.uk/htm/srf04tech.htm)[/quote]

Long time ago I cloned that exact sensor.  I copied the PCB layout basing on pictures and intuition and just changed things so that there were no vias under IC's. I etched the board at home and made the vias with pieces of copper wire soldered on both sides. That's why it was neccesary to have no vias under IC's. This was the result:

(http://http://imageshack.us/photo/my-images/837/imgp1543.jpg/)
(http://http://imageshack.us/photo/my-images/163/imgp1544z.jpg/)

I attach a zip with the required files. There's a .pcb FOR EXPRESSPCB (that was the PCB layout program I used in that moment) and also there are some PDF files with the photomasks for top and bottom layer and both soldermask layers, if someone wants to make it at home. There's no schematic so you'll have to figure out where the components go looking at the .pcb. I copied the EXACT schematic of the SRF04, no more and no less. Nothing changed there. There is a hole next to one of the mounting pads for the ultrasonic transducers. It acts as a via (you can't solder the transducer's lead on both sides) , so solder it before soldering the ultrasonic transducer.

I used these: http://www.futurlec.com/Ultrasonic_Sensors.shtml (http://www.futurlec.com/Ultrasonic_Sensors.shtml) (part code US1240).

Everything worked perfectly and accurately. I still have the sensor. I did a quick project attaching it to a servo to make a sonnar. A processing script communicated to an arduino, which controlled the servo taking measurments every 1ยบ rotation and the result was plotted. I'll post it if I find where the files are :P.
[attachment=0]
Title: Re: DIY ultrasonic range finder
Post by: BrentBXR on December 03, 2011, 03:03:58 am
[quote author="erdabyz"]Here is my super sweet, self etched PCB! (he didnt really say this but its all you need)[/quote]

how did you self etch such a nice looking PCB? The traces look a bit dodgy but im sure it can be made sharper using a mode in-depth etching technique;

specificly where did you get the green board? All i can ever find is the only egg white ones. I would love to get some orange PCBs to etch myself; for small, quick, dirty, & one time boards. Otherwise its iTead all the way (so cheap!).
Title: Re: DIY ultrasonic range finder
Post by: erdabyz on December 03, 2011, 11:47:11 am
[quote author="BrentBXR"][quote author="erdabyz"]Here is my super sweet, self etched PCB! (he didnt really say this but its all you need)[/quote]

how did you self etch such a nice looking PCB? The traces look a bit dodgy but im sure it can be made sharper using a mode in-depth etching technique;

specificly where did you get the green board? All i can ever find is the only egg white ones. I would love to get some orange PCBs to etch myself; for small, quick, dirty, & one time boards. Otherwise its iTead all the way (so cheap!).[/quote]

[offtopic]
The PCB isn't green, it's yellow-ish like most fiberglass laminated PCB's. The green stuff is a photosensitive soldermask coating. It's a special UV curable epoxy-based resin that you spread over the board as uniformly as you can, and then you expose it to UV light with a photomask. Exposed areas harden while non-exposed ones remain liquid, so you then clean unhardened product and that's it.

I have a post explaining that here: viewtopic.php?f=2&t=2383 (http://dangerousprototypes.com/forum/viewtopic.php?f=2&t=2383)

The quality of my home-etched PCB's depended very much on the base PCB material. I always bought from the same manufacturer but the photosensitive coating somewhat varied from batch to batch. But I was able to obtain very high resolution and I could do boards for pretty much anything (fine pitched packages, leadless packages... even once I tried (and succeeded) with a small BGA).

However I haven't done any home-etched PCB since I know seeedstudio :P. Thanks to DP I now own a pile of leftover PCB's.
Title: Re: DIY ultrasonic range finder
Post by: bearmos on December 04, 2011, 01:06:55 am
Looks good erdabyz.  I've always considered looking into making range finders (but never really got past the "what if" stage).  There are definitely some savings to be had if you need a bunch.  As usual, I didn't even recognize the board as being DIY at first due to the soldermask:)
Title: Re: DIY ultrasonic range finder
Post by: ian on December 07, 2011, 05:29:14 pm
Nice work, I'm really impressed. Thanks for sharing it!
Title: Re: DIY ultrasonic range finder
Post by: erdabyz on December 07, 2011, 10:00:55 pm
Okay so here's the arduino/processing code I talked about.

Disclaimer: It's MESSY code. With messy I mean that you could find variables with stupid names, strange or unneccesary loops, parts of copy-pasted code with comments from the original author and many other things. It was a very quick project for a demostration and I did it as quickly  as I could. It worked.  No code quality at all and I should feel ashamed. But it worked, I promose.

What you need to do is loading the processing scritp with the arduino connected. You have to modify the line of the script where it selects the serial port to match yours, or else it won't work. A screen will appear. If you click on it and everything is well connected the servo should start sweeping and the measurments from the sensor will be plotted. The actual measurments are in blue line, but when the distance becomes too small to be properly plotted, a red plot of the measurment multiplied by 10 iirc is plotted too, for better visualization. The units are millimeters and the text is in spanish.

I don't remember how you had to connect everything. You'd need a servo and a SRF04 sensor for this, and the connections can be infered from the code.

The pde at the Sonnar folder is for processing (tested in processing 1.2.1) and the pde at Sonnarx10 is for Arduino (tested on a duemilanove with arduino 0.21).


You should get a plot like this:


Disclaimer 2: I don't know if I have uploaded the correct version of both scripts. I did this more than a year ago and it was buried in a pile of other projects. Hope someone gets it working :P

[attachment=0]
Title: Re: DIY ultrasonic range finder
Post by: octal on August 17, 2012, 12:05:45 pm
Where can we find the source codes of the SRF04 sonar module? (couldn't find any hex *.c *.asm files in posted zip)
Title: Re: DIY ultrasonic range finder
Post by: erdabyz on August 17, 2012, 06:27:14 pm
[quote author="octal"]Where can we find the source codes of the SRF04 sonar module? (couldn't find any hex *.c *.asm files in posted zip)[/quote]

Here:
http://www.robot-electronics.co.uk/htm/srf04tech.htm (http://www.robot-electronics.co.uk/htm/srf04tech.htm)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01252129080session_write_close ( )...(null):0
20.01282260672ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01282261448Database_MySQL->query( ).../DatabaseHandler.php:119
40.07742400184Database_MySQL->error( ).../Db-mysql.class.php:273