Bare-bones single pulse counting on Pi?

I have a rotating disk style electricity meter but I've rigged up a photosensor and can get pulses from the meter with (from memory) 375 revolutions per kWh. I have access to a Raspberry Pi to experiment with.

  Meter -> Sensor -> Pi -> Emoncms (optional)

Can anyone point me to hardware and software links to configure the Pi to count directly without the emonTx and to serve the data or pass it to emoncms.

(I've read http://openenergymonitor.org/emon/buildingblocks/introduction-to-pulse-c....)

Many thanks.

Robert Wall's picture

Re: Bare-bones single pulse counting on Pi?

Throwing "pulse counting on Raspberry Pi" at Google shows more than a few results. Although it's been discussed, I haven't seen any reports on this site that anyone has tried and succeeded with this approach - the Atmel microprocessor in the emonTx is much better suited for this kind of application, though I appreciate why you would want to avoid having the extra kit if it's not necessary in your application.

Transistor's picture

Re: Bare-bones single pulse counting on Pi?

Thanks, Robert. I subsequently found http://openenergymonitor.org/emon/node/2017 and there seem to be some problems using interrupts on the Pi to count the pulses.

For anyone interested, here is my meter pulse reader on an ESB Ireland Siemens RM223 meter.

Pulse sensing on Siemens RM223 electricity meter.

I had a scrapped Wenglor photo-sensor but there were a couple of problems:

  • The sensor uses a red light source. The meter has a red mark on a silver background. Far from ideal as both reflect red.
  • The sensor is too long to point at the disk AND close the door of my meter box.

I have access to a 3D printer so I made a 45° mirror head, cut a piece of front-surface mirror that I had saved from a scanner I scrapped, superglued it into the bracket and mounted the combination on another 3D printed bracket.

Alignment was critical. I couldn't get reliable reading looking straight in. I found that looking up at the disk from below gave the best results. Slots in the main bracket proved much easier to fine adjust rather than rotating the mirror head. My meter box is outside and I found it best to set it up after dark as the light spot could easily be seen.

I can't really recommend this solution. If I hadn't had the industrial sensor I would have tried using a blue light to maximise contrast between the red mark and the silver edge of the disk.

By the way, many of the posts discuss accuracy of the utility meters and whether something like the emonTx is more accurate. In my case I want to monitor what I'm being charged for so using the utility meter is the most accurate.

So now I'm back to my original problem. Can I interface this directly with the Pi or do I need an Arduino in between? The second option seems a bit silly.

Robert Wall's picture

Re: Bare-bones single pulse counting on Pi?

"By the way, many of the posts discuss accuracy of the utility meters and whether something like the emonTx is more accurate. In my case I want to monitor what I'm being charged for so using the utility meter is the most accurate."

The meter is by definition accurate! - unless you can calibrate the emonTx to a better accuracy and keep it within calibration. Calibrating the emonTx with even a very expensive multimeter is not likely to exceed the meter accuracy by much if at all. The kit you'd need to do that would be prohibitively expensive, even to hire.

Don't put too much emphasis on the problems of counting pulses from switches. If you have a recording oscilloscope, you could use that to look at the output from your optical sensor, but I would be quite surprised if there were any glitches on the edges of the pulses, so you should be able to use the pulse output with little or no processing.

I think I'd be tempted to evaluate the various suggestions and try one or two that look as if they have promise. I know very little about the Pi so I can't really help you.

Comment viewing options

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