1
\$\begingroup\$

I want to use an electret microphone to detect infant cry. I came up with this design: crying detection circuit

According to those papers:

Values of C1 and C3 were calculated to create a band pass filter with a bandwidth of 250Hz-550Hz (capacitances are taken from E24 value series so the band is not 100% precise).

Voltage divider consisting of R1 and R2, outputs 1.65V threshold Voltage for NE5532. I want to output of amplifier to oscillate around this value (Vt). The output of the amplifier will be fed to MCP3008 - that's why voltage can't be higher than 3.3V.

R5 resistor is used to drive transistor inside the microphone.

R3 and R4 need to be changed (I don't think I will need a gain of 21 but I still did not get my microphone for testing).

I chose NE5532 because of its low-noise amplification, I think it will be better for this kind of task but, it might be an overkill and LM358 will do the job just fine.

Will this circuit work as described it?

As I mentioned before, the output is connected to ADC, which is connected to raspberry pi. Based on voltage level, raspberry pi will e.g. rise alarm.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ As someone who has worked on very similar projects to what you have proposed in this question, I would like to comment that approaching this problem with an electronic based solution is far from ideal. This is a DSP audio processing problem that should be done in software if you want reliable performance. All this filtering can effectively be done in software when using a well-designed PDM microphones signal. \$\endgroup\$ – Jack Soldano Sep 10 '20 at 13:59
  • \$\begingroup\$ @JackSoldano at least, a digital solution is more flexible and ajustable. You only need to do the hardwaredesign once. redesign the sw is much better. You even can record the baby with the ADC of the board and go to e.g. matlab/octave and test your concept prior to writing any line of application code... (you just need to setup some communication to a PC and get the ADC running) \$\endgroup\$ – schnedan Sep 11 '20 at 10:08
2
\$\begingroup\$

Andy aka has given you some good advice on the amplifier. I'll let that stand.

I'm going to address the "detecting the baby" part.

You've got a fairly powerful processor in the Pi. You can use it to do some signal processing to get a more reliable detection than just the "loudness" from your "baby bandpass." You could, for example, implement a better bandpass in software than you could ever build in hardware. There's, of course, much more that you could do. A better bandpass is just a start.

For now, your plan has the Pi doing things that can be done just as easily (and poorly) in hardware. It doesn't take a computer to detect a sound crosses a loudness threshold. A comparator can do that, and it is loads cheaper and easier to do.

What I would suggest is the you get GNU Radio, Python, Numpy, and SciPy installed on your Pi.

GNU Radio makes interfacing with soundcards easy. You can use the "GNU Radio Companion" to assemble processing flows like drawing a flow chart in a GUI.

If you find you can't get what you want with the standard filters and things built into GNU Radio, then you can use a Python program block in GNU Radio to do more advanced processing with Numpy and SciPy - as well as having all the programming abilities of Python available.

You can build your cry detector in the GNU Radio Companion GUI, then export it as a Python program that can run outside of the GNU Radio GUI.


The filter you have implemented in your amplifier is rather weak. Sounds outside of its designed pass band will still get through - somewhat weakened, but they'll still be present. The filters available in GNU Radio can reduce the out of band sounds much better.

The flexibility of a program lets you do things like automatically adapt to the noise level of the room, or only trigger when you've detected a cry signal over some length of time.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you for your answer! I am aware that software approach would be much more comprehensive (I should mention about that in question probably). Combination of signal processing and neural networking (adapting to crying sound) will be the best solution for this problem. But I just want to learn more about electronics and PCB designing. Cry detection is part of a project I am currently working on and "hardware way" is only way possible for me (project rules). I need raspberry pi to send those informations (MCP also controls breathing of the baby) later to Qt applications via wifi. \$\endgroup\$ – eredin Sep 10 '20 at 14:02
  • \$\begingroup\$ Regardless of your "hardware only" rule, you will have to evaluate the output level (cry loudness) in the Pi. That's softwarw. \$\endgroup\$ – JRE Sep 10 '20 at 14:17
  • \$\begingroup\$ @ChrisStratton: The schematic in the question shows the amplifier output going into the Pi as an analog signal. That leaves the evaluation of the level (cry/no cry) as a task for the Pi. \$\endgroup\$ – JRE Sep 10 '20 at 14:51
  • 1
    \$\begingroup\$ Ah, missed they were driving an ADC. In that case, this is just a bad attempt at building a pi microphone input. Really they should get an I2S audio ADC (or even USB audio chip) and study suitable pre-amp designs. Or buy an I2S MEMS microphone... but those packages are hard for the inexperienced to solder. \$\endgroup\$ – Chris Stratton Sep 10 '20 at 14:54
1
\$\begingroup\$

I chose NE5532 because of its low-noise amplification, I think it will be better for this kind of task but, it might be an overkill and LM358 will do the job just fine.

The NE5532 needs a minimum 10 volt supply. The LM358 is more power-supply friendly. As always, read the data sheets cover-to-cover then, as you becomes more experienced you'll know just where to look to find stuff.

Will this circuit work as described it?

It won't be a very good band-pass filter because both skirts are 1st order and there will be significant interaction and a sloppy result. If it's really important to use a band-pass filter, look towards using sallen-key filters or other similar topologies. Better still, get a simulation tool and check it out before building.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.