Gas Meter Reading Using a Magnetometer
-
@dpcr very interesting, I may use some of your sine measuring approach in a powermeter i make.
Nevertheless, i have a question: you say you have no magnet in yr meter, so what is it the magnometer is actually picking up?
@Ed1500 The magnetometer is picking up a change in the magnetic field. Normally the sensor itself is moving and so changes in x,y and z etc can be detected. In case of the gas meter the sensor is stationary but the change in magnetic field due to the rotating magnet on the dial is detected. This will give you a snow wave.
I presume In case no magnet still small changes can be detected due to rotating parts within the meter.
-
@dpcr very interesting, I may use some of your sine measuring approach in a powermeter i make.
Nevertheless, i have a question: you say you have no magnet in yr meter, so what is it the magnometer is actually picking up?
@Ed1500 As Dynamite said, it measures the change in the magnet field produced by the movement inside of the meter. I believe all ferris metals can have some sort of effect as well as an electrical field (something like that produced by an AA battery) on the sensor. There is no magnet in my gas meter (Rockwell 250). I used an app on my phone to determine the best possible location of the sensor. Look at the first post.
-
@dpcr Hi, I need to recalibrate to see if the reading is still OK. Somewhere during a total reset I have lost track. But it is on my to do list to get everything up and running again.
As far as I could recollect an overshoot had no influence on my code as the number of pulses for a total cycle is consistent within my code.On the Y reading from the sensor I do have a running average smoothing.
Basically every cycle is splitted into rising and falling part. Each splitted into a fixed number of steps. Based on the current reading of y the number of pulses is calculated within that step. So the amount of pulses within a rise or fall can never be more than the number of steps within that cycle.I am thinking of making the code more simple and only give a pulse on the changes and maybe one in the middle. That would give me about 4 pulses per cycle.
-
@Ed1500 The magnetometer is picking up a change in the magnetic field. Normally the sensor itself is moving and so changes in x,y and z etc can be detected. In case of the gas meter the sensor is stationary but the change in magnetic field due to the rotating magnet on the dial is detected. This will give you a snow wave.
I presume In case no magnet still small changes can be detected due to rotating parts within the meter.
-
@Ed1500 As Dynamite said, it measures the change in the magnet field produced by the movement inside of the meter. I believe all ferris metals can have some sort of effect as well as an electrical field (something like that produced by an AA battery) on the sensor. There is no magnet in my gas meter (Rockwell 250). I used an app on my phone to determine the best possible location of the sensor. Look at the first post.
@dpcr Thanks, yes i read how you did it with locating the sweet spot, but I was thrown off by the 'no magnet' statement.
'connecting' my meter is also still in the cards, no idea if it has a magnet or not (in which case i may use a Hall sensor), otherwise i may try the magnetometer -
@dpcr Thanks, yes i read how you did it with locating the sweet spot, but I was thrown off by the 'no magnet' statement.
'connecting' my meter is also still in the cards, no idea if it has a magnet or not (in which case i may use a Hall sensor), otherwise i may try the magnetometer -
@Ed1500 Good luck on on your project, keep us updated on your progress. I'm also thinking about trying to measure our electricity consumption using CT's rather than at the meter.
@dpcr thanks, indeed, I am using a CT as well, adding a dc bias, still balancing between just measuring the amplitude of the sinus, or measuring all along the sinus. I think i will have an attiny 25 or ideally an attiny13 do this as a dedicated I2C slave and have that read by an ESP8266. Ofcourse there is the sonoff Touch, but thats a tadd too much to put on a large number of devices.
-
@dpcr thanks, indeed, I am using a CT as well, adding a dc bias, still balancing between just measuring the amplitude of the sinus, or measuring all along the sinus. I think i will have an attiny 25 or ideally an attiny13 do this as a dedicated I2C slave and have that read by an ESP8266. Ofcourse there is the sonoff Touch, but thats a tadd too much to put on a large number of devices.
-
@Ed1500 the ic used in the sonoff pow (HLW8012) costs less than $1 and can do it all for you. Maybe that's an idea...
-
@dpcr the more steps you choose of course the more accurate it gets. At this moment I have divided the Total cycle in 20 steps. I have made this a parameter in my code.
@dynamite indeed, that is why i was looking at yr code. On the other hand, if the frequency is known and you know the amplitude, you can make a calculation.... but then again, in order to know the amplitude you need a series of measurements.
Thats why i was thinking to let a dedicated attiny do that: all it needs to do is to measure and put the result in its I2C registers. The esp8266 then can do a hoist of other things and just pull the powerparameters when needed -
@dynamite indeed, that is why i was looking at yr code. On the other hand, if the frequency is known and you know the amplitude, you can make a calculation.... but then again, in order to know the amplitude you need a series of measurements.
Thats why i was thinking to let a dedicated attiny do that: all it needs to do is to measure and put the result in its I2C registers. The esp8266 then can do a hoist of other things and just pull the powerparameters when needed@Ed1500 The amplitude is quite simple it is just measuring the (max) top and (min)bottom if the direction of your signal changes.This is quite consistent during the readings and if due to temperaturen or whatever cause it is changing the max and min are adjusted. However the period / frequency of the curve is not consistent as this is directly related to the consumption.
I think the linear approach to the curve is already quite accurate. But if you have a better routine in mind I love to hear. Basically I just have to adjust the array in which the different steps are calculated.I like the idee of having a dedicated attiny as I know from my sketch that in case of high volume the changes is the y are quite fast and the is (almost) no time to communicate with the gateway etc.
-
@Ed1500 The amplitude is quite simple it is just measuring the (max) top and (min)bottom if the direction of your signal changes.This is quite consistent during the readings and if due to temperaturen or whatever cause it is changing the max and min are adjusted. However the period / frequency of the curve is not consistent as this is directly related to the consumption.
I think the linear approach to the curve is already quite accurate. But if you have a better routine in mind I love to hear. Basically I just have to adjust the array in which the different steps are calculated.I like the idee of having a dedicated attiny as I know from my sketch that in case of high volume the changes is the y are quite fast and the is (almost) no time to communicate with the gateway etc.
@dynamite yes i do not see a problem in measuring the amplitude. I am not sure if, when measuring current through a CT, the frequency will change, as that is just the grid frequency, but probably you were referring to its use in measuring gas flow.
My idea to use a dedicated attiny is simply so the ESP will be freed of the burden of calculation/measuring, as this will be a rather continuous process. The code will probably fit an attiny13, but I have never tried i2c on an attiny13, but I have on an attiny85, so i am pretty sure it will work on the 25 and 45 as well. The 13 I still have to try
-
-
-
@pihome I power mine with an adapter as well. This node sends too much information to be battery powered. I was researching solar because the sensor sits outside on the south side of our home but never followed up on it. Maybe for another day.
I was thinking to have it powered with battery and solar charger but lot can go wrong with this setup, may be best to have it powered via proper power supply, i have ordered sensor and i will build this once i get that delivered and report back, i was thinking to calculate co2 footprint as well for gas usage.
@dpcr said in Gas Meter Reading Using a Magnetometer:
@pihome I power mine with an adapter as well. This node sends too much information to be battery powered. I was researching solar because the sensor sits outside on the south side of our home but never followed up on it. Maybe for another day.