Coder Social home page Coder Social logo

elixir-sensors / sgp40 Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 50 KB

Use Sensirion SGP40 air quality sensor in Elixir

Home Page: https://hex.pm/packages/sgp40

License: MIT License

Elixir 35.84% C 62.22% Makefile 1.94%
elixir nerves-project sgp sgp4 iaq

sgp40's Introduction

SGP40

Hex version API docs CI Hex

Use Sensirion SGP40 air quality sensor in Elixir.

The raw signal from the SGP40 sensor is processed using Sensirion's software algorithm to give the VOC Index that represents an air quality value on a scale from 0 to 500 where a lower value represents cleaner air.

Usage

iex> {:ok, sgp} = SGP40.start_link(bus_name: "i2c-1")
{:ok, #PID<0.1407.0>}

iex> SGP40.measure(sgp)
{:ok, %SGP40.Measurement{voc_index: 123, timestamp_ms: 885906}}

For better accuracy, you can provide the SGP40 sensor with relative ambient humidity and ambient temperature from an external humidity sensor periodically.

iex> SGP40.update_rht(sgp, humidity_rh, temperature_c)
:ok

Depending on your hardware configuration, you may need to modify the call to SGP40.start_link/1. See t:SGP40.options/0 for parameters.

sgp40's People

Contributors

mnishiguchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jbruggem

sgp40's Issues

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.