Our series of posts about interpreting PDM audio with small microprocessors has been leading up to this point. We have designed small a sensor board containing a PDM microphone and a CPU, that makes it practical to add SPL measurement to any embedded system like the Arduino, or Raspberry Pi, or even to a PC with a USB serial cable.
We call it the SPLear™.
The microphone is a bottom port Knowles Digital SiSonic™ MEMS microphone. The port is centered between the two mounting holes, but the mic is omnidirectional. The CPU is an NXP LPC812 in their 16-pin package, running from the internal 12 MHz oscillator. We provide an analog output driven by a PWM, and an LED that can be independently controlled by PWM, along with a logic level UART, and access to most pins of the mic and the CPU.
The board is small at 0.8″ by 1.5″, with three mounting holes. Ten pins are laid out on a 0.1″ grid for easy use with solderless breadboards. Additional through-holes are provided on 0.05″ centers covering the other features.
The firmware provides the following features.
- The analog output signals measured SPL, and it along with the board’s power input are arranged to make connection to Arduino GVS-style shields simple.
- The LED brightness is modulated by SPL, with a healthy offset so that only fairly loud sounds light it up. This allows easy confirmation that the board is alive: just apply power, speak at it, and watch the LED flicker.
- The UART provides a variety of options for data ranging from telephone quality audio at about 8 kHz, SPL samples at about 8 Hz, SPL peak and instant levels at about 0.5 Hz, or just alerts on loud noises. We expect the UART to be more useful to Raspberry Pi users without convenient analog inputs. It is also easily connected to a PC with a logic level USB serial port cable.
- The logic level driving the LED and a second GPIO pin are on the main connectors for use by custom firmware. Stock firmware will drive a pulse on the spare GPIO when the board is “startled”.
- As an example of an easy firmware customization, one of the other GPIO pins can drive a hobby servo making the servo move proportional to SPL. This echoes an early stunt we wrote about with the same function implemented in an ATTiny85.
Much of the firmware has been discussed and published in past posts on this blog, and the source code remains in a public repository. The hardware design (both schematic and PCB layout) will be published as well..
Here it is jumping when honked at:
Let us know what you think!
(Written with StackEdit.)