Pages: [1]   Go Down
Author Topic: Read the itron 100g dl gas meter  (Read 1676 times)
0 Members and 1 Guest are viewing this topic.
Atlanta, GA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so the meter - if you look closely you can see the gear that rotates in the attached pictures

I used the RadioShack Emitter and Detector #276-0142 set and some pvc and duck tape (to block the sun light and to hold it in place)

here's the meat of the code
because it get's full on sun I use filters for the cross over counts

Code:
#define gas_analog_in 4
#define gas_digital_out 4
void loop()
{
    GasLoop();
}

unsigned long gasTotalCount = 0;
unsigned long gasLastCount = 0;
unsigned long gasG5count = 0;

unsigned long gaslastMillis = millis();
unsigned long gasReading = 0;
unsigned long gasReadingMax = 0;
unsigned long gasReadingMin = 1023;
unsigned int gasFlag = 0;
unsigned long gasTripHigh = 0;
unsigned long gasTripLow = 1023;
int gasTripOffset = 75;
float gasFilterL = 900;
float gasFilterOff = 900;

int gasOut = HIGH;

void GasLoop()
{
  gasReading = analogRead(gas_analog_in);
 
  gasFilterL += .01 * (gasReading-gasFilterL);
 
    gasReading = gasFilterL;
   
  if(gasReading>gasReadingMax) gasReadingMax = gasReading;
  if(gasReading<gasReadingMin) gasReadingMin = gasReading;
   
  if(gasReading<gasTripLow) {
    gasFlag = 1;
  } else if (gasFlag == 1 && gasReading>gasTripHigh) {
    gasFlag =0;
    gasTotalCount++;
  }
   
  if (gasReading>gasTripHigh) {
    gasTripLow = gasReading - gasTripOffset;
    gasTripHigh = gasReading;
  }
  if (gasReading<gasTripLow) {
    gasTripHigh = gasReading + gasTripOffset;
    gasTripLow = gasReading;
  }

}


over the last two months I had:
BilledMyReading%Delta
1211.881.00%
1111.16-1.45%

so over the 2 months -0.17% (seeing they bill at 1ccf and I measure at .01)

I'm happy with results so far!





* gas_meter_down_cut.JPG (291.06 KB, 2048x1536 - viewed 84 times.)

* gas_meter_front.jpg (37.12 KB, 640x480 - viewed 73 times.)
Logged

Calgary, AB
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice work!
My utility company has recently installed the 100G DLN wireless module on my gas meter (DL and LDN are the same except that the DLN has more power for fixed network reads...whatever that is).
I'd like to read the meter electronically and your solution seems to be the simplest. The option of reading it wirelessly seems more involved.

Can you provide a little more detail on how the gear rotation works to allow passage of the infrared? I see from the pictures how you have mounted it, but the details aren't entirely clear to me.

Thanks in advance!

Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so the meter - if you look closely you can see the gear that rotates in the attached pictures I could not see this.What does the IR beam do . Is it cut by the gear moving? I take it you have nothing inside the meter so how are your devices positioned
I used the RadioShack Emitter and Detector #276-0142 set and some pvc and duck tape (to block the sun light and to hold it in place)Its "duct" tape I think .How does this keep out the sunlight though?
here's the meat of the code
because it get's full on sun I use filters for the cross over counts Could you explain this a bit more please?
Logged

Atlanta, GA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry never got a notice - this is late but you never know

the gear blocks the beam - so the analog reading  varies with the position of the cam

yes duct tape - blocks or limits the amount of light that the sensor see's - noon with full sun would get lots of false readings

but having a slow moving filter varying sunlight conditions didn't trigger false readings

gasFilterL += .01 * (gasReading-gasFilterL);

so if your current gasFilterL was 700 and then you get a bright spot and read 300 your new reading is lowed by .04

if you used an unfiltered value the 400 delta would have triggered a count


* 20110216_152233_1.jpg (36.71 KB, 640x480 - viewed 11 times.)

* 20110216_215241_1.jpg (14.16 KB, 640x480 - viewed 9 times.)

* 20110218_101741_2.jpg (39.37 KB, 640x480 - viewed 12 times.)
« Last Edit: March 25, 2014, 07:34:50 pm by pantonvich » Logged

Pages: [1]   Go Up
Jump to: