I have an old gas meter BK-G4, and I wanted to create my own IoT thing to read our consumption.
About pulse meter readingOld-style meters have wheels, disks or dials that rotate. They often have a black or white patch on the disk, or they may have embedded magnets. Reading the meter automatically can be tricky, however there are several methods for detecting the pulse of the meter.
A light meter or camera can be used to detect change in light (dark-to-light, or light-to-dark) or a magnetised switch can be positioned close enough to the dial that it will turn on/off when the wheel rotates. This is called pulse-reading.
In my case, each time the right-most wheel on the gas meter rotates, the magnet in the wheel will trigger the switch on/off, and the pulse will register. For each rotation [pulse], there is an amount of gas that passes through the meter. Therefor, the quantity of gas can be calculated by counting the pulses. From the quantity, we can also calculate the cost.
As an advanced topic - not covered in this project - it would be interesting to compare the pulse count to the actual gas meter reading over time.
PrototypingI used an incremental approach to get the various bits to work together.
Proto 1: connect the pulse reader IN-Z61; wiring up to a board. I got help from the Forum on the wiring.
Proto 2: getting the card to connect to our wifi. Tips: use WiFi.mode(WF_STA)
Proto 3: deciding on the format in MySQL to store the data. See the enclosed SQL Schema.
Proto 4: Current implementation
TODO:
- flash the LED with status / error code
- convert pulseCount to actual gas usage/cost
- design & 3d-print box for board
- connect the sensor to the box via 2.5mm jack / or RJ11
- connect 2 other sensor, Electricity and Solar Panel
- look at the new Mozilla IoT gateway...
Note: I was not able to add some software that I used in the project... so I added them here:
- Node JS
- MySQL
- Grafana, running in Docker
Comments
Please log in or sign up to comment.