Input Devices


I began this week by adding the new MEMS microphones to the Eagle library, which I think would be a more useful tool if all of the parts in the labs were in the library. On the upside, I succeeded! On the downside, Eagle doesn't have ways to do one-sided pads on the TOP layer with holes in them, as would be necessary for the I2S mic, which has a bottom port. Presumably, I could jury-rig it as a through-hole part, but then everyone designing for it in a fab lab would have to deal with including the Pads layer in their mill images.

Footprint for the analog mic

The analog mic: The major difficulty for the footprints was getting the placement right--with chip-scale surface-mount packages like this, the datasheets had precision on the footprints of down to .001mm, which seemed a bit excessive (and was difficult to place).

Footprint for the digital mic

The I2S mic: For this microphone, I ran into issues with the pad sizes being really small and close together. If I have time in future I'll check if it's possible to make the pads small enough/far enough apart to use the 1/64" end mill.

Using the I2S Mic

I wanted to try using the new MEMS digital microphone (Knowles SPH0645LM4H-B), which boasts up to 64kHz sampling at 18 bit precision. On the upside, this is a really cool part, able to do (using two of them) 64kHz stereo audio! On the downside, it wants an I2S clock speed of 2-4 MHz, which should be possible, although this still isn't clear. The advanced idea I'm hoping to be able to get started on is a portable audio recorder to an SD card; to start out, I'm going to try to reimplement Prof. Gershenfeld's analog mic hello-world example, except using the I2S microphone.

I began by reading through the datasheet on the microphone, as well as skimming the I2S specification and the beginning of the SD specification, and doing a thorough reading of the ATtiny44A's USI serial block, which seems like it can (barely) implement I2S, using Timer/Counter0 as a clock source and bit-banging the WS (word/channel select) pin.

But, before I get started describing my implementation, here is the list of considerations in designing this:

A quick note on why Windows is annoying: Tried to link my code into the git repository by placing a symlink in the repo; instead it just moved a copy of my code into the repo. I think that it'll work to do the reverse by editing the copy in the repository and linking to it with a Windows shortcut in the original Atmel Studio folder.

Designing the board

Schematic of the I2S Mic board

The I2S microphone board schematic: I was trying to reproduce Prof. Gershenfeld's MEMS microphone board with the I2S MEMS microphone. Here is the schematic for download.

In designing the board, I tried to fit what was needed for the microphone, as well as an FTDI header and some indicator LEDs. It worked out, albeit with a few jumpers. Unfortunately, the I2S mic gave warnings in the DRC--it seems that the pads are too close together for the 1/64" end mill.

The board design

The board: It needed a couple jumpers, but isn't too bad-looking.

The board can be found here. You can also download the traces and outline.

Photo of the microphone board

Mic board: I finally got it soldered, but couln't test it out because the Harvard lab lost all of its 3.3v FTDI cables.

Photo of the hole in the back of the mic board

Sound hole: I'm still surprised that the microphone is supposed to get audio through that little hole.

Code!

I put all of the things discussed above into my code, which uses the USI in three-wire mode to read data from the I2S data line. The code can be downloaded as an Atmel Studio project here, or you're welcome to peruse the separate files here.