I'm busy settings up a simple pulsecounter with ESP Easy to measure my energy consumption on an analog Energy meter. I'm upgrading from a home made arduino project to do the same, since I love the WiFi functionality of the esp8266.
I'm using the following software/hardware:
- ESP-01
- tcrt5000 sensor with breakout board on GPIO2 like the one used on the wiki: http://www.esp8266.nu/index.php/PulsCounter
- temporary USB to TTL unit to supply the circuit with stable 3.3V (will be removed as soon as everything is working).
- ESPEasy_R78
The problem is that pulses are counted multiple times after the "black" mark on the analog energy meter wheel has passed. I suspected that the interrupt would be FALLING or RISING, since it's most convenient for most applications. However, it seems that ESPEasy is counting both FALLING and RISING. I've checked the sourcecode, and noticed however that the Interrups are programmed as FALLING (e.g.
Code: Select all
attachInterrupt(Par1, Plugin_003_pulse_interrupt6, FALLING);
A simple solution would be to set a delay in the espeasy software, but the problem with that delay is that the delay must be long enough to not double count pulses on low current consumption, but short enough to not miss any pulses on high current consumption. It's really not convenient, since I am unable to find the sweetspot to measure all my current use (e.g. if I set the delay such that low current pulses are not double counted, it will miss pulses at high current consumption).
Would it help to use a pull up resistor between GPIO2 and VCC...or is it some kind of bug? Thanks already!!