I have a Sensus SR-II water meter. Per the meters datasheet, "Water flows through the meter’s strainer and into the measuring chamber where it drives the piston. The hydrodynamically balanced piston oscillates around a central hub, guided by the division plate. A drive magnet transmits the motion of the piston to a driven magnet located within the hermetically sealed register. The driven magnet is connected to the register gear train. It reduces the piston oscillations into volume totalization units displayed on the register dial face." In other words, for this process to work, you need a meter that has a magnet driving the meter. This process counts the number of oscillations and converts it to gallons (or liters ). Christopher Case did the preliminary work in helping to understand how the HMC5883L works with the water meter and connection to the Proton. Additionally, Sparkfun has documentation on the HMC5883L and their breakout board which was very helpful. Getting the HMC5883L connected to the Proton and changing the code to report activity (passing a magnetic over it) on my Particle dashboard was pretty straight forward. Unfortunately, my water meter is encased in a cement enclosure about 60 feet from the house which was far enough away that the WIFI reception on the Proton was nonexistent. The meter was also next to the street and in the open which eliminated some options. Since the HMC5883L communicates using I2C which is a very short range protocol, I needed an alternative. I found a pair of devices by Sandbox Electronics that converts the I2C protocol to a bidirectional protocol using an NXP PCA9600 at 12 volts for the extended distance. Sandbox provided good documentation and answered all of my questions via email. The Proton is located next to the house near a 120 volt power source and within range of my wifi and the HMC5883L is attached to the water meter. The bidirectional traffic and power for the HMC5883L is over a CAT6 cable buried underground. A 120 volt power supply provides 5 volts to the Proton using a USB mini connector, the Sandbox devices also need 5 volts and and two step down voltage regulator supplies 3.2 volts for the I2C signal and the HMC5883L. All of the electronics are enclosed in water resistant enclosures. I decided on the cable since the HMC5883L is sampling constantly and the Proton is always on so maintaining a battery would be an issue.
Proton and 3.2 voltage regulator on breadboard., I2C boost extender and power supply.
I2C buck extender. HMC5883L connected to cable exiting at the bottom of the box.
Particle Proton - The C++ code came primarily from Christopher Cope with the Google interface from Gustova Gonnet. Refer to their project descriptions for additional instructions. I did some slight modifications. The code is attached.
1 / 2 • Calculation Sheet - All computations are done on this page.
1 / 2 • Database Sheet - The data passed as a sting is currently stored as is
1 / 2 • Minute Sheet - Values aor the graphs are separate from calculations.
Appsheet - Appsheet is an addon to Google Sheets. It pushes your spreadsheet data to your smartphone for display, graphing, editing, etc. I focused on the graphs exclusively. The advantage of Appsheet is development work is free and you can push it out to your smartphone to see how it works. I did six different versions of the Google Sheet and Appsheet while I learned how they worked together. As with any application, there is a learning curve. It seemed to work best for graphs when the calculations are done on a separate worksheet and results for each graph are displayed on separate worksheets with a formula reference to the calculations.