Let's Make Robots!

Cheap Sonar

One of the most important parts of a robot is it's sensors. If it cannot sense it's surroundings then it cannot respond. Unfortunately good sensors are usually expensive. For this reason I am always experimenting with cheaper home made alternatives such as my light up antenna, conductive foam touch sensor, IR obstacle detector and my not so successful laser range finder.

I have found that IR sensors are not the most reliable as they are affected too much by daylight. Sonar is more reliable but still has problems with soft objects such as curtains.

When Dagu added their asuro sonar to the components it got some attention because of it's low price. Dagu had already sent me 2 to experiment with but the design had extremly limited range and was not easy to interface with picaxe processors.

Dagu has asked me to design a cheap sonar that will address these problems especially as the cost of currently available sonars makes them poor choices for mass producing LMR robots.

I have succeeded in creating a sonar based on the LM324 quad op-amp which is a relatively cheap IC ($0.25 US from futurlec), a few capacitors and a handfull of resistors.

So far it can detect a broom handle at up to a meter and a dvd case at about 2 meters. A wall at over 3 meters. The schematic below is my design so far. Only the reciever has been tested as I was using a transmitter from a previous version.


For those wishing to build their own I am using prices from Futurlec as a guide since they are cheap and deliver world wide. A pair of long range ultrasonic transducers will set you back $3.90 US. The rest of the components including the IC less than $3 US (use metal film resistor and polyester film capacitors as they are more accurate). A circuit board is the only other thing you'll need. Prototype boards cost about $1.50 to $2 US but can be cut down to make several sonars. If your really on a tight budget then use cardboard.



I was expecting to have this all finished today after everything was going so well with the reciever. But Fate is a fickle mistress and today she stuck her foot out as I went by and laughed as I fell :(

Part of the problem was I didn't have the timing capacitor I needed and I tried working with different values. I also suspect that having components pushed into a breadboard is not as reliable as components soldered into a PCB. I'll sleep on it and try again tomorrow.

Sorry CTC, you'll have to wait a little longer. Perhaps Fate will be in a better mood tomorrow.


After much trial end error I succeded in getting my fourth amplifier to drive the output transducer at 40Khz but due to limitations of the LM324 I could not get the output past 3Vp-p so I have now used a slightly improved versions of my original transducer driver at the cost of an extra IC (also 25c US from Futurlec). This now gives me almost the full 5V of the supply peak to peak and the frequency is less dependant on the supply voltage for better reliability.


I will test this new design tomorrow when I get a 74HC00.



Well my car had a bad leak in the power steering and is only just back on the road. I've just got the 74HC00 and haven't had a chance to test it yet. Some may prefer to use a 555 timer instead. It doesn't really matter. You could even drive the transducer directly via PWM from the processor.

I only added the oscillator because for picaxe users, the PWM commands use the same timer used for servo commands and because only certain pins can be used for PWM. I figure if it is easy to use with picaxe and it's slow basic language then it is easy to use with any processor and any language.

When I have it working with a picaxe then I will post video and code.




I am still finding ways of improving the design so be patient. I am happy with the range overall and am focusing on eliminating noise for a more reliable reading.


The 120pF capacitors in parallel with the feedback resistors help filter out the noise. I am still experimenting with the design at this point. The first video shows this circuit working but with only one of the three filter capacitors. I'll have to get more caps.




40LT12_spec.pdf290.75 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
I've never seen a transducer driven that way before. Could it be that the problem you're having is because of the switching delay of the gates? It looks to me like one side of the transmitter would get switched before the other, greatly reducing the drive. Also, I question the price aversion to the 555. Even in single quanity they are under $.40 and would provide more drive to your transmitter. Just asking.

The transducer is virtualy open circuit as it is a piezo device and does not require current to drive it. On the oscilloscope this design gives me 5Vp-p from a 5V supply. The slight difference in time is not an issue at these low frequencies and only makes the duty cycle not quite 50%. Cmos devices are better for driving this as their output can go rail to rail.

The price of a 555 timer from my local store is $1.25 for ttl and $3.45 for cmos AUD. The cmos is the better choice to drive the transducer. The 74HC00 from the same shop is $1.00 AUD.

Either works well so it is a matter of personal preferance. 

why dont you use a 555 for the transmitter?

If you have a 555 timer handy then it will work just as well.

I did not use a 555 timer because it is more expensive and I am trying to keep the price down. This will end up being produced by DAGU in the near future.

The latest schematic is still not fully tested yet as I am waiting on parts. I suggest breadboarding it first before making any PCBs.

could i use 1uF or 0.01uF caps in place of the 0.1uF caps?

I wouldn't use larger values like 1uF as they will allow any lower frequency noise to pass through. You could try 0.01uF. I just had lots of 0.1uF handy. and found they worked fine. If you use too small a value then it will not let the 40Khz through very well and you will reduce the gain.


so will LMR now have its own "brand" of ultrasound sensors?

Hmm... the Oddbotix ultrasound made by DAGU with a Brainbot logo..... 


Perhaps I should just get it working first? I still have problems with the transmitter even though by rights it should be the easy bit.

You need a pay-pal link, I swear...
Keep up the good fight Oddbot !