Cool.Majkl
Posts: 15
Joined: Thu Aug 18, 2011 9:10 am

Using mic to light up diode -> newbie

Fri Mar 01, 2013 7:12 am

Hi!

I got a project at school to finish, and I thought, that I could make it on my RasPi. But the problem is, that I'm absolute newbie in programming. I need to connect mic and diode to RasPi, and light it up with claping.

Any ideas where I should start?

cae2100
Posts: 143
Joined: Tue Jan 08, 2013 10:35 am
Contact: Website

Re: Using mic to light up diode -> newbie

Fri Mar 01, 2013 8:52 am

well, the easiest way is to just use a mic element and comparator to tell when a loud sound, like a clap is detected and it'd send a pulse out, and into a pin on the raspberry pi, just make sure you use a voltage divider so it doesnt go over 3.3v, but have a python program detect it using input(), and use that trigger to turn on/off an LED.

here's an example circuit that Ive used in a few projects, it was taken from a robot that detects a tap on it, or clap, or loud noise to activate.
FURHG9AGLGCJCXH.jpg
FURHG9AGLGCJCXH.jpg (13.04 KiB) Viewed 1314 times
another alternative is hooking up a usb sound card and using pyaudio to detect the audio, and turn on the LED pin, but the only thing about that is the sensitivity of it.
If it isnt smoking and blown into pieces, it's not pushed far enough yet. :P
http://cae2100.wordpress.com

Return to “Python”