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

  Переглядів 12,778

Simon Says Home Assistant

Simon Says Home Assistant

Рік тому

This explains how I built a DIY CO2 sensor and integrated into Home Assistant. Here are the links to the components that I used:
MH-Z19: Sensor s.click.aliexpress.com/e/_DE4...
ESP 32: s.click.aliexpress.com/e/_DCr...
ESP Home beginners guide: • How to get started wit...
Some items in my smart home:
Zigbee smart bulb: s.click.aliexpress.com/e/_Dnq...
Shelly Uni: s.click.aliexpress.com/e/_DmQ...
Athom 4 gang switch: s.click.aliexpress.com/e/_Dkt...
ESP32 Dev board: s.click.aliexpress.com/e/_DeN...
Shelly 1: s.click.aliexpress.com/e/_Dkd...
Shelly Dimmer: s.click.aliexpress.com/e/_DCj...
CO2 Sensor: s.click.aliexpress.com/e/_Ddl...
Great contiuous super bright LED Strips with no dots : s.click.aliexpress.com/e/_DCF...
Weather station: s.click.aliexpress.com/e/_DEC...
Broadlink Pro for controlling IR devices like TVs: s.click.aliexpress.com/e/_DEE...
Athom local control ESPHome smart plugs:s.click.aliexpress.com/e/_DeK...
Zigbee smart blind controller: s.click.aliexpress.com/e/_DFl...
Raspberry Pi: s.click.aliexpress.com/e/_Dkl...
Kingston SSD RAM: s.click.aliexpress.com/e/_DFq...
Ice Tower Cooling Fan: s.click.aliexpress.com/e/_DmI...
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!

КОМЕНТАРІ: 38
@MrSomeDude
@MrSomeDude 8 місяців тому
thanks! what a calm and good tutorial!
@simonsayshomeassistant
@simonsayshomeassistant 8 місяців тому
Thanks Dawid!
@Qing-JolywoodSolar
@Qing-JolywoodSolar Рік тому
Thanks for sharing~~
@simonsayshomeassistant
@simonsayshomeassistant Рік тому
I am glad you enjoyed it!
@janask7
@janask7 Рік тому
Hi, thanks for the video! What about calibration? How do you do it? How often?
@simonsayshomeassistant
@simonsayshomeassistant Рік тому
Hi, it seems to stay fairly accurate and I have never calibrated it since installing!
@mathieusinclair7237
@mathieusinclair7237 3 місяці тому
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 3 місяці тому
HI there thank you for your know feedback. I think you may need a second ESP32 as both sensors are using I2c to communicate
@michaelmuller4529
@michaelmuller4529 11 місяців тому
Do you have a fancy box where you put the sensor and ESP together?
@simonsayshomeassistant
@simonsayshomeassistant 11 місяців тому
Hi Michael, not yet as I have not got a 3D printer yet! Would love to get into that soon!
@Novation681
@Novation681 2 місяці тому
Great!
@simonsayshomeassistant
@simonsayshomeassistant Місяць тому
Thank you!
@konstantingrudnev8374
@konstantingrudnev8374 7 місяців тому
2:19 T90
@simonsayshomeassistant
@simonsayshomeassistant 7 місяців тому
Awesome thanks for the input!
@konstantingrudnev8374
@konstantingrudnev8374 7 місяців тому
@@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.
@mehdijannadi9428
@mehdijannadi9428 Місяць тому
thank you for sharing ! can you give us the link of the code ?
@simonsayshomeassistant
@simonsayshomeassistant Місяць тому
Sure thing the code can be found here : esphome.io/components/sensor/mhz19.html
@valentinene
@valentinene Рік тому
How does the measurements of MH-Z19 compare with the portable one?
@simonsayshomeassistant
@simonsayshomeassistant Рік тому
Hi Vali, they compare quite closely actually. The portable one seems to react slightly faster though perhaps a minute faster!
@simonsayshomeassistant
@simonsayshomeassistant Рік тому
At most it seems to differ by about 100ppm at times
@valentinene
@valentinene Рік тому
@@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 Рік тому
@@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 Рік тому
What sensors do you use?
@markus8605
@markus8605 Місяць тому
MH-Z19 requires 5V, but ESP 32 outputs 3,3V - can this be (or become) an issue?
@simonsayshomeassistant
@simonsayshomeassistant Місяць тому
Hi Markus, the VIN pin on the ESP32 offers 5V. You can use this pin to ensure that the sensor gets enough power :)
@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 Рік тому
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 Рік тому
You probably should be hiding your nabucasa address unless you have a really good password on your homeassistant
@simonsayshomeassistant
@simonsayshomeassistant Рік тому
Thank you Garry, good point!!
SCD40 - новый "народный" датчик CO2
15:38
Клуб любителей электроники
Переглядів 15 тис.
Getting started with ESPHome
15:24
Let's Automate
Переглядів 34 тис.
Teenagers Show Kindness by Repairing Grandmother's Old Fence #shorts
00:37
Fabiosa Best Lifehacks
Переглядів 6 млн
Повістки у Києві: «Яке право вони мають забирати всіх мужиків?» #війна #мобілізація #військові
00:41
Слідство.Інфо | Розслідування, репортажі, викриття
Переглядів 1,6 млн
DIY Air Quality Monitor - PM2.5, CO2, VOC, Ozone, Temp & Hum Arduino Meter
16:15
How To Mechatronics
Переглядів 361 тис.
Setting Up The PERFECT Home Assistant Wall Dashboard
11:17
Jimmy Landry
Переглядів 91 тис.
DIY Smoke Sensor for Home Assistant with D1 Mini, MQ-2 & ESPHome
18:01
Making an E-paper Dashboard with ESPHome
22:59
Tech Dregs
Переглядів 116 тис.
Build A Smart Home Control Panel EASILY!
11:20
Everything Smart Home
Переглядів 417 тис.
15 Brilliant ESP32 Projects that are Worth-trying!!!
11:12
ToP Projects Compilation
Переглядів 162 тис.
Picoclick-C3 is the most advanced ESP32 based IOT button | makermoekoe
14:20
Эволюция телефонов!
0:30
ТРЕНДИ ШОРТС
Переглядів 2,5 млн
Vortex Cannon vs Drone
20:44
Mark Rober
Переглядів 13 млн
Как часто вы чистите свой телефон
0:33
KINO KAIF
Переглядів 2,1 млн