Problems reading pulse output

Hi all,

I'm quite new to working with arduinos and I hope that maybe one of you could help me. What I am currently trying to build is a data logger for a kWh meter that we're using for one of our energy projects. We are using a Eastron SDM230-DR power meter (https://www.linemetrics.com/wp-content/uploads/2021/04/SDM230D_Series_Manual.pdf).

The power meter has 2 pulse outputs, for imported and exported energy. The test pulse output rate is 1000imp/kwh. So my idea was to count the amount of pulses so that I can convert this to kWh and log this per time.

I've started by reading the input data from the power meter.

On the power meter there are three ports.

  • 8 = Pulse 1 Export active energy
  • 9 = COM Ground
  • 10 = Pulse 1 Import active energy

I've connect 9 to the GND, and 10 to the A0 port of the arduino UNO. I've placed a data logging shield over my arduino UNO. But I am not using the capabilities of this shield yet.

My code:

int input;

void setup() {
  Serial.begin(9600);
}

void loop() {
  input = analogRead(A0);
  Serial.println(input);
}

My results:
When the wires are connected to the power meter, but there is no flow of electricity through the power meter (it is off, see my second picture), the arduino still measures a pulse output? I am really confused by this..

What I hope to achieve:
*A better understanding of how the arduino can register a pulse when the power meter isn't turned on.
*How I should read the pulses properly, if that is even possible?

Thank you guys already in advance.

Kind regards,

Jerom

The picture of the set-up

The key word that I tuned into was pulse. The I see the code trying to read the analog values of the pulse. Most likely one would want to count pulses, for a time. The do the math to get the kwh. If it is 1000 pulses per kwh then do the math.

Simple Pulse Counter - Using Arduino / Programming Questions - Arduino Forum << might get you started. If not use the search thingy, upper right hand corner, and some words like "frequency counter".

Why are you using an analog read for a digital (binary, on/off) pulse?

On my site here you will see how I read pulses from a power meter

1 Like

Thank you for your response, I have a code that counts the frequency of the pulses. But the amount of pulses is way too high..

Thank you. I changed the analog to a digital read, now I get 0 and 1 in my readings. Which is a lot better. If the power meter is on (so the lamp is on), I get these as my readings from the input.

int input;

void setup() {
  Serial.begin(9600);
}

void loop() {
  input = digitalRead(7);
  Serial.println(input);

}

The frequency of the pulses is just too high for a 7W lamp...

I will take a look at your website now and see if I can figure it out myself! Thank you for sharing.

I think that the signals that you are seeing are noise/mains hum that you are picking up on the wiring between the meter and the Arduino.

Try twisting your GND and signal wires together to reduce noise pickup.

That instruction sheet for the meter doesn't give a lot of information about the pulse output (other than it is 1000 pulses/kWh), however at the bottom of the introduction section, it does say that it is passive.

I think that means that there is no voltage coming out of the meter, but it is just being switched to the common.

If this is the case then you have to connect a pullup resistor to the +5V supply. The easiest way to do this is to use the internal pullup resistor on the input you are using.

You can activate this by adding:

pinMode(7,INPUT_PULLUP);

to your setup()

1 Like

@JohnLincoln

I think this has solved it! This resulted in 7-8 pulses per hour, which corresponds with the expecations of a 7W lamp.

Thank you very much.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.