Hi everyone,
I use a TCRT5000 to read the IR-diode from my EMH power meter. The manual of the power meter says, every light impulse is 2 ms and 10000 Imp/kWh.
So I installed the TCRT5000 in front of the IR diode. With help of the poti and the onboard output-LED I was able to change the sensitivity of the reading-diode to the correct level. The output LED on the board blinks regularly, depending on my energy consumption.
Somehow, not every impulse from the TCRT5000 gets to my ESP8266. I double-checked it with an additional LED that is connected to the ESP and the logs. Just 1 of 3 or 1 of 5 impulses of the TCRT5000 is registered by the ESP on no regular basis.
A pullup resistance is not necessary because the TCRT has one integrated.
On the same ESP I use almost the same code to read a gas meter with a reed switch. I filter this input with a delay of 10 ms. Deactivation of the filter did not change a thing.
Has anyone an idea why the ESP8266 does not see every output but some? Are 2ms too short? Is the mistake that I count the gas meter’s pulses on the same ESP?
So to be clear: the output LED on the board blinks in sync with the pulses generated by your smart meter, it’s just that the ESP isn’t counting all of the pulses?
Have you considered using a pulse counter instead? It seems to fit your setup better.
I tried the pulse counter and pulse meter on my gas meter project and had some issues. So I came back to the binary sensor.
On this setup I haven’t used pulse counter nor pulse meter.
Today I have received new TCRT5000. Unfortunately it didn’t help, my problem continues.
I tested a new thing: When I change the potentiometer on the TCRT5000 to “very sensitive”, the ESP sees the high-signal. On “not sensitive” the ESP sees the low-signal.
What does this mean? It means, that the wiring, TCRT5000 and ESP are ok.
Could it be, that 2 ms high-signal are simply too short for either TCRT5000 or ESP? Is there a way to make the high-signal “longer”? I’m not too familiar with MCs…
Again, I would suggest trying to get the pulse counter or meter to work. Given that its internal filter is configured by default to ignore pulses shorter than 13us, a 2ms pulse width doesn’t sound like it should be a problem.
Hi Robert, thank you for your help. Problem solved. I tried the pulse meter and it works! Sadly I have no idea what went wrong, because my gas meter works better with binary sensor config.