Giter Site home page Giter Site logo

lee1135 / mhz14-co2-logger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alpacagh/mhz14-co2-logger

0.0 0.0 0.0 339 KB

Simple example python/js solution to monitor CO2 concentration using MH-Z14 sensor connected with UART.

Python 61.25% JavaScript 21.73% HTML 17.02%

mhz14-co2-logger's Introduction

Example MH-Z14 CO2 sensor reader and visualizer

  • Read data from UART(serial)-connected MH-Z14 sensor using python,
  • visualize received data using html and plotly.js library.

Screenshot of example data

example

(peak at 6:50 AM is when my cat walked over my desktop and probably sniffed the sensor)

Usage

Connection

Sensor can be queried using 3.3v UART at 9600 bps. Sensor main feed voltage is 5v.

Can be connected to computer using almost any USB-UART converter if voltage matches.

Querying

$ python CO2Reader.py /dev/ttyUSB0 10
Connected to /dev/ttyUSB0
2016-03-25 22:04:16     1134    69
...

4 fields separated by tab: timestamp, CO2 concentration (ppm), internal sensor temperature (celsius?), checksum validation result

python script and library is expecting python 3.7+ and has dependency on pyserial 3.4 (may be installed via pip)

Use stream redirection to save data series to file.

$ python CO2Reader.py /dev/ttyUSB0 >example.log

Visualizing

  • install npm dependencies npm install
  • start server python -m SimpleHTTPServer 8088
  • open browser at http://localhost:8088/plot.html
  • select your log file in input field

Licence

MIT licence

mhz14-co2-logger's People

Contributors

alpacagh 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.