Marcel did not had a lot of time the last couple of months which put a little hold on device development. Two weeks ago we finally sat together again and where thinking about quick and dirty devices to develop. We got a couple of ideas like specific simple devices like light intensity measurements, temperature readings, and last but not least, utility usage measuring. He decided to firstly go for the utility measurement, and thinking this was a very good idea, i followed this idea.
We both have analog meters which measure electricity, gas and water usage. This means we have rotation disks which are reflective at the moment a specific amount of usage has passed (bu our electric disks are just the opposite of this). So we will be using Optical detector/Phototransistor‘s for capturing the “pulses”. We decided to use I²C for reading an Arduino which has the sensors connected. But because of the I²C interface on the Raspberry Pi is master only we can only read the amount of “pulses” when the pi initiates this. So the software on the Arduino will be counting pulses, and when read from the pi, reset it’s internal counters for depending on the sensor data which is requested. So this is what we are going to do. P.S. There is a big change it will be go to an attiny, depending on our personal needs.
Next to the hardware is of course the software needed to read these data in the server. Well, the device software is easy does it with the already done I²C driver interface. The question is now, am i going to use this device to also do the calculations concerning transforming these pulses to wattages, kwh, liters/gallons and gas m³ or kwh. We deciced it would be better to use a plugin for this. Well here are the catches coming.
The decision to create a plugin also means we should not only support a “every so much time read amount of pulses”, but also an “accept every pulse instantly” method. Also not all the meters are the same in measurement calculations. Some use so many rotations on a analog device is on kW/h, others use kh as measurement. And we are not done yet, there are differences in calculating gas usage, some use so much kW/h used and others use m³. And of course there are liters and gallons. And still we are not done.
When having a plugin you should keep users as happy as possible to deliver them options, but not too much or, even worse, too less. One of the features we thought off in the preparation is: “On what kind of information do we make suggestions on what is good usage, over usage or just: “Damn, that’s a lot!””. And this is something we/I still are not thought out of yet. Do we let users fill in they’re usage of last year and create a day normal, high, a lot, scale or based on the amount of house members? House members is the easiest way for everyone, but filling in amounts give more precise control because some use gas for heating, and some air coolers. When filling in the amount of house members there will be unfair messages, but using absolute data gives complexity.
So when the plugin comes available it will support continuous and timed pulse amount readings, and users will need to fill out they’re last years usage (or an user targeted usage) to create a fair usage scale. Costs calculations will not yet be in the first version of the plugin but will certainly come. Also the plugin will be able to hook to any device the user wants which measures usages pulses.
Current work in progress
Currently we are using an Arduino board with an Atmega328p to do the measurements which counts the amount of pulses, and the server reads the device every minute. Below pictures of the sensors and current setup
The above shows the sensors we are using to detect the dark spot on the electricity meters, and the below photo shows the current test setup
Current power utility usage test setup.
The above photo shows the Arduino used with three leds. The red led lids up as long as the non reflective part of the disk of the analog electricity usage is in front of the sensor. This makes it very easy to debug any reading errors. The yellow and blue do the exact opposite. They lit up when the reflectors come before the sensor and respectively for gas and blue for water usage. The white wire are 16 meters of I²C and the black ones are going to the sensors.
Currently the software can be configured to select a specific device and which sensor of that device is reading the specific utility usage, and what calculation has to be applied. Currenltly only analog disks are supported. See the screenshot below
Unfinished utility settings page
The interface is still unfinished because some fields are missing like last years/goal measurements. And also high/low usage times and prices. Some extra fields will come where you fill in kwh/kh and liters/gallons. Gas will stay m³ but a possibility to supply a kW/h measurement unit is being thought of.
Current tests show a nice flow in usages which are being made with this plugin and is also already being graphed on the server’s web interface as seen below
The above is the beginning of the utility usage views in the web interface. IT supports real time gauge updates. The graphs can show the history for a day, week, month and year. More graphs and information will ofcourse follow as the plugin configuration get’s shape so more information can be shown.
In line with the above is the development of the client which of course should display this data. The screenshot below shows the clients progress
Utility gauges and little graphic updates
This screenshot is taken at a different moment, but shows the gauges of the current usages. Also in the client it will be possible to attach a gauge to the top bar. All the gauges are also in real time updated, and will of course be extended with graphs and information as soon it is available. The current shows work in progress and this was a first test with gauges in the upper task bar. Clicking on the task-bar widget opens up the bigger gauge.
The above is the current work in progress and when any feature has been build in it will be uploaded to the alpha version on the download page, and in between hot builds are available on the build server. Be aware that the build server is not always available because it is a workstation. I hop the above shines a little light on what we are doing right now. If you have any suggestion please let us know in the form field below, on twitter or facebook. The latter two will show more news and screenshots.
Hardware source code
Of course when stable, the source code for the hardware used will be available on bitbucket for download.
I’m tired, good night,