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.
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 capicitor
- 2 x 22p capicitor
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.
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 capicitor 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 value = 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.
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.
Downloads
- tengu_clone.zip, source, hex and Eagle schematic





October 23rd, 2007 at 02:05
Du bist ein Spielkopf und solltest lieber in einer E-Technik Bude schaffen gehen wie ich früher
Ich finde das Ergebnis erstaunlich gut - Respekt !!!
October 23rd, 2007 at 05:36
[…] sent in his clone of [Crispin Jones]’ tengu. The tengu is essentially a funky visual sound meter that looks […]
October 23rd, 2007 at 06:20
Nice project. Your track selection was superior as well. Congrats on getting on “hackaday”.
~~Andrew
October 23rd, 2007 at 08:01
That’s pretty neat use of a LED matrix. I might see about doing something like that myself. I currently have a 8×8 bicolor LED matrix hooked up to an AVR, so far I’ve written a simple pong game.
A video is included here: http://blog.davr.org/2007/09/24/avr-project-update/
October 24th, 2007 at 09:11
[…] Tinkerlog » Blog Archive » DIY Tengu on a breadboard - [via] Link. […]
October 24th, 2007 at 11:54
[…] Tinkerlog » Blog Archive » DIY Tengu on a breadboard - [via Link. […]
October 24th, 2007 at 13:53
[…] A Sound-Responsive Face for your Furniture Filed under: Course Materials, Examples — jet @ 7:53 am Probably a few tricks you can learn from this audio-responsive LED bank. […]
October 24th, 2007 at 17:41
Wow! I must make one!
I have been looking for a “light organ kit” for a while. This is it for sure.
nice work.
October 24th, 2007 at 18:37
Let me know if you ever do a PCB layout for the whole thing.
cheers,
steve
October 24th, 2007 at 21:05
[…] Tinkerlog » Blog Archive » DIY Tengu on a breadboard - [via] Link. […]
October 26th, 2007 at 18:18
[…] segundo es un proyecto para los amantes de los LEDs, una carita que “canta” según la intensidad de la música. El nombre de tales juguetes es tengu y no se pierdan el video, ahí es donde verdaderamente se […]
November 9th, 2007 at 16:29
[…] http://tinkerlog.com/2007/10/22/diy-tengu-on-a-breadboard/ […]
November 20th, 2007 at 20:26
[…] Tengu on a breadboard - [Link] Tags: DIY, Led, matrix, Microcontroller, Sound, Tengu Filed in Audio, Led, […]
December 13th, 2007 at 17:29
Is the Arduino and integral part of the project or was it just used to test it out? I’d like to get started in microcontrollers and I’m wondering whether it’s better to order an arduino or a programmer and some chips to tinker with.
December 14th, 2007 at 01:38
Hi Seb,
I used the Arduino for testing only. Nevertheless, the complete Tengu could be build with the Arduino.
If you are trying to get started with microcontrollers, I would recommend to use the Arduino, because it’s really easy to get things going. No programmer, no soldering, only a breadboard to assemble your first cicuits.
Cheers,
Alex
December 14th, 2007 at 18:30
Thanks for the reply. I think I will order an Arduino. Am I correct in assuming that if I use the Arduino as a testing ground for a project, that once I have things working the way I want, I can use the code on a standalone chip, in its own circuit? Basically, the Arduino is so that i don’t have to build a voltage regulator or connections or whatever else is needed for a microcontroller to function in a circuit, everytime I want to tryout an idea. Is that an accurate assesment?
December 15th, 2007 at 09:12
Seb,
the Arduino uses a C as a programming language with some libraries, based on Wiring. If you want to use another micro for your final project, you may have to adapt your code.
Cheers,
Alex
December 18th, 2007 at 15:29
Alex,
Thanks a lot for your responses, you’ve been very helpful.
December 21st, 2007 at 03:28
This is awesome stuff. I am thinking about getting an Arduino for christmas and this is the first project I want to build. What needs to be adapted from your design for this project to work on the arduino? I have never done any “electronics” stuff before and wanted to know if you could make a more detailed writeup of your procedure. im just wondering, but yeah this project is super awesome.
December 21st, 2007 at 08:44
Hi David,
if you are absolutely new to electronics, I would recommend to start with an Arduino and a breadboard to build the first simple things. Have a look at Boarduino: http://www.ladyada.net/make/boarduino/
After that, take a look at the schematic above. Everything right side of the ATmega is needed for the Arduino version. Additionally the code has to be adapted. Reading the sound sensor is straight forward. Programming the LED display may be a bit harder.
I am not sure, if I find time to do a Arduino version of this. We’ll se.
Cheers,
Alex
December 22nd, 2007 at 15:49
Thanks. What are the advantages of using the Boarduino and the Diecimella Arduino? From what I gather, couldnt you just “jumper” the arduino to a breadboard?
December 22nd, 2007 at 19:04
Hi David,
yes, you could “jumper” the Arduino to the bredboard. But if you did that once or twice, you would love to have an Arduino that sticks to the breadboard.
Cheers,
Alex
December 24th, 2007 at 03:28
I’m looking at your sound sensor, and I just want to know what parts are being used in the sound sensor/amp part. I think this would be a great instructable
December 24th, 2007 at 09:46
Hi David,
if you take a look at the schematic, all parts that are at the top are needed. There is a single wire that connects the amplifier with the microcontroller.
Cheers,
Alex
December 24th, 2007 at 19:10
i did look at the schematic earlier, but I was confused because in the schematic you show a 220u capacitor and a speaker. Both not listed on the parts, and the only question I have now is what is the speaker component?
So far my dive into microelectronics has been good. I’ve been collecting parts, and have been testing out things on the breadboard. Thanks for all teh feedback.
December 24th, 2007 at 23:50
David,
the capacitor and the speaker are used for a first test of the amplifier. They are not need for the final circuit.
Cheers,
Alex
January 6th, 2008 at 13:53
Hey Alex, this is a cool project. Thanks for sharing! Sorry for the off-topic, but what wordpress plugin do you use to display the source code?
January 6th, 2008 at 14:31
Hi Mark,
check out the “?” at the top of each source code section.
Or have a look at: http://code.google.com/p/syntaxhighlighter/
Cheers,
Alex
January 16th, 2008 at 16:25
Hi,
Awesome project. Any chance to sent me the already compiled HEX file? I tried to compile it and program it, but the only thing I got is all the leds lighten up dimmly…
No face!!
Regards, Thanos
January 16th, 2008 at 16:30
Oh, and something else, I used a ATMega88 as I could not find ATmega48 here in Greece easily… Do you think that makes a difference?
Regards, Thanos
January 16th, 2008 at 22:18
Hi Thanos,
I zipped it again and put the hex file into it. Please try it.
Have you tried it on a breadboard? That will be easier to track down bugs in that setup. Try to activate a single face and see if that will light up.
The ATmega88 is pin compatible with the ATmega48. But I am not sure if it will work.
Cheers,
Alex
January 18th, 2008 at 14:46
Hey:
I put the amp+mic portion of the circuit together, and hooked it up to my arduino. However, all I get is an led that stays on.
David
January 18th, 2008 at 19:23
Hi David,
please check if the mic is connected the right way. It has a polarity so you might want to try it the other way round.
Next thing would be to hook up a multimeter at the output pin of the amplifier and see if it changes its value when you shout or touch the mic. Also try to adjust the potentiometers for amplification and volume.
I used a small speaker to “debug” the circuit. For that you will need the 220u capacitor.
HTH.
Cheers,
Alex
January 30th, 2008 at 19:16
Hello Alex, using your experiment as a base, I have developed my own PCB Tengu using a PIC microcontroller.
This video is a brief presentation of PIC-Tengu (http://www.youtube.com/watch?v=MnFP4FNVE-I). It is in spanish but subtitled in english.
Thank you very much for your inspiration; I have enjoyed very much developing ti.
January 30th, 2008 at 22:37
jfmateos2,
man, this one is fantastic. Really good work, much nicer than mine one. Thanks for stopping by.
Cheers,
Alex
February 12th, 2008 at 12:35
[…] Περισσότερα εδώ: http://tinkerlog.com/2007/10/22/diy-tengu-on-a-breadboard/ […]
March 5th, 2008 at 16:06
[…] music, your voice or … Neat! The brave out there who want to build one themselves should go here. DIY, hardware, led, music, physical computing, […]
April 9th, 2008 at 17:50
Nice project. I want to make this on a uC board that I already have. It has an LCD screen, a microcontroller and a built in microphone. Is there anything I would need to modify or add to get this to work?
April 11th, 2008 at 15:07
Hi Shevy,
that should be sufficient to get everything to work. Be sure to get a signal out of the microphone, that is strong enough to measure it with the microcontroller.
Cheers,
Alex