Projects

Electronic Stethoscope

Experimenting with a sensitive microphone amplifier and microphone enclosure design

Daniel Koch

Issue 67, February 2023

There are times when human hearing just isn't good enough. Maybe it's a volume issue, and a sound is too faint to be heard easily, properly, or even at all. Other times, it's a processing issue, where the brain cannot isolate the sound from other, louder noises. When fault-finding in electronics, mechanical fields, and other situations, it can be helpful to have a tool to isolate sounds. The humble stethoscope, a symbol of medicine around the world, is such a device.

We wanted to try building an electronic version. The main reason was curiosity, to see if we even could. There are a range of challenges in doing so, and we wanted to explore them. The other reason is to begin a quest to do things traditional stethoscopes cannot, like add frequency filtering or variable gain. Finally, we want to explore different input devices, like an electret microphone and a piezo device, or maybe even a coil cartridge. Here at the beginning of the project, we don't know if we'll get to all of those things this month, but we'll make a start. This project will definitely be multi-part. We won't bring them to you one after the other necessarily, because it may get boring and we anticipate some development time and in the current climate, long waits on parts! Instead, they'll probably be here and there. For now, let's get into it!

CONCEPTS AND CRITERIA

We established some criteria for our initial build, and we'll revisit these as we explore. We decided:

  • No hard-to-get parts, which mainly means parts available over retail counters and nothing from wholesalers or commercial/trade suppliers.
  • The build has to fit on one solder breadboard, the 400-hole type that mimics regular non-solder prototyping breadboards.
  • We can't get too bogged down in perfect amplifier design, because other parts of the system will be far from perfect anyway.
  • The sensor element needs to be versatile so we can change out different ideas.
  • 3D printing is for the sensor housing but it would be better if we used pre-made or recycled parts.
  • It needs to be battery powered for portability, and ideally, 5V powered so USB power banks can be used.

The concept was to have an electret microphone in some sort of housing that would shield it from background noise and isolate what we wanted to listen to. This would feed into a preamplifier to make the electret output into a usable

signal, then into another amplifier to boost it enough to use headphones. The second amplifier needed to be gain-adjustable so the volume could be increased. The filters are probably going to have to wait, because they won’t fit on a board, but that's ok. It's worth exploring the basics of the concept to see if it will even work before we go designing filters!

THE ELECTRET MICROPHONE

Electret microphones are, relatively at least, cheap, easy to use, reasonably effective, and readily available. We chose to base our first design on one for those reasons. They are also called condenser microphones, and that gives a bit of a hint as to how they work. They are, in a complicated and not-quite way, capacitors. It is an electrostatic device, but whereas normal electrostatic devices need a polarised power supply to charge two electrodes or surfaces with opposite charges, the electret has a charge built in. The term comes from 'electric' and 'magnet', and it is a lot like the electrostatic version of a permanent magnet. In modern times, this usually means forcing excess charge into a good insulator such as PTFE, while the material is still solid, with corona discharge or a form of particle accelerator. Historically, they were made by melting the dielectric and letting it solidify within a strong electrostatic field. This diagram is of an electret microphone.

The result is a material with a permanent electrostatic charge. This material is then used as one half of a capacitor. In modern designs, the electret material is also the diaphragm, the part that flexes in and out in response to sound waves. Historically, electret materials were not good at being diaphragms for mechanical reasons but modern material science has changed that. On the back of the chamber is a plate, which is affected by the charge on the moving diaphragm. As the diaphragm moves inward, the charge in it repels charge in the plate, causing a current to flow. When the plate moves in, the charge attracts charge in the plate, and current flows the other way.

Therefore, the electret microphone is technically not a capacitor at all, because the plates are not storing an externally applied charge as an actual capacitor does. Real condenser microphones do need this applied current because they are built as capacitors, and this leads to some confusion in the naming. The polarising or bias current required for a genuine condenser microphone is also sometimes said to apply to electret microphones but this is incorrect. The permanent electrostatic charge of the electret takes this role, moving charge around in the other plate. For comparison, this diagram shows a real condenser microphone.

However, power is needed. It is just not biased or polarising power. The non-charged plate of the electret microphone is connected internally to the gate of a Field Effect Transistor (FET) inside the casing, which acts as an amplifier. As the charge builds in the plate, current flows to the gate and activates the FET. When the charge falls in the plate, charge leaves the FET's gate and it turns off. Remember, a FET does not have a current path from gate to source like a bipolar transistor has a path from base to emitter. It is an electrical field influence, and is itself capacitive.

It is this FET section that demands the applied power, not the sensing element. Current flows through the FET as a response to the closed loop controlling its gate. This is also one of the things that make an electret microphone so easy to use for makers and hobbyists: The signal output is already stronger than many other types of microphone element. This requires a low-current power supply, and external current limiting is needed to ensure the FET is not overloaded across its source-drain connection. Also, because there is a DC voltage present, a capacitor is needed to extract the audio signal and block the DC voltage source.

Electret microphones are sold in small aluminium cases, usually around 10mm in diameter and 6mm to 8mm high. Plenty of variations exist but all are polarised because of the FET. On the underside, a PCB is usually visible. One pin is isolated, while the other has PCB tracks to the case. This one is the ground, and the isolated one is V+/Signal.

THE PREAMPLIFIER

Because of the specifics of running an electret microphone, it is very possible that this first preamplifier section will not suit very many other microphone or sensor types. It may work with an actual condenser microphone, if you're lucky enough to find one. However, they're not commonly available at retail, nor are moving coil microphones. Therefore, we're plunging ahead and we'll try a different preamp when it comes time to explore piezo elements.

We chose to base the preamplifier on an LM358. This is far from a perfect op amp, but it is very common and readily available, and well-supported with documentation and others who have 'already done that'. The datasheet for it and its relatives from Texas Instruments is even titled 'Industry Standard Dual Operational Amplifiers'. 'Better' and more specialised op amps lack that level of information and support. In addition, it runs very happily from a single supply and at the voltage we want to work with, +5V.

The design we have ended up with is similar to some others (as is often the case with simple circuits and regarding common components like the LM358) but we have some unique features that we didn't see anyone else using. Part of that is to add flexibility. The supply current for the FET inside the electret capsule is provided by a 10kΩ 25-turn trimpot R1. Other designs use a fixed resistor but we wanted to have variability so we can try different microphones.

The key is getting the FET voltage right for each manufacturer's data. The 470nF capacitor C1 provides decoupling, allowing the AC signal through without the DC FET power. The other end of C1 is connected to the bottom of a voltage divider formed from 24kΩ R3 and 1MΩ R7, the middle of which connects to the inverting input of the op amp. The voltage divider's other end comes from the op amp output and is part of the feedback network.

For the non-inverting input, we have another voltage divider, but this one is adjustable. It is the reference voltage and controls the shape of the output. 10kΩ R4 and 4.7kΩ R6 form the upper and lower limits respectively, while 20kΩ 25-turn trimpot R5 provides the adjustment for the position of the waveform. You can slide the centre up and down between the voltage rails, so start with this resistor at the midpoint.

PROTOTYPING

Before we committed to soldering, we wanted to prototype this on a breadboard both to verify its operation and come up with a viable layout. We centred the op amp to start with, then started placing the voltage divider components for the non-inverting input. Those fit relatively easily. Unfortunately for us this time, the inputs and output for each op amp are on one side of the IC. For ninety nine percent of users and uses, this is ideal. For us, it means a lot more has to fit on one side of the breadboard, arguably using space less efficiently. However, we made it work.

The output components go to the left to feed back to the input, which uses the 24kΩ resistor to link across to the 470nF capacitor crossing the gap in the board. This allows the trimpot between the supply rail and the electret to be on the other side of the board.

Next, R1 was adjusted, with a multimeter, to be at its maximum value. If you do not have probes like these for your multimeter, you are missing out. They are custom made but simple, being just banana plugs for the multimeter on one end of a soft silicone wire, and Dupont pins on the other, the same as fitted to breadboard jumper pins. They make taking multimeter readings so much easier.

Then, 5V was applied to the supply rails and the multimeter placed across the electret. R1 was adjusted until the voltage at the electret/C1 junction was 2V, which was close to the lower voltage for our unit. The datasheet specifies up to 10V but we cannot just connect it to the supply rail, because it needs to be current limited for the sake of the FET. The datasheet for ours does not specify a maximum current (or much else, to be honest. It was poor) but does suggest a typical consumption of less than 1mA. This is something for later experimentation.

An oscilloscope was hooked up to the output and R5 was adjusted until the voltage line was reading 2.5V. At this point, a phone was placed next to the electret with music playing, and the oscilloscope used to check if there was an appropriate-looking output at pin 1 of the op amp.

THE OUTPUT AMPLIFIER

The output amplifier, which will drive headphones, is based on the LM386. This is another commonly-available option which, like the LM358, is far from the best option but is still very good. It is also far cheaper, more available, and better supported than some of the 'better' options. So, we'll use it. What's more, there is a perfect circuit right there in the datasheets. We're going with a unit that has a gain of 200, with an adjustable input for volume control. Again, we wanted to prototype it, but this time that was mainly for layout exploration. The circuit itself is one we have used and built before. We prototyped on a separate breadboard, and would use jumper wires when the time came to join them together for a final test.

The Main Build:

Parts Required:IDJaycarAltronicsPakronics
1 x Solder Breadboard-HP9570H0701ADA1609
1 x Packet Breadboard Wire Links-PB8850P1014ASS110990044
1 x 10Ω ResistorR9RR0524R7510DF-FIT0119
1 x 4.7kΩ ResistorR6RR0588R7574DF-FIT0119
1 x 10kΩ ResistorR4RR0596R7582DF-FIT0119
1 x 24kΩ ResistorR3RR0605R7591DF-FIT0119
1 x 100kΩ ResistorR2RR0620R7606DF-FIT0119
1 x 1MΩ ResistorR7RR0644R7630DF-FIT0119
1 x 10kΩ Log 16mm PotentiometerR8RP7610R2233-
1 x 10kΩ 25-Turn TrimpotR1RT4650R2382A-
1 x 20kΩ 25-Turn TrimpotR5RT4652R2384A-
1 x 10pF Ceramic CapacitorC2RC5312R2810DF-FIT0118
1 x 47nF MKT or Greencap CapacitorC5RM7105R3021BDF-FIT0118
1 x 470nF MKT or Greencap CapacitorC1RM7165R3033B-
1 x 10µF Electrolytic CapacitorC4RE6066R5065DF-FIT0117
1 x 100µF Electrolytic CapacitorC3RE6130R5123DF-FIT0117
2 x 220µF Electrolytic CapacitorC6, C7RE6158R5143DF-FIT0117
1 x LM358 Operational AmplifierIC1ZL3358Z2540-
1 x LM386 Amplifier ICIC2ZL3386Z2556-
1 x Electret Microphone Insert-AM4011C0170-

Parts Required:

* Quantity shown, may be sold in packs.

Now, it was time to assemble the final, soldered build. This involved combining both prototypes on one solder breadboard which, annoyingly, is two rows shorter than the solderless version anyway. However, while working, we had thought of a couple of ways to compact the builds anyway. First, all the wire links and resistors were soldered in.

Then, the ICs were added, and then the capacitors and trimpots. Finally, the potentiometer for volume control was added, along with PCB pins for power, output socket connection, and electret microphone input. Because we swapped components straight from solderless to soldered breadboards, no readjusting was necessary for the trimpots. Although we hate doing it, one small piece of hookup wire was required to be forced under the 10pF ceramic capacitor to connect to pin 1 of IC1, to go to the input of the potentiometer for the output stage.

Power was applied using a cut-up USB cable, and the electret was connected via a length of twin-core light-duty speaker wire. This enables a bunch of different microphone housings to be tried without disturbing the PCB. For the headphone connection, we used a stereo 3.5mm line socket and added wires, one to bridge both left and right, and one for ground. Unfortunately, if a mono socket is used, the right-hand channel connects to ground and no sound is heard. At least this way, while still a mono source, sound will be heard in both ears. Note also that we rearranged a couple of components during the build, so the Fritzing above is correct, and not the early-stage photos.

We plugged in a set of headphones and a USB power bank, and were instantly greeted with a horrendous noise before even getting the headphones near any ears. We tried to turn down the volume but that made it worse. Disconnecting power, we started investigating and found three things: The A10kΩ Logarithmic potentiometer we had used was faulty. It changed when the casing was touched, was noisy, not consistent, and had a whole section of its rotation with no sound. This is a workshop item and so has likely been well-used in the past. It needs replacing.

We also found the 470nF MKT capacitor was likewise well-used from prototyping and had possible connection damage inside the case where the leads pass through the resin and connect. The resin was fractured. Thirdly, and most significantly, the USB power bank was a cheap one and had atrocious DC-DC conversion in it. It was responsible for much of the screaming and noise, and things were far better when it was replaced with a better quality one. The other two components need replacing but we can keep testing for now. With just the power bank replaced, we can hear sounds through the microphone, validating the circuit.

MICROPHONE HOUSINGS

We had two ideas to pursue for microphone housings. The first was somewhat inspired by the stethoscope. The idea is to have a chamber, insulated from outside sound, that can be pressed against a surface to hear sound coming off or through it. The second idea was to put the electret into a long tube, which would have the effect of making it very directional. We considered a parabolic dish but that's another challenge for another time. This is about isolating sounds, not pulling them in from a distance.

In keeping with our criteria of accessibility, we did not want to use specialised sound-damping materials. Instead, we hit the dollar shops and came back with felt, and sheets of EVA foam from the craft section. We are going to use this to line the inside and outside of an aerosol can lid which will form our isolating chamber. The foam will extend under the lip of the lid, so that when pressed against the surface, there is no contact between the surface and the housing body to induce reverberation or contaminate the surface with any vibrations picked up by the housing body.

The second idea is two 3D-printed cones. The inside of the bigger one will be felt-lined, while the inside of the smaller one will be foam-lined, and the smaller one fits inside the bigger one. An EVA foam seal is to be glued on the end of both.

This should provide lots of isolation. That was the theory. In the event, this was quite a fiddly job to get right. In particular, lining the larger cone with foam without lumps and bunches to stop the smaller cone fitting in was quite the challenge, and the fit was not great.

The tube idea was much easier to implement. We used a short scrap of 15mm PVC pressure pipe left over from the wireless controlled water rocket launcher project, rolled up a sheet of EVA foam and slid it in, glued it down, and that was it. The Electret was slid into the back and glued into the centre with hot melt glue.

This maintained good isolation, as the glue is soft enough to not transmit vibrations well. Our future idea is to find a size of pipe that can fit over this with a foam liner involved, and in effect create a focusable device: As the pipe is slid forward, the angle between the microphone and the edge of the front of the pipe narrows, and therefore the angle of acceptance does too.

After plugging these in one by one to the PCB, we found results varied. The tube idea works well. Little stray sound gets introduced, and the pointer idea works, too. It can be pointed very specifically and only hear sounds coming from exactly that point. We like this one so much, we're thinking of printing a housing to make it a permanent one-hand operated unit.

The chamber ideas had mixed results. The double cones work ok, but need more care taken in assembly: The fit is not great and so performance suffers a bit. The aerosol can lid works but again, some contamination occurs. Perhaps thicker foam would help, or more external shielding. The principle seems valid from these few tests and we want to pursue it.

WHERE TO NEXT

There are three further directions we want to take with the sensor side of this project. The first is to build a better chamber for the electret, one which has a diaphragm across it like a real stethoscope. The second is to buy a real stethoscope and mount the electret in that. This will need care as stethoscopes vary in size and a big enough one will be needed. The third is to make a point-source device, like a mechanic using a screwdriver to the ear to listen to exact points on an engine surface.

In electronic terms, we want a more sophisticated circuit. A much more complex one is in the works, which has high- and low-pass filters, some other noise control, and a better preamp and mainstage amplifier. It will also have its own battery.