GithubHelp home page GithubHelp logo

skaringa / hmc5883-gas-counter Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 7.0 23 KB

Program to monitor the consumption of gas used for heating in a household.

Home Page: http://www.kompf.de/tech/gascountmag.html

License: GNU General Public License v3.0

Python 39.59% Perl 39.45% HTML 20.96%

hmc5883-gas-counter's Introduction

hmc5883-gas-counter

Program to monitor the consumption of gas used for heating in a household .

Prerequisites

  • Gas counter with a rotating magnet
  • Digital 3 axis magnetometer HMC5883L
  • Raspberry Pi Model A or B
  • Python 2.7

hmc5883_gas_counter.py

Gas counter with magnetometer HMC5883 breakout

This program uses the 3 axis magnetometer HMC5883 to read the magnetic induction which is produced by a gas counter. The gas counter contains a small magnet that is attached to a rotating counter ring. Each rotation of the counter ring means a consumption of 0.01 m³ gas. The magnetic induction produced by the rotating magnet is read with the magnetometer that is connected to the I²C bus of a Raspberry Pi.

The program monitors that magnetic induction and every time it detects a rotation of the magnet it writes the actual counter and consumption values into a round robin database.

Help:

./hmc5883_gas_counter.py -h

Create rrd databases:

./hmc5883_gas_counter.py -c

Store values of magnetic induction into mag.rrd:

./hmc5883_gas_counter.py -m

Normal operation:

./hmc5883_gas_counter.py

www

The sub-directory www contains an example to produce a single web page to visualize daily, weekly, monthly, and yearly charts of consumption.

Consumption of gas recorded over 24 hours

License

Copyright 2014 Martin Kompf

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

hmc5883-gas-counter's People

Contributors

skaringa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hmc5883-gas-counter's Issues

return bus.read_i2c_block_data(address, 0x00) IOError: [Errno 121] Remote I/O error

Hi I know this isn't the HMC5883 but your repo was ported to QMC5883 so i figured you might understand this error as well.

File "./qmc5883_gas_counter.py", line 186, in <module> main() File "./qmc5883_gas_counter.py", line 150, in main data = read_data() File "./qmc5883_gas_counter.py", line 50, in read_data return bus.read_i2c_block_data(address, 0x00) IOError: [Errno 121] Remote I/O error

i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- 0d -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --      

so can this be solved to the newer chip since the old HMC will not produced anymore :-/

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.