Aussie Susan
Advanced Member level 5

Context: My home automation system has a couple of monitors for my gas and water consumption. The meters are mechanical and have a magnet on the least significant 'digit' of the dials. I have a 'Hall Effect' transistor that measures the magnetic field from each of these meters every few seconds. In this way I wont to detect the number of complete rotations of these display wheel and there by work out my gas and water consumption over days/weeks/months.
The monitoring electronics measures the voltage from the Hall Effect transistor. To detect the turns, I have a 'Schmitt Trigger' system that turns on and off at predefined voltage thresholds - the lower one turns 'off' and the upper one turns 'on'.
My problem is to best calculate the 'on' and 'off' thresholds.
I suspect that this is complicated by some environmental factors (temperature????) as the initial thresholds that I worked out seem to drift over time (months).
I have access to the individual measurements that are in the home automation system database going back about 6 months (at least).
Plotting out the voltage for the last couple of days for the gas I get:

The gas hot water pilot is continuously using a little gas and there is a reasonable 'difference' when the magnet comes close to the transistor. Therefore I'm reasonably confident about setting an 'on' threshold at about 3700 and an 'off' threshold at about '3500'.
However for the water usage I get:

where the pauses show where no water is being used.
Given the noise on the measurements and the nature of the underlying 'signal' I'm looking for suggestions as to how best determine the thresholds for the water monitor.
I might be able to make this a dynamic system in the future but for now just being able to run a program every day/week/month (until I see how stable the threshold values really are) is fine.
Susan
The monitoring electronics measures the voltage from the Hall Effect transistor. To detect the turns, I have a 'Schmitt Trigger' system that turns on and off at predefined voltage thresholds - the lower one turns 'off' and the upper one turns 'on'.
My problem is to best calculate the 'on' and 'off' thresholds.
I suspect that this is complicated by some environmental factors (temperature????) as the initial thresholds that I worked out seem to drift over time (months).
I have access to the individual measurements that are in the home automation system database going back about 6 months (at least).
Plotting out the voltage for the last couple of days for the gas I get:

The gas hot water pilot is continuously using a little gas and there is a reasonable 'difference' when the magnet comes close to the transistor. Therefore I'm reasonably confident about setting an 'on' threshold at about 3700 and an 'off' threshold at about '3500'.
However for the water usage I get:

where the pauses show where no water is being used.
Given the noise on the measurements and the nature of the underlying 'signal' I'm looking for suggestions as to how best determine the thresholds for the water monitor.
I might be able to make this a dynamic system in the future but for now just being able to run a program every day/week/month (until I see how stable the threshold values really are) is fine.
Susan