An ultrasonic range finder is a useful tool in a variety of real-life and robotic applications, such as in obstacle avoidance and distance measurement systems. The ultrasonic range finder measures the distance by emitting a 40KHz pulse of ultrasonic sound that travels through the air until it hits an object, then it measures the delay of the reflected signal and sends proper commands to other units.
I used an SRF05 ultrasonic sensor and an ATTiny85 microcontroller. The distance data is displayed on a 128*64 OLED screen, both in centimeters and inches. Also, a horizontal bar graph provides a visual estimation of the distance. The MCU code was developed using the Arduino IDE.
To design the schematic and PCB, I used Altium Designer 22 and SamacSys component libraries (Altium plugin). To get high-quality PCB boards, I sent the Gerbers to PCBWay and purchased original components using componentsearchengine.com. To examine the current consumption of the circuit, I used the Siglent SDM3045X multimeter.
Isn’t cool?! So let’s get started.
Specifications
Input Voltage: 6-24VDC
Current Consumption: 24mA
Detection Range: 2-400cm (see text)
Distance Data: Centimeters, Inches, Bar Graph
Display: 128*64-Yellow Blue OLED
References
Article:
https://bit.ly/35dNp8b
TS2937 schematic symbol, PCB footprint, 3D model:
https://componentsearchengine.com/part-view/TS2937CW-5.0 RP/Taiwan Semiconductor
ATTiny85 schematic symbol, PCB footprint, 3D model:
https://componentsearchengine.com/part-view/ATTINY85-20SUR/Microchip
Electronic designing CAD software plugins:
https://www.samacsys.com/library-loader-help
Altium Designer plugin:
https://www.samacsys.com/altium-designer-library-instructions
ATTinyCore Arduino Board Manager:
https://github.com/SpenceKonde/ATTinyCore
Arduino New Ping library:
https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home
Arduino Tiny4KOLED library:
https://www.arduino.cc/reference/en/libraries/tiny4koled
Siglent SDM3045X multimeter:
https://siglentna.com/digital-multimeters/sdm3045x-digital-multimeter