DIY Smoke Sensor for Home Assistant with D1 Mini, MQ-2 & ESPHome

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 พ.ค. 2024
  • It is time for another DIY project and today I will show you how to create Smart Smoke Sensor for Home Assistant with D1 Mini, MQ-2 smoke & gas sensor & ESPHome. Do it yourself or DIY #Smoke #Sensor for #HomeAssistant is quite easy and I will guide you through all of the steps.
    ► MY ARTICLE ABOUT THAT TOPIC - peyanski.com/diy-smoke-sensor...
    ► AFFILIATE LINKS
    D1 Mini (AliExpress) - s.click.aliexpress.com/e/_AFgAIp
    D1 Mini (Amazon) - amzn.to/3A5jNoc
    MQ-2 Gas & Smoke sensor (AliExpress) - s.click.aliexpress.com/e/_Dnm...
    MQ-2 Gas & Smoke sensor (Amazon) - amzn.to/3rMzxJg
    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/_AnrsGw
    Micro USB cable (Amazon) - amzn.to/32tdxdF
    (Optional) USB adapter EU US UK (AliExpress) - s.click.aliexpress.com/e/_Ataxcq
    (Optional) USB adapter (Amazon) - amzn.to/3u2Tdvj amzn.to/3qXkJYS
    SwitchBot Flash Deals - switchbot.vip/3BwF221
    Shelly Official Store - bit.ly/3BwMMn2
    Aqara Amazon Store - amzn.to/3EpeCSb
    Reolink Flash Deals - shrsl.com/301ih
    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
    ► CRYPTO AFFILIATE LINKS
    Sign up for Crypto.com and we both get $25 USD (Referral code: xn86atnceg) - crypto.com/app/xn86atnceg
    Binance - One of the biggest Crypto currency exchange - www.binance.com/en/register?r...
    ► MY GUIDE
    Smart Home Getting Started Smart Home Guide v2.0 - peyanski.com/product/smart-ho...
    ► SUPPORT MY WORK
    Patreon - / kpeyanski
    Paypal - www.paypal.me/kpeyanski
    Bitcoin - 1GnUtPEXaeCUVWdJxCfDaKkvcwf247akva
    Revolut - revolut.me/kiriltk3x
    ► ESPHome configuration for the D1 Mini and MQ-2 Sensor
    DIY MQ- 2 Smoke & Gas Sensor for Home Assistant
    sensor:
    - platform: adc
    pin: A0
    name: "WeMos D1 Mini Smoke Sensor"
    update_interval: 1s
    filters:
    - multiply: 100
    unit_of_measurement: "%"
    icon: "mdi:percent"
    ► 3D Printed Enclosure for the DIY Smoke Sensor for Home Assistant
    www.thingiverse.com/thing:471...
    ► TIME TABLE
    00:00 Demo
    00:36 Intro
    01:12 What is needed for this project?
    01:48 MQ-2 Gas & Smoke Sensor
    03:16 How to connect D1 Mini and MQ-2 Sensor?
    05:27 How to install ESPHome add-on in Home Assistant?
    06:39 How to configure the MQ-2 Smoke Sensor and to install ESPHome on the D1 mini?
    09:48 How to add the Smoke Sensor in Home Assistant?
    13:29 Testing the DIY Smoke sensor for Home assistant with butane
    14:29 Testing the DIY Smoke sensor for Home assistant with smoke
    16:59 Summary
    ✅ Don't Forget to like 👍 comment ✍ and subscribe to my channel!
    ► DISCLAIMER
    Some of the links above are affiliate links, where I earn a small commission if you click on the link and purchase an item. You are not obligated to do so, but it does help fund these videos in hopes of bringing value to you!
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    Thank you. I tried your smoke sensor and it works perfectly.

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

      Great to hear! Check my other sensor videos as well

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

    Great job, well done. Thanks for the idea

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

      No problem 👍

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

    Good job my man. I haven't set one up yet but I am planning to. Thanks.

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

      Thanks, that means I've released this video just in time for you ;)

    • @ronm6585
      @ronm6585 2 ปีที่แล้ว

      @@KPeyanski Lol. Yes indeed. Thanks.

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

    OMG, very very glad to see you posting... Hope you are welll....

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

      Yes, I'm fine thank you :) and many thanks for the comment. Take care!

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

    Thanks for the excellent explanation. I would like to put a buzzer that is activated when the lower limit is exceeded, could you tell me how to do it? Thank you

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

    Very good! I did and it works fine!

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

      Well done! Enjoy!

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

    Thank you. Been meaning to add a smoke alarm in the loft where I keep the Home Assistant Pi. This will do the job perfectly.

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

      Enjoy!

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

      @@KPeyanski finished it. Only snag was when I tried to do the firmware install onto the esp8266 whilst connected to the home assistant pi. ESPhome couldn't see the Pi port that the d1 was plugged into. After a bit more research I did a manual install using the windows firmware installer. It then connected over WiFi straight away and automations easily setup. Thanks

    • @okanerdem
      @okanerdem 2 ปีที่แล้ว

      @@TimHodgesofEdinburgh How did you do this?

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

    Thank you for your instructions. I'm wondering if this application applies to ESP32 boards b/c there is a difference for the ADC pin voltage tolerance. The MQ sensors are driven by 5V so under high PPM the sensor output can go well beyond 3.3V, the absolute maximum for ESP32 GPIOs. This posts a threat to fry ESP32 boards if my understanding is correct. The solution is discarding the MQ sensor board and wiring from the 6pin module, dividing the onboard RL (1k Ohm, code 102) into two resistors e.g. 330 Ohm and 470 Ohm (to GND), then applying ADC around the 470 Ohm resistor we get a perfectly safe 0V-2.94V input range to ESP32 GPIOs. Kindly share your thoughts.

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

    Great video. How do I add a buzzer to it so that the buzzer sounds when smoke or gas is detected

  • @NewAgeTechnologies
    @NewAgeTechnologies 2 ปีที่แล้ว

    Thanks for your useful video. Could you pls let me know how to install d1mini by manual download?

  • @d-popov
    @d-popov ปีที่แล้ว

    Супер! Поздравления за хубавия материал.

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

      Благодаря за хубавите думи! Радвам се, че ти харесва!

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

    Thank you for this how-to! Definitely will be a future project for me. I was wondering if you could do a video for a bed occupancy sensor using a force sensitive resistor? tom_i did a good write up on the home assistant community forums but I have not found a good home assistant /esphome video for this project. Just a suggestion for a possible future video. Take care and keep up the good work. Love the videos.

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

      Many thanks for the good and positive comment and many thanks for the idea 💡 I will check it out. Good luck with your future project!

  • @okanerdem
    @okanerdem 2 ปีที่แล้ว

    If we are using HA on the VM, how can we connect to configure ? Is it possible to connect by wifi for first config or we need to use a raspberry pi for this?

  • @jordimartin2001
    @jordimartin2001 2 ปีที่แล้ว

    I am following your online articule but using an esp32. I connected the A0 to pin GPIO36. In home assistant, I am getting a static reading of 102.60. Any ideas?

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

    Good idea. The issue is the Power supply, and that sou have to put it on the ceiling.

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

      Yes, that could be an issue if your place is already finished and pretty. Some cables going to the ceiling will not be a pretty sight.

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

    Complimenti per il video, come sempre perfetto. Come ti hanno già chiesto altri, sarebbe perfetto aggiungere un cicalino ed un led rosso che si accendono superando un determinato valore; considerato, però, che non hai risptto suppongo non si possa fare, vero? Ciao e complimenti

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

    Nice and useful video. Could do it successfully . One query. Is it possible to calculate the ppm? Thanks for the great video.

  • @AndyBerman
    @AndyBerman 2 ปีที่แล้ว

    Great video! I’m already using AO on my D1 Mini. What would need to change to use the digital out of MQ2 instead of the analog out? Thanks.

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

      I’m not sure about that. This should be researched. Maybe someone else can answer you right away.

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

      MQ-2 sensor has a digital out pin, you can adjust the sens via the onboard resistor

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

    Great video Kiril! Very clear instructions. I was able to set up 5 smoke sensors successfully, however how can we disable the red LED light?

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

      Glad you like the video and no idea abut the LED. Enjoy your sensors!

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

      Remove it with a set of pliers from the board.

  • @easthulk99
    @easthulk99 2 ปีที่แล้ว

    Tq for the video

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

      Welcome 😊

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

    thanh you for how to!, the only problem is that I get a sensor reading of 100% and and not change why..?

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

    You video are always very informative keep them coming, I have a question have set up everything, the only problem is that I get a sensor reading of 4.199% and and not 52% why?

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

      That should be OK. Test yours with some smoke and if it reacts then you are good to go. Maybe you are living in the Alps and your Air is very clear :) Mine sensor started from the 40-50% and after a day they are going to 10-15%

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

    Hi, I have a question .. on my Esp32 Wroom - I do not have marked A0 Pin -. where should I connect ? thanks for help great video
    btw

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

      Is there an analog pin?

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

      @@KPeyanski I suppose so .. seems from 32-39 are both a and d

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

    Hi Bro, my mq2 is always showing 100% changed sensors still the same

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

    Yes😊

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

      Great! Thanks for sharing 🙏

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

    I'm all for smart home tech have it everywhere but do not base your safety off prototype devices
    This is great as an addition too main smoke alarms

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

    Спасибо брат за помощь

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

    I got a 6 pack of these from Amazon. I need to figure out where to use all of them. I noticed that my percent level went from 55% when I first hooked it up to a fairly stable 25% after a day. I think I will use them where natural gas is used, such as the furnace in my attic and the water heater in the garage.

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

      That sound like a plan to me. Enjoy!

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

      Almost sure that in daylight time the reading will be higher than at night just bz of human activity

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

    I jave problem this api not connected with wemos he said api failed connect

  • @samiraslan9735
    @samiraslan9735 2 หลายเดือนก่อน +1

    A bit late maybe but
    #SmokeSensorOwned

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

      No you are just in time. Nobody is late here for this great DIY Smoke Sensor. Enjoy it and don't forget to check my other DIY Smart Sensor videos as well

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

    Maybe for my garage or outhouses.

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

      Yes, great idea 👍 Wish you success and don't forget to share the results here afterwards :)

  • @cristian.s94
    @cristian.s94 ปีที่แล้ว

    Is there any zigbee alternative to the D1 Mini? Thanks.

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

      not sure about that

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

    #SmokeSensorOwned

  • @boopeshkumarprabhakaran
    @boopeshkumarprabhakaran 2 ปีที่แล้ว

    Can i use mq6 lpg sensor to check gas leaks? And integrate that with esphome? Does it work the same way yu used mq2 sensor?

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

      probably yes, but I guess you have to try!

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

    Waiting for such videos since couple months. Many Thanks for sharing. Just need to confirm can we use above code for sensor MQ135 or not.

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

      I think it will work, but I guess you have to try. Don’t forget to share the results afterwards.

    • @jitendrasonavane82
      @jitendrasonavane82 2 ปีที่แล้ว

      Yes Sir, it is working perfectly for sensor MQ135. Again thanks for acknowledging my question.

  • @romanklein6081
    @romanklein6081 2 ปีที่แล้ว

    I will make it for kitchen. Hope it will not make false alarms if we are cooking on pan ;)

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

      Great, you have options to set the sensitivity of the sensor as well as to fine tune the automation, so I think you will not have problems

  • @The_Birdman
    @The_Birdman 2 ปีที่แล้ว

    Does anyone know how many devices can be powered from the 5v PIN of a D1 Mini? Im sure the answer isn't straight forward. For example, it would be nice to power a PIR, Temp/Humidify and also the Smoke sensor all from the same D1 Mini.

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

      The power doesn't have to go through the D1 Mini. You can hook up a power supply to a power rail and hook up as much as the power supply can handle. I did this with an ESP32 that didn't pass through the 5V.

  • @MustangBoss1973
    @MustangBoss1973 2 ปีที่แล้ว

    Yes, As i'm not messing with a of the shelf smoke alarm as an insurance company (worm) would use it as an excuse to not payout.
    But by using this its totally separate and the insurance company can continue about the day with head up ****

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

      Yes, insurance companies usually doesn't like to pay when that is possible they just want to sell :)

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

    The 1st Smoke detector got detected & installed with no issue, but when I try to add another smoke detector, it couldn't be detected by the USB port. Any idea why? Any change in the procedure for the second board?

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

      You have to change the name of the second device in the yaml code. That is all

  • @titas_saha
    @titas_saha 21 วันที่ผ่านมา

    Can it detect cigarette smoke also?

    • @KPeyanski
      @KPeyanski  20 วันที่ผ่านมา

      not quite sure here, but I think it should detect it

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

    This video AND the temp/humidity could be one right ? Have you tried to make one sensor with temp/humidity/smoke ?

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

      Yes, it is possible but I didn’t try this yet

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

    would be better with a mini speaker to make alarm sounds

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

      yes, it is an option

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

    What is the difference between this ESPHome and Tasmota??

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

      different software, look, interface, developers, etc, but same target devices

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

    I think your project has a huge problem. Mq2 sensor outputs 5v in the analog port when the smoke reaches his maximum value. This means that at that point your d1 mini will fry because the maximum allowed value for a original d1 mini is 3.2v (it has a voltage divider for the esp8266 port, which only supports max 1v)
    At some point of time, if you have a fire your d1 mini could die at some point.

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

      Basically, you are right; analog output from MQ-2 is 0 ~ 4.2V. However it reaches above 3V only at extreme concentrations, so there are more chances that the fire will fry the setup than first ;)

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

      @@iliahborg7079 If considering other MQ sensors this concern is very valid. Some MQ sensors go beyond 3.3V very easily on the AO pins.

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

    #SmokeSensorOwned

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

      Great work John! Enjoy and don't forget to check my other DIY smart sensor videos. I have a whole playlist about them.

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

      @@KPeyanski I will, I already subbed and have watched some other vids. Keep up the good work. Much appreciated.

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

    #SmokeSensorOwned

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

      Oh, yes 👏 that’s what I wanted to see. Congratulations mate!

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

    #SmokeSensorOwned

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

      Very glad to see that Jaroslav! Enjoy!

    • @jaroslavcihlar9468
      @jaroslavcihlar9468 2 ปีที่แล้ว

      @@KPeyanski would it be possible to add small piezo?