Monitoring Gas meters without pulsed output or magnet

Hi all,

I have been looking to get my gas meter hooked up to my OEM system, but discovered that it has neither a pulsed output, or even a magnet on the smallest digit wheel. There is not even a reflector on one of the numbers, as I have seen elsewhere.

The smallest digit is in fact a turning red needle (see attached image). As the background surface is white, I was wondering if I could use a light sensor (LDR) to detect a change in the amount of reflected light between the white background, and when the red needle passes. The change would likely be small, so I would need quite a bit of light to get a clear 'pulse'.

I built a test rig, consisting of a housing (to model the meter), with an insert with a red 'needle' shape on it. On top is a view window into which the LED would be shone, and the reflected light measured by an LDR. You can see I have made a black 'shroud' so that the view window only shows the position where the 'needle' will be.

I managed to salvage an LDR from a broken robot hoover (never buy cheap when it comes to robot hoovers). It doesn't look like the conventional LDR, and not sure how good it is. Got some 'proper' ones in the post.

I set up a test sketch which monitors the analog signal from the LDR. For the resistor values I've used, I get the following readings from a Arduino Uno analog input (roughly);

  • Needle visible (i.e., a gas 'pulse'):       160 [This is with the red needle shape inserted into the housing]
  • Needle not visible (between pulses): 130 [This is with the red needle shape removed]

Note that I put a hood over the top of the rig to prevent any ambient light getting in. I will have to redo this test when I fit the sensor to the gas meter but it gives me an idea of what to expect.

Not too sure on what resistor values to use for the LDR. With limited light, I want to make sure I have as big as range of values as possible so as to get a reliable reading as a 'pulse'. At the moment I've got 20k ohms, which gives a ratio of min to max analog values of 1:1.25. If I go for smaller resistors the absolute range increases, but the ratio is smaller. (Note I have no data on the LDR as I scavenged it and can't find anything like it on the web!) Something to sort later as I need to do some tests on the real meter first.

The key thing will be to maximise the amount of light. I don't know much about LEDs- what should I be looking for? I need maximum brightness for 5V. The LED needs to last a long time as it will essentially always be on.

Would be great to hear what people think of this. I'm pretty new to electronics and physical computing so it's likely that I may be missing a trick!

Chris

Robert Wall's picture

Re: Monitoring Gas meters without pulsed output or magnet

A red LED? Possibly not the best colour. The pointer appears red because it absorbs all colours except red, which it reflects back. The white background appears white because white light is the sum of all colours of the spectrum, and it reflects all back equally. So the red pointer reflects the red light back, and the white background reflects the red light back...  I'd be interested to see what a green LED, or better still a blue one, gives you. Though the LDR might be less sensitive at those colours, I think you should have a greater variation between pointer and no pointer. As well, you could try focussing the light so that the width of the spot is equal to or slightly less than the width of the pointer. The mask should be having a similar effect, so this may not help much.

You don't need maximum brightness, you need maximum difference between light and dark, with light only needing to be far enough out of background noise to not have noise as a problem. (And by noise I mean both electrical and stray light getting in.)  I think you should choose the resistor and LED current so that the LDR output dark is below 5% scale, and the output light is a reasonable way above that - ideally above 10% scale.

In the software, you probably need to get a long-term average of the LDR output and compare the instantaneous value against that, rather than having fixed levels.

charliemic's picture

Re: Monitoring Gas meters without pulsed output or magnet

Hi Robert,

Yes you're right, red isn't ideal, but when I tried green I got very little output (and had no other colours). I believe the reason for this is that the "LDR" is in fact an infrared phototransistor. I didn't know much about these until I stumbled upon them looking for something else. So it would make sense that it was fairly sensitive to 'red' light as it is designed to deal with lower frequency infrared.

Anyway, it does seem that the results I got are the wrong way round, as the red surface gave the larger output, when the white surface in theory is returning more light overall. One possible explanation is that the paper insert I used sat a few mm proud of the surface below it, thus shortening the distance to the sensor and increasing reflected light intensity slightly. This is actually fine since the needle on the gas meter is also proud of the surface behind.

Having said all this, I have now stumbled upon a possible better solution using infrared LEDs and phototransistors. This is what is used for robots to get them to follow a black line on a light surface, but calibrated properly should be able to tell the change in reflected light when a needle passes by. Something like the Pololu qtr-1a-sensor sold by hobbytronics. 

The problem is the range- at only 3mm for this product (and others seem similar), it may not be large enough to reach the surface behind the Perspex cover (which is another issue- there will be some 'noise' reflectance from this which could reduce the contrast in signals). At longer range the signal to noise ratio could be problematic (I note your thoughts on this above- thanks). I will have a go at assembling a sensor myself (turns out I have an IR LED too- thought it was just a dead LED!) and see if I can get some sensible results.

Chris

Robert Wall's picture

Re: Monitoring Gas meters without pulsed output or magnet

Looking at the picture of your meter, I did notice that the pointer appeared to be fairly thick and wondered whether this could be used to advantage. If the surface of the pointer is relatively smooth and reflective, can you shine the 'light' (of whatever colour!) at a fairly low angle and work on the basis that the light reflected off the surface of the pointer will come back in a different place to the light reflected off the white background. Or that might work better the other way round and let the pointer block the light reflected off the white background. It makes the optics rather more complicated but it's another avenue to explore.

(Webcams - at least mine, a cheap Polaroid - are quite good at seeing IR LEDs.)

boelle's picture

Re: Monitoring Gas meters without pulsed output or magnet

Simone72's picture

Re: Monitoring Gas meters without pulsed output or magnet

Good morning to all of you,
Relaunching this project because I counters very ancient, water and gas.
I'm Already talking on the forum Arduino in this Topic knowing that I will be a great help.
My approach will be exclusively via the optical photodiode array (TSL1402R) and managed lighting with an RGB LED.
The first tests I make them with a Mega2560 as Playground then go on to Arduino DUE.

My goal is not read exactly the characters of the red zone via a post treatment with a type Tesseract OCR. But I want to check the simple passage of the horizontal white cleats or maybe the rotation of the needle that I highlighted in blue like the photos:

Gas Meter

Water Meter

I hope I can count on your help,

Simone

 

Robert Wall's picture

Re: Monitoring Gas meters without pulsed output or magnet

I think it will be very difficult to do what you want. You will need to focus a light only on the white bar as it moves past, then you must detect the change in the light level as the lit area goes from red to white to red. You will probably need to use blue light, and have a sensor that is sensitive to blue light. Unfortunately, many sensors are most sensitive to red and infra-red rather than to blue. (see http://en.wikipedia.org/wiki/Photodiode)

Must you use optics? Does the meter have a magnet inside one of the wheels that you can detect with a reed switch?

You might like to look at this thread: http://openenergymonitor.org/emon/node/5779

Simone72's picture

Re: Monitoring Gas meters without pulsed output or magnet

Thanks Robert but my counters are old,

I'm doing it just to solve the problem of many users.
Santa "Mouser" Christmas is already here ... ;-)

 

wannes32's picture

Re: Monitoring Gas meters without pulsed output or magnet

I am dealing with the same problem on my gas meter: no blinking led, no mirror or white spot in one of the digits, no magnetic pulse,...

I tried to detect the pattern of a round of the right digit with a sensitive IR sensor, but no luck.

I'm curious, Simone72, if you'll have luck with the sensor you have now. Which one is it that you try?

Simone72's picture

Re: Monitoring Gas meters without pulsed output or magnet

Hi Wannes32,
I'm sure to have this problem we are not alone ...
Can you tell me with IR sensor that you did your tests?
Have you tried with which of these?
You can add a photo of the display of counter?

Thank You,
Simone

Robert Wall's picture

Re: Monitoring Gas meters without pulsed output or magnet

If you are using red light or infra-red, then you are not likely to see a contrast between red and white, as I explained at the beginning of this thread. You need to move to the other end of the spectrum and use blue light: the red parts will absorb all the blue light and appear dark, the white parts will reflect the blue light and appear light. You need a blue LED to light the dials, and a blue-enhanced photodiode detector to see the changed light level. Unfortunately, those are very costly: http://uk.rs-online.com/web/p/photodiodes/7378035/ And you will probably need lenses to focus the LED light onto the correct part of the register, and to focus the image of the register onto the detector, so as to make the best use of the light you have.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.