Git Product home page Git Product logo

esp32-air-sensor's Introduction

esp32-air-sensor

ESP32 device using MQ-6 (LPG gas), MQ-7 (CO) and MH-Z19 (CO2) sensors to collect air quality data, and feed to ThingSpeak, and display on 3x10 segment LED bar.

The device right now is wired on a breadboard, but I am planning to assemble a PCB and put it into a plastic case. It can be hidden anywhere in the room, connected to a standard 5V micro-USB as power supply.

Project on Hackster.io: https://www.hackster.io/akossereg/room-s-carbon-dioxide-level-on-smartphone-4586b1

ESP32 with CO2 sensor

Mobile Screenshot

Configuration

Find configs in include/config.h, such as:

  • WIFI username/password - device will connect to your local wifi network to be able to send data to ThingSpeak
  • ThingSpeak write API key

Hardware Configuration

  • Connect analog output of MQ-6 sensor to GPIO 36 (see mq_sensors.c channel usage)
  • Connect analog output of MQ-7 sensor to GPIO 39
  • Connect MH-Z19 device's TX to GPIO 34, and RX to GPIO 26
  • Connect LED bar display component:
    • VCC should be 3.3V
    • DATA to GPIO 25
    • CLK to GPIO 33
    • LATCH to GPIO 27

LED bar display

Components:

One shift register can drive 8 LEDs, so we need 4 (4x8 = 32) to cover 3x10 LEDs. Shift registers should be daisy chained:

        SN74HC595
        _________
  B ---|(1)      |--- VCC (3.3V)
  C ---|  Shift  |--- Output A
  D ---|   Reg.  |--- DATA
  E ---|         |--- GND
  F ---|         |--- LATCH
  G ---|         |--- CLK
  H ---|         |--- VCC
 GND---|_________|--- Output H' (this goes to the next shift register's DATA)

LED bar display should be connected like this:

     LED bar      Resistors

  +--[ Red    ]--[ 510 Ohm ]--- Output B
  |--[ Red    ]--[ 520 Ohm ]--- Output A (of Shift reg. 2)
  |--[ Yellow ]--[ 520 Ohm ]--- Output H
  |--[ Yellow ]--[ 520 Ohm ]--- Output G
  |--[ Yellow ]--[ 520 Ohm ]--- Output F
  |--[ Green  ]--[ 1k Ohm  ]--- Output E
  |--[ Green  ]--[ 1k Ohm  ]--- Output D
  |--[ Green  ]--[ 1k Ohm  ]--- Output C
  |--[ Green  ]--[ 1k Ohm  ]--- Output B
  |--[ Blue   ]--[ 1k Ohm  ]--- Output A (of Shift reg. 1)
  |
  |
 GND

esp32-air-sensor's People

Contributors

akos-sereg avatar

Watchers

 avatar  avatar

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.