8051 and sonar (depth finder)

Hi all,

Recently I am stuck on my first microcontroller project. I think I have everything nailed down to the absolute last detail, but have not yet been able to find a solution to this - after about 6 weeks of looking.

My 8051 microcontroller is trying to determine the ocean floor depth. To do this, it sends out a ping, enables a timer, and counts how long until the echo is returned. Simple enough - right?

My problem is not in the sending of the ping - or in counting the echo return (I use timer0 and expect no overflows), it is simply in getting back a consistant echo. Echos that I do recieve range in time from 500 ticks to 60000. When I turn off my labview echo simulator - I still get the wildly varying and inconsistent results! Help!

I can provide schematics if necessery. For now I will keep it simple by saying I detect echo signals generated from the comparator1 interrupt. An active low indicates a echo. Any help would be greatly greatly appreciated.

-David

Reply to
jentzd
Loading thread data ...

Labview echo simulator?

Does the input signal look good on an oscilloscope? Are you _sure_ you're not getting overflows? If you're getting up to 60000 ticks on a

16 bit timer then you're darn close. Perhaps you have a prescaler set incorrectly and you're just getting the remainder?
--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Reply to
Tim Wescott

Hi David,

Posting a schematic link on your web server or on a.b.s.e. would help.

Normally you need some kind of preamp and filter. The filter would be matched to the length of the pulse train you are sending. Since I don't know what kind of transducer you are using I suggest you inspect the echoes with a scope. I suspect it won't look pretty unless the ocean floor is very smooth and flat and no fish are holding a meeting under the boat. Even then the finite beam width will disperse the echo a bit.

Regards, Joerg

formatting link

Reply to
Joerg

Most of the depth sounder circuits I have seen had a variable gain on the front end .. starts out low for near by echoes and increases over time to compensate for the weaker echoes from distant objects. One big problem with digital (and why I prefer analog "chart type" is a fish, thermocline, change in salinity or any of a number of other "thingies" will give you a false reading shallower than the actual bottom.

mikey

Reply to
Mike F

Hi Mike,

Yes, a time gain control is essential. Nowadays the AD603 is a good chip to do that with. I designed many ultrasound front end circuits for medical and it's the same there, except that we have to be able to see really close up to the transducer. Probably it would be the same in a boat if entering shallow waters without banging up the hull.

Yes, I'd want the same. It is amazing what lays at the bottom of a body of water that is near roads. Whole cars, fridges, piles of discarded concrete and so on. With a really nifty algorithm it should still be possible to calculate where the bottom is but not as good as a true 'M-Mode' readout on a screen. Probably an old laptop would do just fine for that but the question is how long that'll last in a salty environment.

Regards, Joerg

formatting link

Reply to
Joerg

David,

One big question is, "what kind of transducer are you using?" I designed a system about 10 years ago that worked at 400KHz using a tuned piezoelectric crystal. Believe it or not, the transducer itself was fundamental in filtering the echos. By today's fish-finder standards, it was not a very sophisticated device. However it did a great job of determining depth.

Noel

Reply to
Noel Henson

The last boat I was on had a depth meter with some rotating device inside. Probably a rotating mirror. The round scale showed various echos at different depths of which the 'real one' was usually of maximum light output. Knobs were present for depth range (probably different rotation speed) and gain (to set a threshold for the scale to start illuminating)

I guess as a human you know how to read this instrument and ignore 'false' echos. For a uC to do this might be difficult.

Joop

Reply to
Joop

Hi Joop,

That was a real classic. I believe it is a little neon bulb on a rotating disk. Echoes are amplified and the bulb hangs on the output of the amp. I vaguely remember that Heathkit offered on of these. But I didn't have a boat...

Regards, Joerg

formatting link

Reply to
Joerg

The Neon light and rotating disk was a pretty nice solution to the problem in simple digital depth sounders of which echo do you call the bottom? With the disk rotating at a constant speed, it would "time" the echoes for you and show all of them.

Years ago I built a similar system for scuba diving, but it used a set of counters selecting LED's out of a matrix, with the detections, illuminating the selected LED. I started testing this thing in a pool and found that the pool surfaces were so reflective that the entire pool (olympic size) saturated with sound. I put a scope on the receiver and it showed continuous output. First I thought that the receiver was oscillating, so I took another transducer to the far end of the pool and the amplitude on the second transducer showed the same continuous signal. The amplitude change from the transmit pulses was not visible at all. The same piece of equipment worked fine in a local quarry.

Bob

Reply to
MetalHead

Yep, it was Heathkit. I put one together for my first sailboat in

1974. It did, indeed, use a neon bulb on the rotating disk. The rotation speed of the disk translated to the time for the round trip of the sonar pulse. IIRC, it was calibrated by adjusting the disk rotation speed, and the disk triggered the output pulse at the index position. There was also a receiver gain control that you could adjust to limit multipath echoes and noise.

Mark Borgerson

Reply to
Mark Borgerson

That's why sonar devices are tested in anechoic pools...

Reply to
larwe

It could very well have been an oldy. The light did seem a rectangular red LED though, not a neon bulb. I do seem to recall some spinning noises so I a rotating disk could have been involved. That would make powering the device simpler (12V board power on boats?). Perhaps I should have said ship. The whole vessel was quite big, 3 masts with sails (http://212.204.218.222/hanzestad/schepen/schip.php?id=42)

If I would have forseen this discussion I would have paid more attention ;-)

Reply to
Joop

Hi Joop,

Wow, that is a big ship. Dance floor and all. But 160 passengers and only eight restroom stalls? What if half the people on board got seasick....?

I'd think this ship deserves a much better echo system. You could use an old scope as a display to make it look somewhat antique. Unless, of course, you have to comply with the devices from a certain era. An LED on a disk sound like half-hearted retro design though. But in the time of three-masters they did not use echo. Well, it hadn't been invented yet. They had a rope with regular knots that was let down once in a while and, after the rope handling sailor had spit his chew tobacco into the sea, the depth was hollered to the bridge in 'fathoms'.

Groetjes, Joerg

formatting link

Reply to
Joerg

Hi Bob,

Hard reflectors are the enemy of every sound system. In my field of work it's situations like calcified blood vessels, bones or metal objects such as an artificial heart valve that make things difficult. But we always try our best to provide the largest possible dynamic range and good gain control. That, and matched filtering, would also help in depth sounding. On a ship this can become crucial when navigating a shallow area where the sea bottom consists of hardened lava or rock.

Regards, Joerg

formatting link

Reply to
Joerg

Hi Joerg, It was 25 years ago (A long time ago, in a Galaxy far far away) that I built that hand held sonar system. Today, with many years of experience as an engineer, I understand about dynamic range. As a kid fresh out of high school, it was a fair surprise. Then again, that's where experience comes from! I am still a little surprised that with the 1% duty cycle of the transmitter, the amplitude in the pool did not decay measurably between pulses.

Regards, Bob

Reply to
MetalHead

Hi Bob,

My foray into ultrasound started about 20 years ago and yes, at that time I also was a total rookie when it came to acoustics. Until a few days before the interview for my first job I wondered what the heck they would do with depth sounders on humans.

The duty cycle doesn't really matter much. It's the pulse amplitude and the path attenuation. Water is an almost ideal sound conductor and plaster walls are nearly ideal reflectors. At least until the pool gets old and chlorine or the occasional pH value drift takes its toll on the walls. Same for the bottom and the water surface on top. If the pool was tiled the reflection would be almost perfect. In a pool you get so many reflections back and forth that a short burst will create a plethora of echoes for a long time.

Regards, Joerg

formatting link

Reply to
Joerg

LOL. The ship does not go on long trips anymore. It is primarily used for daytrips with companies, organisations and such. It also does not go onto rough seas, probably for the same reason. We did have a nice bit of wind without getting to storm level. Some people did spend their time being really quiet in some corner inside or below deck ;-) No continues run to the restrooms though...

You are maybe getting overly romantic now. I seem to recal from the captain that the whole ship is from around 1900, so not super old. But even a "retro design" of those days may be fine if it functions similar as classic sail ships. And as far as I can judge it has been done with a fair amount of good taste.

Over the years it has been equipped with plenty of modern stuff. Radar screen, the mentioned depth meter and more. The radar screen also showed the rain areas. Because of the wheater it had the captains interest. More than the depth meter because this water is very familiar to the crew. It only was switched on because I liked to play with it ;-)

Joop

Reply to
Joop

Whats a 'radar mile' in water? 12usec per nautical mile out and back is the radar rule of thumb. Is speed of sound in water 15000 fps? So is there a 'blind spot' at multiples of the ping prf like in radar?

Reply to
BobGardner

IIRC, the speed of sound in seawater is about 1500m/second. It varies slightly with salinity, depth and temperature.

Depth finders usually use fairly low PRFs---perhaps on the order of 1 to

5Hz. At 1Hz, that would allow depths of up to 750m without a 'blind spot. 5Hz allows up to about 150m without problems. Most simple depth finders can't put out enough power or receive enough signal beyond about 400 feet in any case.

For shallow waters, up to a 100 feet, you can use much faster PRFs.

Mark Borgerson

Reply to
Mark Borgerson

Hi Mark,

You could also use PRF staggering and a piece of nifty software to sort out alias echoes from the real one. Same in Radar. Its just not done in some systems, but it could.

Regards, Joerg

formatting link

Reply to
Joerg

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.