DIY Tengu on a breadboard

When I first saw Crispin Jones Tengu, I was sure, I must have one. If you don’t know tengu and don’t want to follow the link, it’s a small face, made of LEDs, that reacts to music and sound.
It did not take long until I decided to clone this funny little device. All it needs is a microcontroller, an LED matrix and a sound sensor.

Tengu clone

Parts

  • ATmega48, 4kb flash memory, 512 bytes main memory
  • crystal, 10 MHz
  • Everlight 8×5 LED dot matrix display
  • electret microphone, taken from an old mobile phone head set
  • LM386 op-amp
  • 5 x 1k resistor
  • 1 x 100k resistor
  • 1 x 10k potentiometer
  • 1 x 100k potentiometer
  • 3 x 0.1u capacitor
  • 2 x 22p capacitor

All parts should be available for less than US10$.

Sound sensor

To get a good and robust signal out of the microphone, an amplifier is needed. I found an really easy schematic of an amplifier at Jose Pino’s site. It is based on the LM386, an op-amp, often used in small music amplifiers, e.g. Cracker box Amp in Make 09.

I assembled it on a small breadboard and tested it with my new Arduino.

Sound sensor with Arduino

It worked great, but I had to use an alternative power source. When I used USB as power supply, the on- and off-switching of the monitoring LED lead to additional noise. 4 AAA cells solved that problem. For the first test you can use a small speaker attached to pin 5 of the LM386. Be sure to add the 220u capacitor between the LM386 and the speaker as shown in the schematic, otherwise you may blow your amplifier.

Here is a little sketch, that I used to test the sound sensor.

/*
 * Monitor for sound sensor
 */

int potPin = 2;    // select the input pin for sound sensor
int ledPin = 13;   // select the pin for the LED
int val = 0;
int amp = 0;

void setup() {
  pinMode(ledPin, OUTPUT);  // declare the ledPin as an OUTPUT
}

void loop() {
  val = analogRead(potPin);
  amp = (val >= 512) ? val - 512 : 512 - val;
  if (amp > 100) {
    digitalWrite(ledPin, HIGH);
    delay(20);
  }
  else {
    digitalWrite(ledPin, LOW);
  }
}

Controller and LED matrix

The Everlight LED matrix with its 40 LEDs is big enough to display a small face. The matrix needs 5 1k resistors for every row to limit the current.

tengu clone

The sound and its amplitude is sampled by the ATmega48 with one of its analog input pins (ADC). Then the suitable face is choosen to display. The faces are stored as simple bitmaps.

Conclusion

This small thingy is fun to watch. And it was fun to build. Maybe I’ll try to put it on a prototype board to be able to carry it around.

Yes, I know. My camera sucks.

Links

Downloads

53 thoughts on “DIY Tengu on a breadboard

  1. Pingback: Real Time Representation Of Visualization Bars | glensaldanha

  2. Pingback: Last-Minute Halloween Arduino Skull Prop… | Blackrice Bran

Comments are closed.