Code Monkey home page Code Monkey logo

esphome-sgp40-dht22's Introduction

esphome-sgp40-dht22

Using ESPHOME with Home Assistant and a Sensirion SGP40 VOC Sensor with a ESP8266 (NodeMCU in this example) A fast reactive VOC sensor that does not require a week to warm up and has good stability. Highly recommended.

Link: https://learn.adafruit.com/adafruit-sgp40
ESPHome: https://esphome.io/components/sensor/sgp40.html

A big thank you to the amazing team working on Home Assistant and ESPHome. This has to be the best smart home solution in the world and exceeds all of the commercial systems out there.

The YAML example code is simply a working version (edit your passwords in) of the code required to get your project started.

This combo project required a bit of extra thinking...
I was not sure if the humidity and temperature inputs needed to be compatible with the SGP40.
The datasheet showed that you need a SHT40 (https://www.adafruit.com/product/4885) but it turns out you can use just about any humidity and temperature sensor you can get working.
So in this example I used a DHT22 (also known as AMS2303 or RHT03) but you could use quite a few different options as the code reads the sensor and transfers the variable into the SGP40 code.
If you look at the code, you will see how the multi sensor code works.

ESP8266 (NodeMCU) PINOUT
ESP PIN D1 to SGP40 SCL
ESP PIN D2 to SGP40 SCA
ESP PIN 3.3V to SGP40 VIN
ESP PIN GND to SGP40 GND

ESP PIN 3.3V to DHT22 PIN1 (VCC)
ESP PIN GND to DHT22 PIN4 (GND)
ESP PIN D5 to DHT22 PIN2 (DATA)

TIP1: The DHT22/RHT03/AMS2303 has a built in resistor from VCC to DATA as a pull up resistor which works just fine but some people recommend either a 10k or 4.7k resistor in addition but I have not used any and it works just fine.

TIP2: In the code there is a section under sensor called 'model' and I had to set this to RHT03 for my sensor to work. My sensor had RHT03 written on it not DHT22.
Without the correct setting here, I was getting -10'C and 22% humidity which was completely incorrect.
(Options are: AUTO_DETECT, DHT11, DHT22, DHT22_TYPE2, AM2302, RHT03, SI7021 but AUTO_DETECT didn't work for me)
Ref: https://esphome.io/components/sensor/dht.html

esphome-sgp40-dht22's People

Contributors

macflyhub avatar

Watchers

 avatar

Forkers

e-dreyer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.