How do I create a beat detector using a audio jack

Hi guys, I am trying to develop a beat detector using an audio jack. The goal of this project is that there is an array of always on LEDs, which aren't affected by the MCU at all, and there is a set of blink LEDs. I want to have it so that every time the microcontroller detects a beat, it blinks the LEDs. I could get a "knock" detector to work with a piezo element, using the tutorial, but that wasn't much help because it only turned on the LED and turned it off every time it heard a "knock" Also, it wouldn't work with an audio jack. Apparently, I need to create an interface with the analog in, connected to the speakers or whatever.

It might be a bit tricky. My understanding is that the sorts of voltages that come directly from a music source can be quite low - in the millivolts region - so you might need to amplify it to a level which can be understood by the Arduino’s analog input. I think you’ll need to raise the voltage in any case, since audio is AC, and the Arduino’s analog inputs can only handle positive voltages.

Figuring out when a beat is might be a little trickier. Depending on your audio source, you may just be able to assume if the amplitude (IE, the voltage) goes above or below certain levels then it’s a beat, but it might end up being much more complicated - having to average the noise, level, determining exactly when is loud, waveform analysis.

If I were going to do this, I'd start by opening a browser window pointed to google. :slight_smile:

Search the web for the many available examples of using opamps to make a "low-pass filter" and an "envelope detector". The idea is to use the filter to remove much of the melody, so the Arduino will "hear" mostly the drums. The envelope detector will output a signal that represents the overall sound level, so the Arduino doesn't have to look at the sound on a cycle-by-cycle basis.

You might actually find a circuit that that someone has already designed that combines this. Maybe google for "music beat detector"?

Once you have that sound-level signal, the Arduino can track the average level, and pick out the peaks that indicate a drumbeat.


I found a good resource at

I think I can try to use that to build the hardware side of my circuit, now its all programming lol