Make A Smart Sound Sensor for Home Automation | ESPHome & Home Assistant Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ค. 2024
  • KY-037 Voice Sound Detection Sensor (Amazon Affiliate) - amzn.to/3L2wsj9 amzn.to/405Pv01
    KY-037 & KY-038 Voice & Sound Detection Sensor (AliExpress Affiliate) - s.click.aliexpress.com/e/_Dno... s.click.aliexpress.com/e/_De0...
    In this video I'm going to show you how to make a smart sound sensor using an ESP board like D1 mini, ESPHome, and Home Assistant.
    This DIY project is super affordable, costing less than $4 in total, and the possibilities for automation are endless. You can use it to turn on your lights, upgrade your security system, and much more. I'll show you exactly what you need to get started, from the D1 Mini board to the KY-037 sound sensor and 3 jumper wires.
    I'll also walk you through the software requirements, including ESPHome Dashboard and Home Assistant, which are essential for getting your smart sound sensor up and running.
    So join me in this tutorial and let's create a DIY smart sound sensor that can improve your home automation game.
    ► MY ARTICLE ABOUT THAT TOPIC - peyanski.com/diy-smart-sound-...
    ► MY HOME ASSISTANT INSTALLATION METHODS FREE WEBINAR - automatelike.pro/webinar
    ► DOWNLOAD MY FREE SMART HOME GLOSSARY - automatelike.pro/glossary
    ► AFFILIATE LINKS FROM THIS VIDEO
    KY-037 Voice & Sound Detection Sensor (Amazon) - amzn.to/3L2wsj9
    4pcs KY-037 Voice & Sound Detection Sensor (Amazon) - amzn.to/405Pv01
    KY-037 & KY-038 Voice & Sound Detection Sensor (AliExpress) - s.click.aliexpress.com/e/_Dno...
    KY-037 Voice & Sound Detection Sensor (AliExpress) - s.click.aliexpress.com/e/_De0...
    D1 Mini (AliExpress) - s.click.aliexpress.com/e/_AFgAIp
    D1 Mini (Amazon) - amzn.to/3A5jNoc
    Jumper Wires (AliExpress) - s.click.aliexpress.com/e/_Aluq3z s.click.aliexpress.com/e/_A3YiR3
    Jumper Wires (Amazon) - amzn.to/3fRlXyK
    Micro USB Cable (AliExpress) - s.click.aliexpress.com/e/_DmM...
    Micro USB cable (Amazon) - amzn.to/32tdxdF
    (Optional) USB adapter EU US UK (AliExpress) - s.click.aliexpress.com/e/_DCI...
    (Optional) USB adapter (Amazon) - amzn.to/3u2Tdvj amzn.to/3qXkJYS
    ► AFFILIATE LINKS
    Shelly Store - bit.ly/3BwMMn2
    SwitchBot Flash Deals - switchbot.vip/3BwF221
    Reolink Flash Deals - shrsl.com/301ih
    Aqara Amazon Store - amzn.to/3EpeCSb
    Tech that I’m using right now - www.amazon.com/shop/kpeyanski
    Get $100 in credit over 60 days for DigitalOcean - m.do.co/c/6dd2caef1f1f
    Register for Kajabi from here app.kajabi.com/r/NetydFAg and I will share half of my commission with you (15%)
    ► CRYPTO AFFILIATE LINKS
    Sign up for Crypto.com and we both get $25 USD (Referral code: xn86atnceg) - crypto.com/app/xn86atnceg
    Deposit more than $50 in Binance and receive 100 USDT cashback voucher - www.binance.com/en/activity/r...
    Binance - One of the biggest Crypto currency exchange - www.binance.com/en/register?r...
    ► SUPPORT MY WORK
    Paypal - www.paypal.me/kpeyanski
    Patreon - / kpeyanski
    Bitcoin - 1GnUtPEXaeCUVWdJxCfDaKkvcwf247akva
    Revolut - revolut.me/kiriltk3x
    Join this channel to get access to perks:
    / @kpeyanski
    ► TIME TABLE
    00:00 Intro
    00:10 How much will DIY Smart Sound sensor cost?
    00:21 For what the DIY Smart Sound sensor can be used?
    00:48 What parts are needed for the DIY Smart Sound sensor?
    02:01 What software is needed for the DIY Smart Sound sensor?
    03:14 Wiring of the DIY Smart Sound sensor
    04:00 Uploading the ESPHome code to the D1 mini
    06:38 Testing the DIY Smart Sound sensor from the embedded Web Interface
    07:21 Adding the DIY Smart Sound sensor in Home Assistant
    08:53 Creating a Home Assistant Automation using the DIY Smart Sound sensor
    10:14 Challenge for You!
    ► THE ESPHOME CODE FOR THE DIY SMART SOUND SENSOR
    gist.github.com/peyanski/4869...
    ✅ Don't Forget to like 👍 comment ✍ and subscribe to my channel!
    ► DISCLAIMER
    Some of the links above are affiliate links. If you click on these links and purchase an item I will earn a small commission with no additional cost for you. Of course, you don’t have to do so in case you don’t want to support my work!
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 90

  • @major_west
    @major_west ปีที่แล้ว +6

    Great video! I'll place a sound sensor near my table saw so HA can automatically turn on the saw dust vacuum. This is much easier and cheaper than measuring the power from outlet.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Great use case indeed. Thanks for sharing and enjoy!

  • @YorkshireHillbilly
    @YorkshireHillbilly 9 หลายเดือนก่อน

    Great work and very user friendly instructions. I’m using my sound sensor to monitor my Boy Scouts hut fire alarm

  • @PatrickFelstead
    @PatrickFelstead ปีที่แล้ว +2

    Very good Kiril - I wasn't aware of these amplified microphone modules. And also I can't believe I didn't know you can create an automation from a device's integration page with the "+" - wow!

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว +1

      Glad I was helpful and informative :) Enjoy!

  • @Yama_1291
    @Yama_1291 ปีที่แล้ว +4

    This could be a very simple and non invasive away to make a dumb doorbell smart.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Yes, that is a great idea! Thanks for sharing...

  • @geesharp6637
    @geesharp6637 ปีที่แล้ว +1

    Wow, simple and easy. Part ordered.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Great, don't forget to share the news when you make your Smart Sound Sensor!

    • @geesharp6637
      @geesharp6637 ปีที่แล้ว

      @@KPeyanski Almost there. I have it displayed in HA, but I must have the wrong pin for A0. I would have to be a little different and use an ESP32 D1 Mini instead of ESP8266 D1 Mini.

  • @ronm6585
    @ronm6585 ปีที่แล้ว +1

    Thank you.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Thank you too Ron

  • @michaelfalkson317
    @michaelfalkson317 10 หลายเดือนก่อน

    Thanks for the video. What pins would be used on esp32 30 pin and 38 pin as opposed to D1? Thanks

  • @paulcutty8048
    @paulcutty8048 11 หลายเดือนก่อน

    Very interesting. I would like to use the sensor to detect the particular chime at the end of the washing machine cycle.
    Any idea if this would work or can be adapted ?
    Thanks

  • @hundsboog
    @hundsboog ปีที่แล้ว +4

    #SoundSensorOwned!!!! My usage is to let me know, when the dishwasher is finally ready. I had a smartplug before but this was not as precise and lead to a lot of false positives. With this sensor placed very near to the beeping piezo of the dishwasher im sure, it will be much more accurate!

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      That is super good! Thanks for sharing it and Congrats for the #SoundSensorOwned! Great job!

  • @JohnPyn97
    @JohnPyn97 ปีที่แล้ว +2

    Hi! This is awesome thanks! Could you do a tutorial on how to power these esp devices with batteries? I’d also love a vibration sensor tutorial! Thanks!

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Glad you like it. I have no experience with batteries and such sensors so far. Vibration sensor is a good idea. I have to search for a suitable sensor. If someone knows about such - please share it!

  • @gabyxze1
    @gabyxze1 ปีที่แล้ว +1

    nice!

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว +1

      Glad you like it :) Are you going to make one?

    • @gabyxze1
      @gabyxze1 ปีที่แล้ว

      @@KPeyanski yes, it will be part of an alarm system!

  • @stevefpv4669
    @stevefpv4669 8 หลายเดือนก่อน

    Thanks for the cool video dude!
    Question: is it possible to make something like that work with Smart Life or Tuya App?

  • @309electronics5
    @309electronics5 ปีที่แล้ว +2

    Basic Arduino parts, i like it

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Yeah, me too...

  • @DeVosjes
    @DeVosjes 6 หลายเดือนก่อน

    Thanks for the fantastic video👍
    I am going to build this sound detector with the aim of hanging it outside.
    It will light up the garden lights whenever a sound is heard, so as part of my home alarm.
    Greetings from Belgium 🙂

    • @KPeyanski
      @KPeyanski  6 หลายเดือนก่อน +1

      Greetings to Belgium and thanks for the good words. Let us know about the result when you implement it

    • @DeVosjes
      @DeVosjes 6 หลายเดือนก่อน

      Have the project ready in the meantime.
      I had to set the potentiometer on the microphone board to the highest sensitivity to get a readout in Home Assistant, the nice thing is that the decibel value corresponds to the actual value on a decibel meter.
      In absolute silence, the microphone/readout fluctuates between 15 and 26 decibels, but these are fixed values.
      With these values I can integrate the project into my alarm system.
      Thanks again.
      Regards,
      Fred@@KPeyanski

  • @pan666sattan
    @pan666sattan 11 หลายเดือนก่อน

    great as always... please can you describe the slider?? I still cannot achieve it on my web_server platform... duno why. thanks

  • @maartenvanderveen6785
    @maartenvanderveen6785 ปีที่แล้ว +1

    I have created an automation that when the dog makes sound at night, it plays a prerecorded comforting message. However I am experiencing unreliable sensor readings. The readings don't come through into home assistant sometimes for hours, even if there is sound made near the microphone. Any idea how to improve this? Is there a way to have the measurements published through mqtt?

  • @om2don
    @om2don 11 หลายเดือนก่อน

    Great video, i will definitely try this.
    I was searching a sound sensor compatible with HA so i can remotely monitor an appartment that is for rent and detect if the guests are throwing a party or making alot of noise and disturbing the neigbours, but without invading privacy by directly recording sound or video.
    automation would be something like if there is a loud noise that is lasting longer that xy time, send me a notification. Then I can simply turn off the power in the entier appartment :D (of course, just kidding about the power)

    • @om2don
      @om2don 11 หลายเดือนก่อน

      oh and i was thinking to back it up with the aqara fp2 to confirm that there are 5 people or more, but i dont know if HA can detect the number of people with the sensor

  • @ElishaiPoran
    @ElishaiPoran ปีที่แล้ว

    Thanks for the helpful and excellent video!
    I saw that you pasted the long code after pasting a line of code about port 80. Where did you get the long code to paste it into the corresponding YAML file as well?

  • @bestiehouse659
    @bestiehouse659 3 หลายเดือนก่อน

    Hi, I built this following your instructions. Do you know if there is a way to connect it to Tuya or Google Home? I don't use HomeAssistant I don't want another app if I can avoid.

  • @simonsayshomeassistant
    @simonsayshomeassistant ปีที่แล้ว

    Great video Kiril! I have a problem my sensor seems to be very unresponsive. The numbers only move slightly with loud noises. Even if I adjust both calibration settings.

  • @TzaraDuchamp
    @TzaraDuchamp ปีที่แล้ว

    Do you also have examples of using this with infrasound? The Alexa dots use that for presence detection.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      No, first time hearing about this. Can you please share more info?

    • @TzaraDuchamp
      @TzaraDuchamp ปีที่แล้ว

      It’s called Ultrasound Motion Detection and part of the beta feature set.

  • @StrangerJona
    @StrangerJona 11 หลายเดือนก่อน

    Can this be made using a ZigBee ESP chip? I'm looking for a way to detect baby crys from my daughters bedroom, but trying to stay away from WiFi where possible.

  • @FrankGraffagnino
    @FrankGraffagnino ปีที่แล้ว +1

    i wish i could have it detect specific sounds... like the alarm from the refrigerator saying the door is open or the ding from the dishwasher saying it is done... stuff like that. and i would need it to ignore other sounds.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว +1

      I'm not sure how this can be done with only this sensor ...

  • @CompleteMisc
    @CompleteMisc ปีที่แล้ว

    Can you use this to actually listen to the sound through HA? So if it triggers, you can listen to what it is hearing?

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      no, sorry that is not possible

  • @slamshed
    @slamshed 11 หลายเดือนก่อน

    Great video. I'm putting this in my Chicken House to detect any loud noises at night, hopefully to prevent foxes getting my Chooks 🙂

    • @KPeyanski
      @KPeyanski  11 หลายเดือนก่อน

      such a great use case :) thanks for sharing it... btw is it allowed to shoot the fox if it is in your chicken house?

  • @livressancho7949
    @livressancho7949 6 หลายเดือนก่อน

    Hi I just try to do that with an esp32 Wroom 32 but I get some error
    "component 214 adc.sensor took a long time for an operation
    component 215 components souhould block for at most 20-30 ms"
    I want to use this smart sensor to know when my old hi-fi is playing and start an action in HA when yhe speaker stop to send music.
    But it tooks almost 30 s to interact with HA.... and the difference of Db is too low...
    Something wrong, but what ?

  • @kleinerluki
    @kleinerluki 10 หลายเดือนก่อน

    Hello, is it possible to adapt this to Google Home?

  • @antoniodecrisci2369
    @antoniodecrisci2369 ปีที่แล้ว +2

    #SoundSensorOwned just put one in my shed an it actually works pretty well!

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Wow, that was really fast! Congrats :) What is your action ? I mean what is happening when loud sound is detected?

  • @manueltenorio2443
    @manueltenorio2443 ปีที่แล้ว

    is there a way to detect mosquitoes? and turn a buzzer, this would be very helpful in tropical weathers where there is malaria or zyka.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      I doubt about that, but you never know...

    • @manueltenorio2443
      @manueltenorio2443 ปีที่แล้ว

      @@KPeyanski Why do you think it is not possible? maybe set it to measure Hz, if I is possible, probable do the job. Thanks for your answer

  • @SteveGilruth-qz4gy
    @SteveGilruth-qz4gy ปีที่แล้ว

    I used this to detect my smoke detector, I used the digital output and as my detectors are linked, if it sounds on any the one with the sound sensor near it will trigger

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Sounds good, but it seems that you don't use it anymore. Did you switch to something else?

  • @HFSoluciones
    @HFSoluciones ปีที่แล้ว

    When I set the template number platform, the node gets constantly disconnected from de API, If I remove it works fine

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Can you please give more details ?

  • @shawndamon3055
    @shawndamon3055 9 หลายเดือนก่อน

    Thank you for this Kiril, im having this weird issue :
    21:26:41 [D] [sensor:093]
    'RAW SoundEsp': Sending state 0.00000 % with 1 decimals of accuracy
    21:26:41 [D] [sensor:093]
    'Db SoundEsp': Sending state 25.53605 db with 2 decimals of accuracy
    21:26:41 [W] [component:204]
    Component adc.sensor took a long time for an operation (0.51 s).
    21:26:41 [W] [component:205]
    Any tips on what this might be?

    • @yulathh
      @yulathh 7 หลายเดือนก่อน

      I've got exactly the same problem, did you manage to solve it ?

    • @yulathh
      @yulathh 7 หลายเดือนก่อน

      I'm having exactly the same error message "Component adc.sensor took a long time for an operation" and my sensor does NOT work. I did the DIY on a second D1 Mini and KY-037, still the same. Did you or someone else managed to solve the issue ?

    • @shawndamon3055
      @shawndamon3055 7 หลายเดือนก่อน

      @@yulathh am afraid not ....tried a couple of other things but just refused to work ....let me know if you solve it too ..

  • @coin777
    @coin777 ปีที่แล้ว

    Is there an option to calibrate the sensor?

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว +1

      Yes, using the physical knob on the device or using the sensitivity slider from Web Interface or Home Assistant

  • @user-bs7uq4ej4u
    @user-bs7uq4ej4u หลายเดือนก่อน +1

    #SoundSensorOwned

    • @KPeyanski
      @KPeyanski  หลายเดือนก่อน

      Wow great! Another one in the club. Congratulations

  • @PedroEcheverria-vn7xn
    @PedroEcheverria-vn7xn ปีที่แล้ว

    Do you think it's a good way to make a non-party sensor? Like the sensors hotels used to use. When there is more than X db telegram send a message to my phone.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      wow great idea :) especially if you rent some space ...

  • @michaelfalkson317
    @michaelfalkson317 9 หลายเดือนก่อน

    Hi. I have installed and reinstalled many times, but I keep getting the following message, although the sensor is working '5:13:42 [W] [component:204]
    Component adc.sensor took a long time for an operation (0.51 s).
    15:13:42 [W] [component:205]
    Components should block for at most 20-30ms.
    Any ideas that I can try so as to remove the yellow error message from the sound sensor web portal?
    Thanks

    • @botialoach1
      @botialoach1 7 หลายเดือนก่อน

      I am getting the same error but do not Know why, the sensor appears to be working thought

  • @clairerovic
    @clairerovic ปีที่แล้ว +1

    It would be nice to use that with an ESP32 & Blue Tooth proxy and a basic lux, temp, humidity, PIR sensors & the Radar.
    Maybe add a little I2C display, that would handle a good chunk of room requirements in the one package.

  • @dellyyop
    @dellyyop ปีที่แล้ว

    I would like it to detect a specific frequency, like activation of a smoke alarm, but ignore normal speech or other sounds in the house.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Hmm interesting challenge. For that a custom ESPHome code should be written so the frequency of your alarm to be isolated.

    • @homekithome9841
      @homekithome9841 ปีที่แล้ว

      HomePod can do that with the new software update

    • @PatrickFelstead
      @PatrickFelstead ปีที่แล้ว +3

      When I get time, I might investigate implementing the FFT (Fast Fourier Transform) in ESPHome so that it can detect specific frequencies.

    • @SteveGilruth-qz4gy
      @SteveGilruth-qz4gy ปีที่แล้ว

      Have managed this using the digital output, and setting the limit to be very loud, and putting the sensor near 1 of my linked smoke detectors

  • @GaryEyles
    @GaryEyles ปีที่แล้ว +1

    I've used one for a while to see if the dogs start barking at home when we are out. Then we can check on the cameras to see what's going on.

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Yes, great use case thanks for sharing it :)

  • @Cra1gst
    @Cra1gst ปีที่แล้ว

    i have it installed now next to my roof tiles , so when pigeons land and try get under my solor panels i can trigger automation to make them fly away , they wake me up so i wana automate it

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      sounds really useful, but how are you going to fly them away? Using some siren or something?

    • @Cra1gst
      @Cra1gst ปีที่แล้ว

      @@KPeyanski well 1 air line with 12v valve to spray air , orr I have a 12v cement mixer vibratior to attach to a single rafters

  • @MarcoFan
    @MarcoFan ปีที่แล้ว

    Let's try it out... detect snoring time?😆

  • @16klu
    @16klu ปีที่แล้ว +1

    From experience, I find INMP441 mics way better...

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Is it more sensitive or have some other features? What exactly is better? Thanks for sharing in advance.

    • @16klu
      @16klu ปีที่แล้ว

      @@KPeyanski With INMP441 seems to be no lag. Reacts instantly to the sound. I use them for Sound Reactive WLED and it does better job. Probably more sensitive too, haven't tested that extensively.

  • @ryanmahoney5657
    @ryanmahoney5657 ปีที่แล้ว +1

    I just built one for when my dog is barking when I'm away

    • @KPeyanski
      @KPeyanski  ปีที่แล้ว

      Great, and when you receive a notification that your dog is barking what are you doing next? Are you opening the security cameras or something similar?

  • @EbrahimHasan
    @EbrahimHasan 10 หลายเดือนก่อน

    I was looking for a way to dynamically control volume on the TV instead of just setting a limit so the kid doesn't blast the volume all the way up. Why dynamically? Because otherwise the volume can get too low at time and the kiddo has every right to complain.