Pages: [1]   Go Down
Author Topic: Power meter with Pulsed Output?  (Read 1192 times)
0 Members and 1 Guest are viewing this topic.
South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm in desperate need of assistance. I have a Elster A100C power meter installed and operational in my house.

This meter as described in various other blogs, posts etc has an IRDA interface that can be interrogated for information. Additionally, the meter has an aux output that can be configured at factory time to be a pulsed output OR serial output packet the same way as the IRDA interface.

I'm unsure which configuration my meter has, but my assumption is that it has a pulsed output as described in the attached manual Section 14.

The manual also indicates the default pulse width is 100ms and 200p/kWh (=5Wh/pulse).

Can anyone please assist with how I could go about with using interups in measuring my power usage?

So far I am attempting to use the attachInterrupt(1, onPulse, FALLING) arduino function, but first of all, I'm unsure about whether I should use FALLING and secondly how to incorporate all the timings.

Thanks in advance.




* 143.pdf (1357.67 KB - downloaded 42 times.)
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With the pulse length being 100 mS there is almost no difference between using RISING and FALLING.  Pick one.

All the interrupt has to do is add 5 to a global volatile unsigned long that keeps track of kilowatt hours:

Code:
volatile unsigned long kWh = 0;

void ISR1()
    {
    kWh += 5;  // Each pulse represents 5 kWh
    }
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With the pulse length being 100 mS there is almost no difference between using RISING and FALLING.  Pick one.

All the interrupt has to do is add 5 to a global volatile unsigned long that keeps track of kilowatt hours:

Code:
volatile unsigned long kWh = 0;

void ISR1()
    {
    kWh += 5;  // Each pulse represents 5 kWh
    }

Thank you John, I would I then proceed to calculating the instantaneous power in Watt?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
volatile unsigned int watts = 0;
const unsigned long wattMilliseconds = 5UL * 1000UL * 60UL * 60UL * 1000UL;  // 5 kWh in watt milliseconds.

void ISR1()
    {
    static unsigned long previousPulseTime = 0;
    unsigned long currentTime = millis();
    unsigned long elapsedTime = currentTime - previousPulseTime;
    previousPulseTime = currentTime;

    watts = wattMilliseconds / elapsedTime;
    }
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Pages: [1]   Go Up
Jump to: