Community
OpenEnergyMonitor

Community

Optical LED Pulse Sensor not giving pulses

Bought the OEM sensor last week.
I am feeding it via pi with 3.3vdc and attaching it to a Karmstrup smart meter fitted last week.

The little green light on the sensor flashes in time to the yellow meter led.
The output from the sensor is normally 3.3 volts and drops to about 2.4 volts when a flash occurs.
I can get the sensor to 0.2v if I shine a light into it.
I tried removing the double sided sticky pad to get the sensor a couple of mm closer to the meter led, no difference.
So I believe my problem is a hardware one, Has anyone run the sensor through a schmit trigger or added a transistor or other electronics to get enough of a differential on the output to create a pi trigger?

What are you using as your reference for the voltage measurement? The optical sensor output goes HIGH (towards +3.3 V) when illuminated, so I wonder how you’ve connected it. The connections are:

Pin 2 - (Red wire):  +3.3 V
Pin 5 - (Black wire): GND
Pin 6 - (Blue wire):   OUTPUT

[Edit] As far as I’m aware, the sensor output is definitely not TTL, and should not have an external pull-up or pull-down resistor, so you should not be using a pull-up resistor inside the RPi.

Bear in mind the LED on the back is not a reliable indication of a change of state of the output… See First try with EmonPi - Pulsecount stuck at 1

Thanks Robert
What are you using as your reference for the voltage measurement? I am using my AVO MEGGER M5091 and a Fluke 73III digital meter, The AVO is better at catching the changes in voltage. I now realise that both of these meters aren’t quick enough to pick up the pulse.
The 3.3v and 0v come straight from GPIO on the pi and are very stable .
The Blue (output) isn’t connected
I changed the common lead from + to - .
I now get 0v no flash and 0.85 volts on a flash. If removed and exposed to light I get 3v.
So it seems that my Karmstrup flash is long enough to flash green led but not long enough to energise blue wire.

I tried using the pi and using

#!/usr/bin/env python
import time
import pigpio
pin=16
pi = pigpio.pi()
pi.set_mode(pin, pigpio.INPUT)
pi.set_pull_up_down(pin, pigpio.PUD_DOWN)
while True:
    v = pi.read(pin)
    time.sleep(.1)
    print(v) 

I began to see " ! " going by very quickly.
Thanks to you I know that the green LED and output blue wire aren’t connected so my problem was timing.
Thanks again Robert

PS. so it is now working as expected

You think it is working correctly, but I think you are not using it correctly.

I repeat, the connections are:

Pin 2 - (Red wire): +3.3 V
Pin 5 - (Black wire): GND
Pin 6 - (Blue wire): OUTPUT

You must connect the Red wire to GPIO +3.3 V.
You must connect the Black wire to GPIO GND.
You must connect the Blue wire to GPIO Pin 16.
You must NOT set pi.set_pull_up_down.

When you connect like this, you have a permanent 3.3 V supply to the sensor, and the Output - the blue wire - will go to a logic HIGH when the LED on your Kamstrup meter flashes.

This is how the optical sensor is intended to work.

That is wrong. I have recorded pulses on the blue wire using an emonTx that are only 5 ms long. An isolated pulse of that length is almost invisible.

Hi Robert
I took your advise and removed the line “pi.set_pull_up_down(pin, pigpio.PUD_DOWN)”
This didn’t make any difference to the readings.
They still match the reading on my Utility meter perfectly.

I also have 2 watt hour meters in my distribution board one is for RCD and one non RCD. The pi has been measuring these for years and the added results matched the old analogue utility meter perfectly.

In conclusion after 175 units since they installed this new smart meter both readings seem perfect.
Thank you for your help