LEDs controlled by ambient audio with PIC

Thread Starter

Vurk

Joined Nov 18, 2009
3
Hullo. While i've seen very similar posts to this, none quite hit it on the nose.

My project is this - I built a beer pong table. I'm planning on outlining the table with a string of LEDs. I want the LEDs to light up to the music much like a visualizer would do (as in winamp, etc), but to the ambient noise in the room.

How do i get microphone input? I've seen many projects with microphone input, but they all pass over this point of how they get it. In pictures it looks like they just have an audio in jack soldered to the board.. how does that feed into the pic?

Thanks, and sorry if this is in the wrong area. I couldn't decide between this and the embedded systems forum.
 

SgtWookie

Joined Jul 17, 2007
22,230
This thread might eventually get moved over to the Embedded Systems/Microcontrollers forum, but for right now I think you picked a good place.

First, you need to decide on what kind of audio input device you are going to use; for example a dynamic mic, an electret mic, etc. They all have their own idiosyncrasies and related expenses. Electret mics are cheap and popular for things like this.

Audioguru posted stereo audio level meter about a year ago that used a couple of opamps and a few LM3915 or LM3916 10-segment LED display drivers; I don't recall which offhand. Seems to me that his project could be used to do what you want without the necessity of a PIC.

Bertus posted a related project a year or so ago involving a PIC18 driving a graphic equalizer display. He used direct audio inputs from his stereo system to drive it.

You might consider using a combination of both projects to come up with close to what you need.
 

Thread Starter

Vurk

Joined Nov 18, 2009
3
Thanks SgtWookie!

I'm looking into all this now and starting to think I might be in a little over my head. I'm a jr in computer science at UL Lafayette, which is why i was thinking PICs would be easiest..

If you have time, could you help me understand the opamps? After some research it seems like they're pretty simple - they take in inputs and amplify per voltage in. A positive feedback opamp looks promising - the Schmitt trigger in particular if used as an oscillator could produce some cool looking LED sequences (all without a pic) if i'm understanding it correctly.

Anyways, thanks a ton!
 

Audioguru

Joined Dec 20, 2007
11,248
The output from a microphone is only 5mV to 20mV.
The input to a micro-controller is up to 1.77V RMS (5V p-p).
So a preamp with a gain of 354 is needed.
Two low noise opamps, each with a gain of 18.8 will do it.

Here is a preamp for an electret mic. A second opamp is needed for enough gain.
 

Attachments

Top