Main Content

My previous Instructable featured a 555 timer with a hex inverter used to generate a 40 kHz square wave and drive the ultrasonic transmitters. As you can see, the circuit is pretty large. I thought I could avoid using an overpowered MCU for such a simple task, but found that an ATtiny (4/5/9/10) was simple enough to generate both the 40 kHz noninverted and inverted waves with only a few lines of code! This work is based on the design by Asier Marzo. The ATTiny come in SO-23 packaging and are smaller than a grain of rice allowing us to make things very small! If the smaller ATTiny 4-10 are difficult to find in stock, you can also use a larger ATTiny 85 or other MCUs with a few modifications to the attached EagleCAD schematics and code.

Supplies
ATTiny (4/5/9/10) At the time of creating this Instructable, only ATTiny 9’s were instock at Mouser for .37c a piece, But any ATtiny (12/13/25/45/85) will work with a few minor modifications to the code. 85’s are common enough to get off Amazon.

6 pin So23 DIP breakout boards

USBasp programmer such as this (an Arduino is also required to update the firmware if you want to program ATtiny 4-10 out of box but not 12 or higher)

TC4427 Noninverting Mosfets. I used these SMDs from a previous project with associated breakout boards, but you can find DIP versions too.

Two 16 mm 40 kHz transducers. You can find a small assortment of transmitters and receivers off Amazon.

12V DC Power Source

5V 7805 Linear Voltage Regulator- These are available from many sources.

Capacitors: Two 100 nF, One 330 nF, One 4.7 uF

Link to article