DIY MH-Z19 CO2 Sensor build and integration in Home Assistant using ESP Home

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 พ.ย. 2024

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

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

    Straight to the point! No blows and whistles, I cannot believe it. Thank You

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

    thanks! what a calm and good tutorial!

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

    Hi, thanks for the video!
    What about calibration? How do you do it? How often?

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

      Hi, it seems to stay fairly accurate and I have never calibrated it since installing!

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

    2:19 T90

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

      Awesome thanks for the input!

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

      @@simonsayshomeassistant Sensor Time Constant (τ)
      Responsiveness of any sensor is usually given as a Time Constant and represented by the Greek letter τ “tau”. It is defined as the time required for the sensor reading/output to reach to 63.2% of its total step change in measurand.
      EXAMPLE: For a temperature sensor taken out of an ice bath at 0 °C into a room at 10 °C, it will take exactly one time constant (usually given in seconds) to reach 6.32 °C, which is exactly 63.2% of the 10 °C step change in temperature.
      Sensor Response Time = 5*τ (5x Time Constant)
      The Time Constant of a sensor is very different than its Response Time. In fact, the response time is exactly five times the time constant. Response Time is the time for the sensor reading to reach 99.3% of the total step change in measurand, or in this case the new temperature.
      EXAMPLE: For a temperature sensor taken out of an ice bath at 0 °C into a room at 10 °C, it will take exactly five time constants (five times longer) to reach 9.93 °C, which is exactly 99.3% of the 10 °C step change in temperature.

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

    Hi, thanks for the good tutorial.
    Have one question, would it be possible to add a MP503 (VOC sensor) to the same ESP and also use it in HA ? Or do I need to use another ESP for myyMP503 ?
    Thanks !
    👍

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

      HI there thank you for your know feedback.
      I think you may need a second ESP32 as both sensors are using I2c to communicate

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

    thank you for sharing ! can you give us the link of the code ?

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

      Sure thing the code can be found here : esphome.io/components/sensor/mhz19.html

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

    Do you have a fancy box where you put the sensor and ESP together?

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

      Hi Michael, not yet as I have not got a 3D printer yet! Would love to get into that soon!

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

    Great!

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

    MH-Z19 requires 5V, but ESP 32 outputs 3,3V - can this be (or become) an issue?

    • @simonsayshomeassistant
      @simonsayshomeassistant  7 หลายเดือนก่อน +2

      Hi Markus, the VIN pin on the ESP32 offers 5V. You can use this pin to ensure that the sensor gets enough power :)

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

    How does the measurements of MH-Z19 compare with the portable one?

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

      Hi Vali, they compare quite closely actually. The portable one seems to react slightly faster though perhaps a minute faster!

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

      At most it seems to differ by about 100ppm at times

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

      @@simonsayshomeassistant that sounds super cool, a minute delay doesn't make any difference when the CO2 concentration changes slowly over the time. I've been using an air quality sensor(s) for more than 2 years now who is using an Winsen MH-Z19B CO2 sensor and was wondering how accurate it can be as I don't have any other CO2 sensors to compare the results. Thanks for your time creating nice video (I'm pretty sure the sound quality is going to get better in time :P )

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

      @@valentinene Thank you for your comments Vali. Yes my laptop got drowned by a glass of water so I am using an older one right now, till a replacement arrives so I will re-shoot the video for better sound! Sensors fascinate me.

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

      What sensors do you use?

  • @Qing-JolywoodSolar
    @Qing-JolywoodSolar ปีที่แล้ว

    Thanks for sharing~~

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

    hi.. i have this problem... any idea what i do wrong?
    [21:39:16][W][uart.arduino_esp32:163]: You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.
    [21:39:16][C][mhz19:094]: MH-Z19:
    [21:39:16][C][mhz19:095]: CO2 'MH-Z19 CO2 Value'
    [21:39:16][C][mhz19:095]: Device Class: 'carbon_dioxide'
    [21:39:16][C][mhz19:095]: State Class: 'measurement'
    [21:39:16][C][mhz19:095]: Unit of Measurement: 'ppm'
    [21:39:16][C][mhz19:095]: Accuracy Decimals: 0
    [21:39:16][C][mhz19:095]: Icon: 'mdi:molecule-co2'
    [21:39:16][C][mhz19:096]: Temperature 'MH-Z19 Temperature'
    [21:39:16][C][mhz19:096]: Device Class: 'temperature'
    [21:39:16][C][mhz19:096]: State Class: 'measurement'
    [21:39:16][C][mhz19:096]: Unit of Measurement: '°C'
    [21:39:16][C][mhz19:096]: Accuracy Decimals: 0
    [21:39:16][C][mhz19:102]: Automatic baseline calibration disabled on boot
    [21:39:16][C][captive_portal:088]: Captive Portal:
    [21:39:16][C][mdns:103]: mDNS:
    [21:39:16][C][mdns:104]: Hostname: co2-living
    [21:39:17][C][ota:093]: Over-The-Air Updates:
    [21:39:17][C][ota:094]: Address: co2-living.local:3232
    [21:39:17][C][ota:097]: Using Password.
    [21:39:17][C][api:138]: API Server:
    [21:39:17][C][api:139]: Address: co2-living.local:6053
    [21:39:17][C][api:141]: Using noise encryption: YES
    [21:39:46][E][uart:015]: Reading from UART timed out at byte 0!
    [21:39:46][W][mhz19:034]: Reading data from MHZ19 failed!

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

      Show us your esphome yaml code

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

      Hi I have the same problem. Did you fix it?

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

      @@tillellermann1183 Yes
      As the communication with the MH-Z19 is done using UART, you need to have an UART bus in your configuration with the rx_pin connected to the TX pin of the MH-Z19 and the tx_pin connected to the RX Pin of the MH-Z19 (it’s switched because the TX/RX labels are from the perspective of the MH-Z19)

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

      @@Paullik83 Thank you for the fast reply. I connected TxRx and configured UART. I disabled UART logging with "baud_rate: 0". Now I think I get UART messages but it always fail with byte 5 😑"Reading from UART timed out at byte 5!" "Reading data from MHZ19 failed!" I tested this config with NodeMCU8266 and D1 Mini V3. Which board are you using?

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

      @@tillellermann1183 I have the same problem

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

    You probably should be hiding your nabucasa address unless you have a really good password on your homeassistant