Microphone with software adjustable sensitivity

Im looking for a microphone that I can adjust the sensitivity (gain??) via software.

I've been using the Sparkfun Sound Detector so far, and it's worked really well. However, it's just not sensitive enough for my needs.

The reason I need a microphone without a pot is that it will be mounted in an inaccessible part of a costume, and I would need to adjust the sensitivity constantly thus why I need a fixed adjustable sensitivity mic.

It has a resistor pad that adjusts the gain at customer application.
If you only need a fixed higher gain than default factory option, you only need to replace the resistor.
However, If you want to variable gain from Arduino code, install a digital potentiometer instead of a resistor.
You can change the gain by communicating with the digital potentiometer from Arduino and changing the resistance value.

Interesting . . . I've never heard of a Digital potentiometer before

A digital potentiometer is an IC that changes the resistance value by communicating with uC(Arduino) via SPI and I2C (or etc) instead of rotating the POT by your hands.
It is sold by various manufacturer, but for this application, I think that most products will fit if you choose the correct value of resistance and communication method you likes.

Looks like 1 Meg would be suitable, which is kind of a pity since that severely limits the product selection as most digital pot types only have variants that go up to 100k. I'd put a 100k fixed resistor in series with the 1Meg digital pot and tie the wiper of the pot to the lower terminal so that the effective range becomes 100k ~ 1.1Meg. This would allow for a gain range of 20dB to a little over 60dB.
Looks like AD5241 would be a suitable digital pot; it can conveniently be programmed via I2C. It's a relatively expensive part though, compared to the simpler types that are often used.

If only a modest increase in gain is desired, you might be able to get away with a 100k digital pot, which gives much more options for product selection.

1 Like

I'd put a 100k fixed resistor in series with the 1Meg digital pot and tie the wiper of the pot to the lower terminal so that the effective range becomes 100k ~ 1.1Meg. This would allow for a gain range of 20dB to a little over 60dB.

That's an excellent idea.

Looks like AD5241 would be a suitable digital pot; it can conveniently be programmed via I2C. It's a relatively expensive part though, compared to the simpler types that are often used.

So what I've found is the AD5241BRZ1M
https://au.rs-online.com/web/p/products/4972678/
This looks to be the chip I need.

Im then going to mount it onto an adapter
https://au.rs-online.com/web/p/products/1582890/

This way it can be used on a bread / protoboard

1 Like

Yeah, that should work. I think you can get much cheaper adapter boards, but you'd have to do some googling. Personally I'd just design a custom pcb but that may be a bit challenging if you've never done this. An adapter board is a good alternative.
How much gain do you need exactly? Maybe 100k + 100k digipot will already be ok. 100k digipots are also available in DIP packages.

Yeah. I think that chip will work to fine.
As @koraks says, 1 Meg Digi-pot is rare option and a little expensive. :pensive:

The chip is different, but here is the official Digipot tutorial using I2C.
It might be good to read.

Im not entirely sure how much gain, I'm going to need.
What I'm trying to do detect music that is being played in a room and use that adjust LED colours.
I've got the full code working, but currently, the sensor only works if I place it right on top of the speaker.

The one 1M pot and adapter is a bit pricey, looking at $76 Australian Dollery-doo's because the only reputable supplier only sells in packs of 5.

I'll have to do more of a search to find cheaper chips and adapter.

Well, if you go with the 1 Meg pot, you've got as much gain as you can feasibly get from that module, so it's your safest bet.
I'm a bit surprised that you'd need to put the module right next to the speaker for it to trigger; this suggests that something isn't entirely right.

Hummmm, could be something wrong with the sensor in that case. I'll get a replacement one just in case.

But having the 1 Meg pot, as you said gives full range of sensitivities

You may be able to recheck your project before you purchase Digipot...? :thinking:
And it's a good idea to simply use the normal ":ok_hand:hand " trim-pot to find the right gain ranges.

I'd be surprised if the module itself is faulty, really. Such devices are usually very reliable. Can you show/tell us a bit more on how you have implemented it? The microphone isn't locked inside some kind of housing, is it?
Good idea to check with a normal pot first, or even with fixed value resistors, before getting the right digipot.

This is how ive implemented the project so far.
Eventually, it will be put in a housing of sorts, but I'll try and ensure there is a slot for the mic to be as exposed as possible.

Forgive the mess :frowning:

I'm still prototyping at this stage.

When it's mounted in the costume, it wont be accessible.
My idea is to adjust the pot to ensure the readings fall withing a specified range, if they are to high reduce the sensitivity and vise versa.

No.
It's step by step.
Connect a standard POT just for prototyping and investigate the required gain range.
Once you have finally determined the correct gain range you need, buy a suitable specs Digipot and prototype it again for digipot code.

Take a look at the pictures of your current setup.
Are you unable to access the POT now?

The first thing to do now, is to actually fine tune the beat detection trigger and optimize the software for it. So just stick to Serial.print's or blinking a led based on sound peak detection to see how much sensitivity you need to actually reliably detect the peaks. I have a feeling that part of your lack of gain issue might be related to software more than hardware.

Okay, I understand what your saying now.

There isn't a pot on it right now. I'll have to go out and get a pot with a high enough resistance to test as you've suggested, as I don't have one to hand.

Yes, "Cut and Try" prototyping is many cases works goes fine.
However, as @koraks says, that project may be possible to get it to work properly with the this module's factory default gain.
But I can't say the exactly answer because I don't know the current schematic and Arduino code...