Giter Site home page Giter Site logo

co2monitor's Introduction

Go Report Card GoDoc

CO₂ monitor

Setup & Example

Setup

Dashboard

Motivation

Some time ago an article about a low cost CO₂ monitor came to our attention. A colleague quickly adopted the python code to fit in our prometheus setup. Since humans are sensitive to temperature and CO₂ level, we were now able to optimize HVAC settings in our office (Well, we mainly complained to our facility management).

For numerous reasons I wanted to replace the python code with a static Go binary.

Hardware

  • CO₂ meter: Can be found for around 70EUR/USD at amazon.com & amazon.de. Regardless of minor differences between both devices, both work.
  • Some machine which can run the compiled Go binary, has USB and is reachable from your prometheus collector. A very first version of a raspberry pi is already sufficient.

Software

You need prometheus to collect the metrics.

It might make things easier when you set up an udev rule e.g.

$ cat /etc/udev/rules.d/99-hidraw-permissions.rules 
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"

Run & Collect

Help

$ ./co2monitor --help      
usage: co2monitor [<flags>] <device> [<listen-address>]

Flags:
  --help  Show context-sensitive help (also try --help-long and --help-man).

Args:
  <device>            CO2 Meter device, such as /dev/hidraw2
  [<listen-address>]  The address to listen on for HTTP requests.

Starting the meter export

$ ./co2monitor /dev/hidraw2
2018/01/18 13:09:31 Serving metrics at ':8080/metrics'
2018/01/18 13:09:31 Device '/dev/hidraw2' opened

Credit

Henryk Plötz & wooga

co2monitor's People

Contributors

larsp avatar neverpanic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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