GithubHelp home page GithubHelp logo

shtpi's Introduction

SHTpi

Grab sensor values and stream them to your Initial State dashboard for logging and displaying.

Written in the Go programming language, this program is meant to retrieve values from a SHT31 Temperature & Humidity sensor. The sensor is soldered onto a small factor proto-HAT that is mounted on top of a Raspberry Pi Zero-W. Any Pi version can be used, as well as any size proto board, or even none if you prefer.

After coming accross the excellent work of @d2r2, I took full advantage of incorporating his Go libraries to be able to communicate with the sht31 via I2C on the Pi! Unlike some of the sparse code on Github related to what I wanted to do, I figured it would make more sense to write my own small program to regularly retrieve values by utilizing goroutines, and then sending that data via HTTPS and JSON objects to my Initial State dashboard.

The only adjustments necessary is to provide your own ACCESS_KEY and BUCKET_KET in the code, and then compile right there on your Pi. Make sure before doing that, you have at least go 1.14 and run the 'go get' command for the following modules:

"github.com/d2r2/go-i2c"
"github.com/d2r2/go-sht3x"

After that, compile and run and you should be able to see the new feeds show up to add to your dashboard!

***Note: After compiling, it's best to run the program as follows to prevent debug info from populating the terminal. There is an additional library that can be used do deal with this (see d2r2's github), but this was the easiest and quickist solution for me:

./main > /dev/null &

This will run the program in the background with no debug info displayed to the screen, allowing you to continue using the terminal***

Also note that it may very well be necessary to slightly adjust values related to calculating proper degrees and relative humidity. Most of the sensors can be extremely accurate, but also typically require a period of 'getting burned in' after continuous use to start having more constant readings. A simple value adjustment is usually all it takes to offset any margin of error!

shtpi's People

Contributors

dedsyn4ps3 avatar

Watchers

 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.