Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Gas Meter Reading Using a Magnetometer

Gas Meter Reading Using a Magnetometer

Scheduled Pinned Locked Moved My Project
77 Posts 10 Posters 23.3k Views 12 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Ed1500

    @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.

    YveauxY Offline
    YveauxY Offline
    Yveaux
    Mod
    wrote on last edited by
    #68

    @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...

    http://yveaux.blogspot.nl

    E 1 Reply Last reply
    0
    • dpcrD dpcr

      @dynamite Makes sense, how would you measures the flow when it gets real low?

      dynamiteD Offline
      dynamiteD Offline
      dynamite
      wrote on last edited by dynamite
      #69

      @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.

      E 1 Reply Last reply
      0
      • YveauxY Yveaux

        @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...

        E Offline
        E Offline
        Ed1500
        wrote on last edited by
        #70

        @Yveaux yes, As a matter of fact I looked into that one, I think they can be had for 60cts, but the 'problem' is they need a galvanic connection to the grid and to the esp as well. I want it to be completely isolated from the grid

        1 Reply Last reply
        0
        • dynamiteD dynamite

          @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.

          E Offline
          E Offline
          Ed1500
          wrote on last edited by
          #71

          @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

          dynamiteD 1 Reply Last reply
          0
          • E Ed1500

            @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

            dynamiteD Offline
            dynamiteD Offline
            dynamite
            wrote on last edited by dynamite
            #72

            @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.

            E 1 Reply Last reply
            0
            • dynamiteD dynamite

              @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.

              E Offline
              E Offline
              Ed1500
              wrote on last edited by
              #73

              @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

              1 Reply Last reply
              0
              • pihomeP Offline
                pihomeP Offline
                pihome
                wrote on last edited by
                #74

                @dpcr, @dynamite how you powering your node? Do you supply constant power from some
                Power supply (mobile charger) or running on batteries?

                PiHome - Smart Heating Control

                dynamiteD dpcrD 2 Replies Last reply
                0
                • pihomeP pihome

                  @dpcr, @dynamite how you powering your node? Do you supply constant power from some
                  Power supply (mobile charger) or running on batteries?

                  dynamiteD Offline
                  dynamiteD Offline
                  dynamite
                  wrote on last edited by
                  #75

                  @pihome Hi i am powering it with adapter. So no batteries used.

                  1 Reply Last reply
                  0
                  • pihomeP pihome

                    @dpcr, @dynamite how you powering your node? Do you supply constant power from some
                    Power supply (mobile charger) or running on batteries?

                    dpcrD Offline
                    dpcrD Offline
                    dpcr
                    wrote on last edited by
                    #76

                    @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.

                    pihomeP 1 Reply Last reply
                    0
                    • dpcrD dpcr

                      @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.

                      pihomeP Offline
                      pihomeP Offline
                      pihome
                      wrote on last edited by
                      #77

                      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.

                      PiHome - Smart Heating Control

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      19

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular