Issue
150 January 2003
The
PSoC RangeFinder
A
Simple Ultrasonic Distance Meter
THINGS
TO CONSIDER
I
used the 28-pin CY8C26443 microcontroller because of
its availability; however, you can use the eight- (if
you don’t use the LCD) or 20-pin versions for a smaller
PCB. With the LCD connected, you can display useful
information while setting up and calibrating your own
PSoC RangeFinder.
It’s
easy to change the program if you’re thinking about
modifying the device’s behavior. Because any one of
several obstacles can surface at any time, the ultrasonic
distance meter can make mistakes during the measurement
process. However, if you want to prevent measurement
errors, you can modify the software to calculate the
average value of several measurements and discard the
measured values that are out of range.
The
measurement process is based on a typical air temperature
of 22°C. This can be limiting when the specific application
involves a wide operating temperature range.
If
you use a 28- or 20-pin integrated circuit, there will
be a lot of free pins in the PSoC microcontroller. It
would be an improvement to implement an external integrated
temperature sensor to measure the air temperature. Because
of its low accuracy (± 20°C), the internal FlashTemp
module isn’t suitable for the job. But, if you want
to increase the precision, you can calculate and compensate
for the different sound velocities at different air
temperatures.