Meassure digital pulses from electrical meters



  • I have a RasPi model B and I have connected four electrical Kamstrup meters which gives one 30ms pulse per Watt being used. I have connected the pulse wires to GND and the GPIO pins and I am using the internal pull-up resistor and I am detecting pulses with interrupts. Currently I am struggeling with "ghosting issues" meaning that I am detecting pulses which didn't come. For example I have connected an electrical meter to the RasPi but I have not plugged it in to a power source so it should NEVER be able to give out a pulse but even though it is giving a few ghost pulses per day - which is a clear indication there is interference in my cables or they are influencing eachother.

    A solution could be to have a hardware debouncer and not using the internal stuff in the RasPi, but this is not ideal too as it involves even more wirings so ideally I can find an add-on board which can solve my exact problem, so my question is:

    Does UniPi have its own hardware debouncer and will I be able to trust the input? Ideally I connect the two wires directly in to the UniPi and it handles debouncing etc.

    If relevant this is the data from the electrical meters, http://kamstrup.com/media/766/file.pdf



  • I have a RasPi model B and I have connected four electrical Kamstrup meters which gives one 30ms pulse per Watt being used. I have connected the pulse wires to GND and the GPIO pins and I am using the internal pull-up resistor and I am detecting pulses with interrupts. Currently I am struggeling with "ghosting issues" meaning that I am detecting pulses which didn't come. For example I have connected an electrical meter to the RasPi but I have not plugged it in to a power source so it should NEVER be able to give out a pulse but even though it is giving a few ghost pulses per day - which is a clear indication there is interference in my cables or they are influencing eachother.

    A solution could be to have a hardware debouncer and not using the internal stuff in the RasPi, but this is not ideal too as it involves even more wirings so ideally I can find an add-on board which can solve my exact problem, so my question is:

    Does UniPi have its own hardware debouncer and will I be able to trust the input? Ideally I connect the two wires directly in to the UniPi and it handles debouncing etc.

    If relevant this is the data from the electrical meters, http://kamstrup.com/media/766/file.pdf



  • Hello,

    it does not have "hardware debouncer", it has something better The Digital Inputs works in range of 5-24V. So you would have to "interference" at least 5V to turn the DI on, which is enough for most installation. On top of that we have our evok api which has a software debounce function.

    So i think it should fix your problems…. I did not go much through the datasheet bud the opto-things on the pulse outputs should be able to switch the 12V voltage (if you use the internal 12V) or you can use other power sources instead (depending on the output type of your electricity meter).

    Then the wiring diagram will be:
    UniPi Meter
    12V <--> IN
    DI1 <--> OUT

    I will put explanation of connecting energy meter or other sensors to the wiki later...

    Hope it helps.

    Tomas



  • I have no idea if the electrical meter will work with this as I am no hardware guy at all. What I can see from the documentation of the meter:

    1000 pulses/kWh 30 ms +/- 10%
    Max voltage*1 400 VAC or DC
    Max power dissipation 400 mW
    *1) If an inductive load generates spike voltages which exceed the maximum rating, the spike must be limited, e.g. by
    adding a clamp diode to the load.

    I can't see software can help limit the number of "ghost inputs" - I have no idea what kind of spikes it generates and I guess it just as well could be 5VDC as it could be 3.3VDC so I am not sure the software debouncer will help as a "ghost input" could come several seconds/minutes/hours after the last pulse? But again… I am no hardware guy so I would need someone to confirm that this actually would solve my problem 100% as I otherwise cannot justify to buy an add-on that costs 3 times as much as the RasPi itself