A Maker known as “bergerab” has created an Atmel-based ultrasonic ruler powered by the popular ATtiny85 microcontroller (MCU).
According to the inventor, the recently posted Instructables prototype is accurate to +/- one centimeter.
“Using this pocket-sized ultrasonic ruler, you can simply point at any object, click a button, and the distance will be displayed on the 8 LED display,” bergerab explained in a meticulously detailed Instructables post.
“This ruler is the smallest (5cm by 7cm) and cheapest (about 5 USD) ultrasonic measuring device available today.”
Aside from Atmel’s versatile ATtiny85 microcontroller, key project components include:
- 74hc595 shift register
- 7805 voltage regulator
- HC-SR04 ultrasonic range sensor
- 330 Ohm resistors (8)
- One tactile-switch button
- One two-way slide switch
- LEDs (8)
- One indicator LED (with 2k resistor)
- Perfboard (5cm by 7cm)
- 9v battery (with connector)
On the software side, bergerab describes the sketch for the circuit as quite small and simple.
“Basically, all the code does is every 500 milliseconds, the distance between the HC-SR04 and an object infront of it is shifted out to the shift register via the data and clock pins attached to the ATtiny85,” he added.
“When the user presses the button on the device, they are actually activating the ‘latch’ on the 74hc595. This illuminates the need for attaching the latch pin to the attiny and attaching a button to the ATtiny85.”
Interested in learning more? You can check out the project’s official Instructables page here.
Pingback: Building a tinyAVR pocket sequencer | Bits & Pieces from the Embedded Design World