Here is part of the schematic diagram for the emonPi2
emonLibDB was written for the AVR128DB processor.
Because it uses the same physical input, disabling it will just remove the rather meaningless analogue measurement of your pulse from the output data.
You need to check the sketch for the pulse settings, I had to change the way the pulse is detected because the ‘old’ method was unreliable.
Here’s a clip from the emonLibDB documentation for the pulse and analogue inputs:
void EmonLibDB_setPulseMinPeriod(uint16_t _period)
void EmonLibDB_setPulseMinPeriod(uint8_t channel, uint16_t _period, [uint8_t
_edge=FALLING])
Sets the minimum period of time that the pulse must be active and in a steady state to be
recognised, in ms. This must be shorter than the duration of the pulse. (Note: this differs
from the definition in previous releases, and if the period is specified, its value should be
reviewed.) For electronic switches that do not exhibit contact bounce, zero may be used.
The channel number (one-based) defines the input to be used, and must be specified if
edge is specified. Input channels for the emonTx V4 are: 1 – ‘Pulse’, 2 – ‘Digital’, 3 –
‘Analog-Input’ – alternatively the names ‘Pulse’, Dig’ & ‘ADC’ may be used. The
appropriate solder links must be made on the p.c.b, and the ‘Analog-Input’ pulse input is
not available when the extender p.c.b. (c.t’s 7 – 12) is fitted. The edge on which the pulse
is detected may be specified if required (RISING or FALLING). Default: period = 20.
void EmonLibDB_setPulseEnable([uint8_t channel,] bool _enable)
Enables pulse counting. Pulse counting is initialised when the library is initialised, and
thereafter may be turned on or off as required. The change is applied at the next
datalogging. The pulse count is frozen whilst pulse counting is disabled. Input channels for
the emonTx V4 are: 1 – ‘Pulse’, 2 – ‘Digital’, 3 – ‘Analog-Input’ – alternatively the names
‘Pulse’, Dig’ & ‘ADC’ may be used. The appropriate solder links must be made on the
p.c.b, and the ‘Analog-Input’ pulse input is not available when the extender p.c.b. (c.t’s 7 –
12) is fitted. Defaults: ‘Pulse’ input, enable = false, edge=FALLING.
void EmonLibDB_setPulseCount([uint8_t channel,] uint32_t _pulseCount)
Initialises the pulse count. This will normally be used at start-up to restore a value saved
prior to a supply interruption or reset; although it may be used to synchronise the value
with another meter. Input channels for the emonTx V4 are: 1 – ‘Pulse’, 2 – ‘Digital’, 3 –
‘Analog-Input’ – alternatively the names ‘Pulse’, Dig’ & ‘ADC’ may be used. The
appropriate solder links must be made on the p.c.b, and the Analog input is not available
as a pulse input when the extender board (c.t’s 7 – 12) is fitted. The previous value is
overwritten. Default: 0.
void EmonLibDB_setAnalogueEnable(bool _enable)
Enables the (d.c.) analogue input. The analogue input uses the same multiplexer channel
as CT12, therefore it must not be enabled when the Expansion Board for CTs 7 – 12 is
fitted. The analogue input may only be used when when the Expansion Board is not fitted.
The voltage applied to the input connector should be within the range 0 – 1.024 V.
Damage is likely if it is allowed to go outside the range -0.3 – +3.6 V. Default: false.
Now looking at Trystan’s sketch for the emonPi2, he has got
int pulse_period = 100;
So there is your answer - your 80 ms pulse is not long enough and it’s rejected. You need to set the minimum pulse period to (probably) the library’s default of 20 ms, certainly less than your 80 ms pulse. You could even make it zero.
Quite why he has made it so long, when many electronic meters have a 100 ms pulse, is beyond me. I wrote this as clearly as I could:
“Sets the minimum period of time that the pulse must be active and in a steady state to be
recognised, in ms. This must be shorter than the duration of the pulse” and it even says “For electronic switches that do not exhibit contact bounce, zero may be used.”