Building a Tengu clone

tengu_happyAges ago, a friend showed me Mr Jones’s Tengu, a cheeky little face that reacts to sound. Obviously it’s cool, but it’d be more fun to build one yourself. This is what I’ve done here!

You will need

It’s not a terribly complicated circuit, and you can build it on breadboard in an hour or two. Here’s the parts list for my version:

  • Atmel ATtiny261A
  • An op-amp – I used an MC33171
  • An LED display with common cathodes – I used a Kingbright TC20-11GWA
  • An electret microphone
  • Three 10k resistors
  • One 4k7 resistor
  • One 100k resistor
  • Seven 220R resistors
  • Two 100nF capacitors
  • Some breadboard (15 strips, 18 holes long)
  • 3x AAA battery holder or a USB cable

Circuit diagram

I found that the electret microphone I used was very keen on picking up bass. Therefore I chose 100nF and 10k as the input low-pass filter, which gives the circuit a frequency response reasonably close to human speech. When using the recommended values with a much lower cutoff frequency, I found it over-reacted to passing lorries/helicopters and appeared to be jabbering at nothing!


Breadboard layout

I couldn’t find any software to do this, so figured the best approach was an annotated photo:

pcb - annotated


The firmware isn’t very clever. It samples the microphone at about 2kHz, and saves the readings to an array. Once it’s reached 64 samples, it finds their amplitude, then chooses which face to display based on that. The firmware flow is effectively:

  • Set timer 0 to overflow 2000 times per second
  • Set the ADC to sample when timer 0 overflows
  • When each ADC reading completes, save the reading into an array and update the output pins to display the next column of the currently active face
  • Every 64 readings, choose the most appropriate face to display