Audio Sensor Development Part 2: EDA, PCB, SPL, PSRR

This article continues the development of an audio sensor device for RGB Shades and LED Matrix Shades, starting with microphone calculations in Part 1.

With the preliminary calculations out of the way, it’s time for the fun part: making a real thing and testing it!

Design goals:
* Fits both RGB Shades and LED Matrix Shades
* Small, yet able to be hand-built for prototyping

Here’s the schematic for the prototype device. It’s about as simple as possible, loading the electret mic element with the recommended 2.2K resistor as well as using one for the input to the preamp circuit. The amplifier is a small rail-to-rail single-supply op-amp with a split rail to reference the input to the midpoint of the supply. The MSGEQ7 circuit follows the datasheet guidelines for setting the internal oscillator frequency with external resistor and capacitor. The output pins are carefully chosen to be compatible with both the RGB Shades and LED Matrix Shades, which unfortunately have different pinouts on the expansion connectors. A solder jumper is necessary to divert the analog output to the correct pin.

We’re using Cadsoft Eagle to design this device.

With the schematic in order, it’s time to create a PCB. The parts were repositioned until they started to make sense and have minimal ratsnest distances. During the process of routing, we had to reduce the size of the passive parts from 0805 to 0603. By printing out the PCB at 1:1 scale, we were able to make mockups for test fitting the board outline and adjusting as necessary.

With the part position and outline decided, here’s the final routing and silkscreen:

Next…to get some PCBs in hand! For this, we used Great for simple prototype boards, with several solder mask color options. We also ordered a stainless steel stencil for ease of solder paste application. Turn time isn’t the fastest (depending on what shipping option you choose) but there’s always plenty to do while waiting. Ordering parts, for example!

Some time later….

It’s time to build up a few boards! We’ll be using a solder stencil to apply paste to the PCBs, and then place the parts using tweezers. The 0603 parts are still large enough to place easily without magnification as long as you have sharp tweezers.

Our little trick for solder stencils without a frame or positioning jig: put a VERY LIGHT mist of spray glue on the back of the stencil. Let it dry for about 30 seconds, then put it on the PCB and align all the holes with the corresponding solder pads. The glue will keep the stencil from sliding while applying the paste. Too much glue would be pretty bad, of course!

Next is to dab some paste on the mask and carefully spread it into the stencil’s holes. Since we usually cut the mask down to a manageable size, we have extra stainless steel and use a piece of that as a spreader. The best technique is to push the paste over the holes in a thick layer with a shallow angle on the spreader, then come back at a steep angle and scrape off the excess paste.

With five prototype boards loaded with solder paste, it’s time to place the parts. Good, sharp tweezers are necessary; ones with angled tips seem to work very well. We tend to place all of the same-value parts across all boards before moving to the next part value, which is a lot faster than trying to find each part value individually for each PCB.

With all the surface-mount parts placed, we need to melt the solder to finish the job. We’re using an inexpensive reflow oven, but have used a range of techniques in the past from a skillet on the stove to a toaster oven and a stopwatch. It’s also possible to melt all the joints one by one with a fine tipped soldering iron.

Success! The PCB is correctly soldered and we’ve attached the microphone element. Next, we need to attach a 0.1” header and short the jumper on the bottom of the PCB to select the correct output pin.

Here’s how the final result looks on the RGB Shades:

And here’s how it looks on the LED Matrix Shades:

After a quick smoke test, everything seems to be powered up correctly. Before doing a full test of the system, let’s test the board against expected values. These tests were done on an RGB Shades controller board without an LED panel attached. We positioned the Shades Audio Sensor microphone as close as possible to the microphone on an iPhone 5S running the excellent SPLnFFT app, and played a 1kHz tone from this handy online tone generator. We adjusted the tone output volume until the SPLnFFT app read the desired dB SPL level, and recorded the ADC values that the RGB Shades controller was reading from the Shades Audio Sensor (with a running average of about 100 samples).

Somewhat miraculously, the numbers agree really well. Due to the way audio measurements are made (and how the human ear perceives sound) it wouldn’t be unexpected to see a factor of two difference between the expected and measured values, especially with the use of a phone app to measure SPL in an ordinary room rather than a calibrated setup. But then, this is only to make awesome blinky stuff, not a reference audio system!

After attaching the LED panel, it revealed some more work to be done. The amplifier design above is quite simplistic, but exhibits sub-millivolt noise levels on a clean power supply. However, the LEDs on both the RGB Shades and LED Matrix Shades put some pretty intense ripple on our 5V rail, and our analog electronics aren't decoupled from that enough. The extra noise doesn't seem to be affecting the microphone and preamp stage as much as the MSGEQ7 itself, which appears to be leaking some noise out of the analog input pin. We'll definitely need to do a Part 3 of this design, and explore some decoupling methods. We may also select a different preamp stage for the microphone to improve the power supply rejection ratio (PSRR).

We were able to get some great results by improving the preamp gain (about 21), and loading the microphone a bit less (about 4.7k). By using the spreadsheet, we can see this starts clipping around 100dB rather than 105dB. By reducing the LED supply noise and perhaps adding some hardware AGC, we should be able to greatly increase the range.

Here's a video of the Shades Audio Sensors working on the RGB Shades and the LED Matrix Shades:

Code for the RGB Shades:
Code for the LED Matrix Shades:

Click to continue >> Audio Sensor Development Part 3: Theory Meets Reality

Submitted by Garrett on Thu, 12/10/2015 - 17:44.

how active is this addon

how active is this addon being developped? can I be on the mailing list if they are back in stock?