Page 1 of 2

Sonar in a chip? I think I need a PIC programer....

Posted: Sat Jan 08, 2005 5:52 pm
by Tinkerer
I need to generate a chirp or click, record a couple of seconds with timestamps, pick the peaks out of the recording to do some math on the time to calculate distances, then transmit the result. Is there an existing chipset that can do this? Do I need to have a custom program written for a PIC? For testing and experimenting purposes software for a PC with a soundcard would be great, but eventually it's all got to fit in a tiny box. I'll worry about the instrument itself, but I don't know how to handle the computer side.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sat Jan 08, 2005 6:05 pm
by Tinkerer
The device only needs to record time and amplitude. Not sure of the ideal sampling rate but I guess 5khz would do.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sat Jan 08, 2005 6:37 pm
by Mike6158
I know of an ultrasonic sensor that is used in a robot whose construction details can be found in the book called "Insectronics" by Karl Williams. He uses it and a PIC to determine distance and then tell the robot to change direction. The module is an xmitter/ receiver pair. It's made by Devantech. Part number SRF04. <p>It can be found here as well as other places...<p>Parallax Website
<EDIT>
Could I have worded the first sentence any worse than what I did? I think not...<p>[ January 08, 2005: Message edited by: NE5U ]</p>

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 7:05 am
by Tinkerer
Thanks but that's not what I need. The transmitter/reciever itself IS the project. I'm building the instrument, I just need the computer that will capture and interpret the sound.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 7:12 am
by Tinkerer
PS the Basic Stamp and software part might be just what I need, tho. I just wanted to clarify that! Thanks.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 7:41 am
by Mike6158
I'm pretty sure that a PIC will cost less and that it programs almost, not quite, exactly like the Basic Stamp chip.<p>Interpretation of the sound would be the part where I would go- "Oh" and slowly back away :D <p>That said, did you check the Microchip website? They have specialty chips called DSPIC's that can be used for signal processing.<p>Not to be hard headed (or nosey) but does the chirp of click have to be audible? If it doesn't then the USM that I mentioned would insulate you from the noise in the surrounding area. At least the audible noise anyway. The SRF04 in conjunction with the PIC causes the onboard transmitter to send a 40Khz ultrasonic pulse. The PIC makes the receiver pause after the sound is sent (100us)and then it waits (36ms)for the reflected wave to return. The output from the USM module is fed to the PIC which calc the distance based on the speed of sound at standard conditions. Adding a temp sensor would let it determine the speed of sound at ÂșC...<p>[ January 09, 2005: Message edited by: NE5U ]</p>

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 10:56 am
by Tinkerer
Ultrasonic won't work in my application.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 10:59 am
by philba
<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by Tinkerer:
Ultrasonic won't work in my application.<hr></blockquote><p>From the initial description, I would think that ultrasonic should work. Can you explain why it won't? And, what would work?

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 11:06 am
by Tinkerer
I really don't know hardly anything about PICs, Basic Stamps, DSP, or programing. That's why the inital post. I only know what I need it to do. I was hoping to hook up with someone that could either point me to something already existing that could work (longshot, I know) or willing to do it for a reasonable fee.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 11:23 am
by philba
Have you googled for a PIC based ultrasonic design. There are a fair number of them out there but, iirc, you have to get a little creative on the keywords. I'm pretty sure I found at least 4 or 5 when I looked a year ago or so.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 3:01 pm
by Tinkerer
The project requires ranging up to several hundred feet. Ultrasonics loud enough to work would have dogs barking a mile away! Look, really, this is not my question. I need a computer/software to catch the echo and process it to determine the distance. It's possible there is computer/software designed for ultrasonic work that could be used and I'd like to hear about. The device I'm attaching it to is what I'm desiging and testing.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 3:11 pm
by rocket scientist
I have done quite a bit of work with TX adn RX of sound. The first thing I wonder about is what you mean by 'chirp'. Chirp normally means (in both sonar and radar literature) a frequncy sweep, which allows you to get, simultaneously,long pulses for increased TX energy and high bandwidth for high spatial resolution. However, this requires some advanced digital signal processing on the RX end.<p>If you can spend the money, I would recommend getting a DAQ pcmcia card and LabVIEW G (graphical) programming software from National Instruments, both of which you can use on a laptop. This will give you almost state-of-the-art-capability in digital active sonar, including ultrasound if you wish. How sophisticated you get will only depend on the software you write. And you really don't have to write software with LabVIEW, you simply connect existing blocks with virtual wires!!!! I find this great for prototyping. If you develop a design you really like, you can then port it to an FPGA chip.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 3:51 pm
by Tinkerer
Ok, forget I said "chirp". I'll need it to send the signal to whatever I decide will make the sound at the same moment it starts the clock to time the echos. I checked those data acquisition PCMCIA cards. They would be great but are WAY out of the budget.<p>Isn't there a way to use the soundcard in a PC to do what I need? That would be suitable for testing but I'd eventually need to scale it down to a very small package like a Stamp or PIC. Can I write a BASIC program to control the sound card?

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 4:11 pm
by rocket scientist
Sounds cards are great digitizers for frequencies up to 20 kHz. You will probably get a good 12 bits of dynamic range from a 16 bit card. You can send your tranmit pulse to the audio channel to provide a time stamp to syncronize your audio channel with the TX. I am almostsure you can read the sound card digital output in BASIC, but I use Matlab to read wave files from the sound card so I can't help you there. Find someone that can help you do this in BASIC and you've got it.

Re: Sonar in a chip? I think I need a PIC programer....

Posted: Sun Jan 09, 2005 5:46 pm
by rshayes
There are devices, such as cameras and ultrasonic tape measures, that use ultrasonic ranging out to ten or fifteen feet. These use very small radiating and receiving areas. A more efficient transmitter and receiver, possibly using horns or focussing devices, might increase the range to 150 feet. Using a corner reflector as the target might also help. Better signal processing, such as low noise amplifiers and tuned, narrow band amplifiers would also help.<p>Optical rangefinders using solid state lasers will easily work at 150 feet, but they require that the time be measured in nanoseconds rather than milliseconds.