View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi

Learn how to create a wired USB microphone using a Teensy, I2S MEMS, Electret, and dynamic microphones. Compare their audio quality with a shop-bought USB microphone and discover what's inside it.

Related Content
Transcript

[0:01] I’ve made a wireless microphone.
[0:02] So let’s make a wired one.
[0:04] As one of the wiser viewers has pointed out: “Not everything needs to be wireless”.
[0:08] There will be a small test at the end of this video to see if you’ve been paying attention,
[0:12] so stick around to the end.
[0:13] There are three microphones in my collection of components that I’d like to try out.
[0:16] I’ve got two analogue microphones, an Electret microphone and a dynamic microphone.
[0:21] And I’ve got an ICS-43434.
[0:24] This is a digital I2S MEMS microphone.
[0:26] If you haven’t got one of these then the INMP441 is equally suitable and very affordable.
[0:32] How do these three microphones work?
[0:35] An electret microphone is essentially a parallel plate capacitor with the distance between
[0:39] the capacitor plates varying depending on the sound wave hitting the diaphragm.
[0:42] They have a built-in Field Effect Transistor that amplifies the signal.
[0:46] In order to work the Electret microphone needs to have a bias voltage of 1 to 2 volts and
[0:51] this is typically supplied by the microphone pre-amp.
[0:53] A MEMS microphone is a Micro-Electro-Mechanical System.
[0:57] It has a pressure-sensitive diaphragm etched into a silicon wafer.
[1:01] The principle of operation is actually quite similar to Electret microphones where the
[1:05] capacitance varies based on the sound waves hitting the diaphragm.
[1:08] One of the nice things and MEMS microphones is that all the electronics are integrated
[1:12] into the package so you end up with a nice digital interface.
[1:15] They are also very compact so you’ll find them in a lot of portable electronics.
[1:19] Dynamic microphones are much simpler in operation, they just consist of a coil of wire moving
[1:24] in a strong magnetic field.
[1:25] The movement of the coil is caused by sound waves hitting a membrane and this movement
[1:29] causes a voltage to be induced in the coil due to the magnetic field.
[1:33] This very small voltage needs to be amplified by a microphone preamplifier to make it audible.
[1:39] How are we going to do the USB interface?
[1:41] You’ll find out after this quick word about the channel sponsor.
[1:44] PCBWay have been supporting the channel for a while, they offer PCB Production, CNC and
[1:49] 3D Printing, PCB Assembly and much much more.
[1:52] I’ve made quite a few boards with them and they are great to work with.
[1:55] You can find a link to their details in the description.
[1:57] So, how are we going to do the USB interface?
[2:00] This is actually surprisingly easy - we’re going to use a Teensy.
[2:03] A Teensy can pretend to be many USB devices, including a USB audio device.
[2:08] What’s really cool with the Teensy is that you can design your Audio project in a graphical
[2:12] environment so it’s pretty easy to get some simple code up and running.
[2:16] Here I’m connecting the I2S input through an amplifier and out to the USB interface.
[2:21] This generates some very simple code that we can copy and paste it into our sketch.
[2:25] We just need to set the amplifier gain in our setup function.
[2:28] If you wanted to get fancy then you could hook the value of this gain up to an analogue
[2:32] input and have a volume control on your microphone.
[2:34] There are also a whole bunch of entertaining effects that you can add - all of these run
[2:38] in real-time on the device so you could easily build yourself a real-time voice manipulator.
[2:43] If we plug a Teensy running the simple sketch into the computer it shows up as an audio
[2:47] device and we can record audio from it.
[2:50] That’s pretty amazing for just a few lines of code.
[2:52] How do we get all our microphones hooked up?
[2:55] The Teensy can only act as a single USB device and only supports two channels, so I’ve got
[3:01] two Teensys connected to support my three microphones.
[3:04] Hooking up the I2S MEMS microphone is trivial.
[3:07] The really nice thing about this kind of microphone is that you can just connect it directly to
[3:11] the I2S interface of your microcontroller.
[3:13] To make sure it’s got a nice clean power supply I’m using a battery and a low drop out regulator
[3:18] to feed it 3.3volts.
[3:20] This is probably completely unnecessary but we’ve seen when using the ESP32 how easy it
[3:24] is to get power supply noise interfering with the microphone.
[3:27] For the two analogue microphones there’s a bit more work to do.
[3:30] The electret microphone requires a small bias voltage to work and I’ve got a nice little
[3:34] MAX9814 breakout board that can supply this.
[3:38] This board also has a handy built in 5v linear regulator so once again we can power it from
[3:43] a nice clean battery - I’ll also tap off from this 5v supply for some of the other boards
[3:47] we need.
[3:48] The MAX9814 is a very nice little chip and include an automatic gain control so it will
[3:53] be interesting to see how it performs.
[3:55] The dynamic microphone requires a very high gain pre-amplifier as the signal coming from
[4:00] the moving coil is very low.
[4:02] I’ve got a small breakout board based around the AD828 op-amp that has been configured
[4:07] as a microphone pre-amp.
[4:09] This requires a 5v power supply so I’m taking a line off the MAX9814 board to power it.
[4:15] Both of these microphone pre-amplifiers will give us an analogue signal so we need to
[4:18] pass them both through an analogue to digital converter.
[4:21] Fortunately, I have another breakout board that contains a PCM1808 which is stereo Analogue
[4:27] to Digital Converter that outputs an I2S signal.
[4:30] This requires both a 5v supply and a 3.3v volt supply for the 5v supply we’ll use the
[4:36] clean power coming from the linear regulator and battery.
[4:38] For the 3.3v supply, we can just use the power from the Teensy as this is the supply for
[4:43] the digital part of the IC.
[4:44] Now that our signal is I2S we can just connect it straight to the Teensy and use it as a
[4:49] stereo microphone.
[4:51] With everything wired up and plugged in I’ve mapped all these inputs along with my shop
[4:55] bought USB mic through to one single audio device so I can record them simulataneously.
[5:00] I’ve normalised the four different samples to remove any difference in volume.
[5:04] This is my shop-bought USB microphone.
[5:08] And this is the ICS43434.
[5:16] And here’s the dynamic microphone.
[5:21] And finally here’s the electret microphone.
[5:23] To my hearing, both the analogue microphones seem slightly flatter than the shop-bought
[5:31] USB microphone.
[5:32] The MEMS microphone doesn’t seem to have as much base as the shop-bought microphone, but
[5:36] it sounds pretty good.
[5:38] If we look at the spectrograms of each signal we can see some differences.
[5:41] Both the analogue microphones seem to be missing some of the higher frequencies.
[5:45] This makes me suspect that the A2D converter may not be giving us the full range.
[5:50] The MEMS microphone seems to go to the full 20KHz range, but also seems to have picked
[5:55] up some high frequency noise.
[5:57] All this has made me wonder what’s actually in my shop-bought microphone.
[6:03] So I’ve taken it apart and see what makes it tick.
[6:05] Looking at the microphone it’s an electret microphone, we can confirm this by checking
[6:09] to see if it’s magnetic and also by checking the bias voltage which is pretty low.
[6:14] The electret microphone capsule is bigger than my electret microphone - it’s 1.5cm vs
[6:18] 1cm - this means that my shop-bought microphone is going to be more sensitive than my home
[6:24] made version.
[6:25] In terms of electronics, everything is being done by this one chip, a RealTek ALC4042.
[6:31] It’s quite hard to find very much information on this chip, but it does seem to be used
[6:34] in a lot of products.
[6:35] Having looked inside the microphone, it’s quite tempting to attempt some kind of upgrade
[6:39] to it, but that’s probably for another video.
[6:43] I promised you a test - so here it is.
[6:45] The audio for this video was actually recorded using my new microphones.
[6:49] The introduction and first section was recorded using the MEMS microphone, the third and forth
[6:55] sections were recorded using the electret microphone and the fifth and sixth sections
[7:00] were recorded using the dynamic microphone.
[7:03] This final section is being recorded using my shop-bought USB microphone.
[7:07] Could you tell any difference in the audio?
[7:09] Let me know in the comments.
[7:11] I’ll see you in the next video!


HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts