# Sound Sensors and Program needed

**URL:** <https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303>\
**Category:** Hardware\
**Created:** [2 January 2019 06:37 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303 "2019-01-02T06:37:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonyy](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@anonyy](https://discourse.nodered.org/u/anonyy)\
**Post date:** [2 January 2019 06:37 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/1 "2019-01-02T06:37:07Z")

</div>

Hi Im doing a school project about a sound sensors which rings when it reaches the decibel programmed on it. And i want to attache a display board on it, when the bell rings i can see a message on a display board. Can anyone give me an advice how to do this thing? I just need answer, What sound sensor compatible on my project? Also, i need a software program to it :\<

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [2 January 2019 08:07 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/2 "2019-01-02T08:07:12Z")

</div>

Various ways to achieve this.

A low-cost microphone insert is a good place to start.  
Here's a link to one such product example.

[https://www.cricklewoodelectronics.com/G143C.html](https://www.cricklewoodelectronics.com/G143C.html)

You could feed the mic's output into an Arduino or a WeMos D1 Mini (ESP8266-based controller).

Note:  
The Raspberry Pi does not have an analog input, so it's not really useful unless you also use an analog-to-digital-converter (ADC) integrated circuit (extra cost).

Take a look at this youtube video - might give you some ideas.

Note:  
Some of the solutions will obviously depend on your budget and what resources you have available.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [2 January 2019 16:18 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/3 "2019-01-02T16:18:55Z")

</div>

I have a low-cost sound sensor attached to one of my ESP8266 sensor platforms. It is one of the ways that I know if anyone is in the house.

It is a 1-Wire Sound Sensor containing an LM393 chip and a microphone. Can't remember where I got it from but I'm sure there are loads on AliExpress for next to nothing.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2c7193a70529af4e5165ed0eba5511f07f1ca443.png)

You just adjust the on-board resistor to get the required sensitivity. Any sound over the set level triggers an output. Coupled to a Wemos D1 Mini ESP8266 board along with temperature, humidity and light sensors, this sits in my hallway. The D1 mini outputs data direct to MQTT. I can then process that using Node-RED. One of the things I do is to save the data to InfluxDB for use on various dashboards.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5c65a549380e74d767212daeecf08743a1c2f81c.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/01a205c0a56fea7259f99366193a471c7caf01a9.png)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [2 January 2019 22:23 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/4 "2019-01-02T22:23:09Z")

</div>

> [@dynamicdave](#):
>
> A low-cost microphone insert is a good place to start.

Hey David, I'm new in this area but can't Seraphine just use a **sound senso** r (instead of a microphone) ??

- Such a sensor is very [cheap](https://nl.aliexpress.com/item/3pin-Voice-Sound-Detection-Sensor-Module-Intelligente-Smart-Robot-Helicopter-Vliegtuig-Boart-Auto-voor-arduino-Diy/32676696291.html?spm=a2g0z.search0104.3.10.319f5d17ez6T01&ws_ab_test=searchweb0_0%2Csearchweb201602_4_10065_10068_319_317_10696_10084_453_454_10083_10618_10304_10307_10820_10821_537_10302_536_10843_10059_10884_10887_100031_321_322_10103%2Csearchweb201603_6%2CppcSwitch_0&algo_pvid=cce56147-ff3f-4126-8938-665ee21a1f4f&algo_expid=cce56147-ff3f-4126-8938-665ee21a1f4f-1) ?

- You can directly connect it to the Raspberry GPIO pins (without need for Arduino or other boards), as explained in this [video](https://www.youtube.com/watch?v=GiXNUYPrQ7I).

- And perhaps he can experiment with the decibels, by playing with the [sensitivity](http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/arduino-sound-detection-sensor-tutorial-and-user-manual/) via the potentiometer (????):

But I have never tried it ...

P.S. What I have tried some time ago is the sunfounder **usb microphone** , which works [immediately](http://wiki.sunfounder.cc/index.php?title=To_use_USB_mini_microphone_on_Raspbian) on a Raspberry. It is also very [cheap](https://nl.aliexpress.com/item/Super-Mini-USB-2-0-Microfoon-Portable-Studio-Speech-MIC-Audio-Adapter-Driver-Gratis-voor-Laptop/32910768290.html?spm=a2g0z.search0104.3.1.72d51fdd2BBScI&ws_ab_test=searchweb0_0%2Csearchweb201602_4_10065_10068_319_317_10696_10084_453_454_10083_10618_10304_10307_10820_10821_537_10302_536_10843_10059_10884_10887_100031_321_322_10103%2Csearchweb201603_6%2CppcSwitch_0&algo_pvid=268930d3-eabc-4b0c-9e52-89da092a8fae&algo_expid=268930d3-eabc-4b0c-9e52-89da092a8fae-0), but I had almost to scream in it. From the other reviews I conclude that you need some luck when you buy one. But I had to throw mine away ...

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [2 January 2019 22:37 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/5 "2019-01-02T22:37:10Z")

</div>

> [@BartButenaers](#):
>
> And perhaps he can experiment with the decibels, by playing with the [sensitivity](http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/arduino-sound-detection-sensor-tutorial-and-user-manual/) via the potentiometer

This is exactly what I referenced above.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [2 January 2019 22:56 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/6 "2019-01-02T22:56:42Z")

</div>

> [@TotallyInformation](#):
>
> This is exactly what I referenced above.

Ah now I see it. You just use the ESP8266 (connected via MQTT to Node-RED) since your sensor is further away (or you perhaps have multiple sound sensors across your house)? I thought you needed the ESP8266 because the sensor signal wasn't compatible with the Raspberry GPIO pins.

Wow, this must be the first time we agree on something from the start 😂

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [2 January 2019 23:55 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/7 "2019-01-02T23:55:38Z")

</div>

@TotallyInformation - Julian, when you say you have a 1-wire sound sensor, you don't mean that it is a Dallas 1-wire device...right?? Or is it?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [3 January 2019 00:32 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/8 "2019-01-03T00:32:31Z")

</div>

I've no idea whether it was on the grassy knoll! 😉

In truth, when I brought it, that's how it was described. It has a single data line that goes high when the sound intensity goes over the set threshold.

So this can certainly be used on a Pi as well as an Arduino or ESP device.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [3 January 2019 06:33 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/9 "2019-01-03T06:33:29Z")

</div>

Hi Bart,  
That is what I suggested in my initial post.  
The Microphone you show on your diagram is a cheap microphone insert - the same example product I linked to.

The board you illustrate contains an LM393 Op Amp - probably configured as a voltage comparator. The output from the microphone insert goes to one input on the comparator, the other input comes from the potentiometer (which is used to set the trigger threshold).

When the sound output goes higher than the threshold the Op Amp outputs a logic 1 (probably 3.3V), otherwise it ouputs a logic 0 (0V). So all you get out of this circuit a logic 1 or 0 indicating if the threshold was crossed or not.

If the output from the microphone insert was fed into an analog-to-digital-converter (ADC) then you would get out a numerical value proportional to the sound input level.

Which method to use depends on what the person is trying to do.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [3 January 2019 06:36 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/10 "2019-01-03T06:36:34Z")

</div>

Hi Paul,  
I think Julian meant it had one output connection (it's not a Dallas 1-wire device).

You can find these comparator boards being used in many situations.  
For example, when I purchased some moisture sensors (from my favourite shop in China) these boards came with each probe.

---

<div class="post-metadata">

**Author:** ![BNMEZR](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@BNMEZR](https://discourse.nodered.org/u/BNMEZR)\
**Post date:** [12 July 2020 19:56 UTC](https://discourse.nodered.org/t/sound-sensors-and-program-needed/6303/11 "2020-07-12T19:56:29Z")

</div>

hi dynamicdave  
i have the same as you said :

> [@dynamicdave](#):
>
> output from the microphone insert was fed into an analog-to-digital-converter (ADC) then you would get out a numerical value proportional to the sound input level.

and i need to convert those numerical value to .wav file so i can feed them to my deep learning model ,  
but i dont know how to that ,can you provide me with any help ?  
thank you
