Let's Make Robots!

VU meter robot face

Makes your robot happy!

Upon starting my Arduino adventures/misfortunes one of my first projects was hooking a resistor and an LED to the board and making it blink. But just like those famous potato chips (Or crisps or thins or tater friedos) who can eat just one! One of the coolest things about LEDs and microcontrollers is the ability to combine them and make those groovy glowing diodes blink, fade or dance around in response to an input. Well, maybe not LITERALLY dancing, but..

 Anyway, this is just a simple LED project that I completely ripped off from this: 

http://robomaniac123.zxq.net/Robomaniac123/Arduino_Tutorials/Entries/201...

 I can't claim any credit but my thanks go out to the person who put the blog together! It's really well written and the code is dead simple to tune and works well. The only changes I made were altering the wiring order so the eyes lit up at a low level and the "sweep" went from center out. It works fine off a regular line signal and plays well with a little lm386 amp I've been fooling with. Google  "lm386" and it'll turn up a heap of nifty and cheap amplification projects.

About the only downside to this scheme is the fact that it uses quite a few pins. I did double up the eyes and the center mouth LED's which whittled the count down to 10 pins running 12 LED's but it's still a lot. I may fool with it some and combine my Charlieplexing experiments and reduce the number of required pins even further. Or maybe someone else will figure it out so I don't have to!

Here's the charlieplexing stuff I worked through a while back : 

http://www.instructables.com/id/CharliePlexed-LED-string-for-the-Arduino...

I actually made a PCB that used an ATINY 85 and was making good progress. Seems like the code on the instructable regarding the pin assignments was wonky or something. But I finally got it working using the hardware described. I may revisit it and see if I could get something similar working with robot face!

Some bored soul may want to look at it as well!

The 2nd vid is with your code bdk6. I also doubled up the LEDs and got it down to 5 pins. Could be 4 with this setup if the eyes weren't controlled by the meter.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I posted a vid using your code bdk6. It seems to work fine but there were a couple of little typos in the code.

Thanks!

Glad you got it working and found it useful.  Sorry about the typos.  This is a REALLY cool project.  I think I might build one or two myself.  Connect to a text to speech and have his "lips" move as he talks.  Oh, I guess that's what Protowrxs did with Boxhead.  I'm always a day late and dollar short...

That is what I did with Box Head but it's a very small mouth, only 5 LEDs total and it's running through an ATTiny85.

I'd still like to take the core code and give it some options like dot graph instead of bar graph. Should be doable - just turn off anything above / below the level.

That big smile would be much better in my opinion that Box Head's. I just wanted something to show the sound and it works for that.

You should go for it bdk6 and build a talking head. Kind of fun to mess with.

 

-Stephen

I've added that to my "to do" list.  But, I'll have to build three.  My kids will have to have one each for their laptops.  And since they run Windows and I run Linux, two software setups.  this is why I LOVE/HATE LMR.  All these great ideas like the VU meter and Boxhead that I want to do and don't have time for.  Seems to me these two were meant for each other.  Thanks to both of you!

Thanks for the input guys! I'll try the code bdk and post a video.

I have some of these bajdi : http://adafruit.com/products/453 but I haven't done anything with them :(

One of the things I wanted was something simple that didn't require any extra hardware but it would be cool to get the pin count down.

I did some charlieplexing stuff and ran 12 LED's off 4 pins so that would be super to combine the VU meter stuff with that. The charlieplex test board I was working with actually dropped the resistor count so that would be nice as well.

I'll add some of that stuff to this post so some of you smart folks can think on it :D

 

I really like the robot face idea.  That is WAY cooler than any old standard vu meter.  Adds a lot of class.  

If you would like it to have a logarithmic response like a regular vu meter you might try this modified sketch.  I haven't tried it, I just made some changes.  So it might not work.  Anyway, thought I would offer it up in case you are interested.

// Led VU Meter Example

// Version 1.0

// Written by James Newbould

// Modified for logarithmic response wrc

 

 

int led[10] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; // Assign the pins for the leds

int leftChannel = 0;  // left channel input

int left, i;

 

void setup()

{

for (i = 0; i < 10; i++)  // Tell the arduino that the leds are digital outputs

  pinMode(led[i], OUTPUT);

//  Serial.begin(9600); // Uncomment to enable troubleshooting over serial.

}

 

void loop()

{

left = analogRead(leftChannel);  // read the left channel

// Serial.println(left);  // uncomment to check the raw input.

//left = left / 50;    // adjusts the sensitivity  

//  Serial.println(left);  // uncomment to check the modified input.

// left = 1500;  // uncomment to test all leds light.

// left = 0;    // uncomment to check the leds are not lit when the input is 0.

 

   for (i = 0; i < 10; ++i) // turn on and off appropriate leds

    {

     if(left > (1 << i) digitalWrite(led[i], HIGH);

     else digitalwrite( led[i], LOW);

    }

 

 

}

 

 

Looks good. Already printed a robot for it? Would make a cool robot face. I should try and replicate this with an I/O expander chip. I have some here somewhere.