Building the PSoC Range Finder
|
|
 Overview The PSoC range finder is a low cost and simple ultrasonic distance meter which can be used for contactless liquid level measurement, generic distance measurements, and robotics positioning. Explanation There are two capacitors, two resistors, two 40kHz ultrasonic transducers, and a PSoC device that comprise this PSoC range finder. The modes available in the system include the calibration mode and the normal mode. The analog and digital blocks are set up by the main program and to initialize whether the normal or calibration mode is determined b the tests for JP1. In normal mode, the software continuously runs the transmitted ultrasonic burst or ping and waits for a returned ultrasonic signal or pong after a period of time. The distance between the PSoC range finder and an obstacle is proportional to the time the start of a transmitted burst and that start of a received burst. The time can be measure by polling the comparator bus register as the RAM stores the time which will be set by the PWM duty cycle. In calibration mode, the measured value is compared to a constant value of 50 although the software is similar to normal mode. Rest of the project
|