[chbot] Ultrasonic Rangefinding

Richard Jones rjtp at ihug.co.nz
Mon Nov 3 11:40:56 GMT 2008


Carl kindly updated us with his progress on A->D conversion and the list is
quiet so I thought I would send an update on rangefinding.

I wanted a rangefinder for my next micromouse. Designing my own from
scratch seems the most reliable way to go as I want to detect distance down
to about 10mm and as far away as appropriate. I had all this working on the
propeller ages ago, but wanted a version I could program easily in C for
unit testing the rest of the robot modules. The avr atmega8 (~$7) was in my
price range and using gcc (gnu compiler collection) software development is
free. (I know there is now a C compiler for the propeller, but there was
not when I started, and I've started so I'll finish).Here is a link to
schematic:
http://homepages.ihug.co.nz/~rjtp/Micromouse/Modules/RangeFinder/rangefinder.png

The basic idea is to launch a 40KHz pulse of 4 cycles duration and listen
to see how long it takes to bounce back from a maze wall. With the speed of
sound at 20C being approx 334 m/s a pulse repetition rate of 4ms yields a
maximum range of about 600mm, or about 3 maze cells. The receiver has a
tendency to receive the outgoing ping so needs to be more sensitive the
longer we wait for the
pulse to return.

The circuit design used an LM324 a quad op amp IC. Using two op amps as
amplifiers, one as a low impedance half rail and one as a comparator. Add a
transistor to drive an RC time constant to vary the receive threshold with
time I had a circuit that is temperature independent, small, and low cost.
The RC time constant is intended to approximate an inverse square law.
As the LM324 was run close to the 1MHz gain bandwidth product with a gain
of 10 at 40KHz I prototyped the amp and source follower and all was fine.
When I populated the PCB the comparator section was too slow. No problem I
replaced the LM324 with the pin compatible TL084 with a 4MHz gain bandwidth
product. The comparator section was now fast enough but the output voltage
went from 4.3 to 1.7V, not sufficient for the AVR input threshold. Potted
down with a couple of resistors this was fine, but a more elegant solution
was to find a rail to rail op amp with at least 4MHz gain bw. Step in the
TS924. Now I have to construct all 3 circuits, install them in the mouse
and check for microphony and other unwanted interactions. The saga
continues. 

Anyone else have progress to report?

Richard




More information about the Chchrobotics mailing list