Skip to content

g-zajac/audio-level-meter-with-led-bargraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Audio SPL level meter with led bargraph

This project is about measuring semi-calibrated SPL and mapping the value on two led bars 32 pixels each with separate brightness management.

About The project

A sound is picked up with an electret microphone, processed and then SPL level calculated and mapped to a led bars.

Input

I used Adafruit MAX4466, modified as Pauls suggested in this thread to match Teensy input levels. The preamp output is connected directly to the Teensy AD input.

Microconroller

I have chosen the Teensy platform as this project is focused on audio and power consumption is not so main factor. The Teensy 3.2 has got 32bit Cortex-M4 ARM processor running on 72MHz, DMA and 16bit AD converter which makes it a perfect for this application IMHO. The only drawback I have discovered during prototyping is that it is not possible to use analogRead on other AD inputs while using audio library. An external AD ADS1015 was added ad-hoc to read pots which are used for LEDs brightness adjustment.

Output

Neopixels tapes are connected via 74HCT245 buffer.

Construction

All components soldered on universal PCB. Two pots are for manual brightness adjustment, dip switch for optional test mode. On bottom, power supply input and two cat5 for LED strips. The Cat5 delivers data and power to each of the LED stripes.

logo

How It Works

To compute SPL, the microcontroller does:

  • converts analog input signal from mic preamp
  • applies Hanning window
  • calculates 1024 points FFT
  • applies A-weighting curve
  • compute the SPL using RMS value
  • map SPL level to 32 points bargraph

Schematic

External elements (dip switch, two 10k pots, 74HCT245 etc) connected to teensy as declared in code.

Built With

Usage / Prerequisites

Connect breakboards modules to the Teensy as declared in code.

Clone the repository to a local folder

git clone https://github.com/g-zajac/audio-level-meter-with-led-bargraph.git

enter the project folder and run command:

platformio run

Project configuration is set in platformio.ini where you can set up variuos environmets and options.

Upload the compiled code to the Teensy, no programmer needed as has got build in USB and bootloader.

Performance

CPU loaded @ 65%

Acknowledgments

Big thanks for inspiration and sharing your knowledge and code:

License

This project is licensed under MIT license

Project status

  • Prototype built and tested.
  • Firmware R1 completed.