Pulse generator

You may use this generator to wake up an Atmega-based external sensor. The external sensor should measure the value and output it to a UART port.

Pulse counter

It is a 32 bit counter with a configurable debounce interval. Therefore the counter cannot be used for high-frequency signals.

If the “Interval” parameter is defined, the counter automatically resets after that interval and reports the counted values to a coordinator. If this parameter is zero, the counter increments indefinitely, and the firmware periodically reports a counter’s value.

Configuration example

The counter in the power saving mode (PSM)

The counter uses a hardware interrupt for a rising edge for a configured input. The chip wakes up with every interrupt and stays alive for three seconds. If incoming impulses are too frequent, the chip will never sleep and consume battery power. It is OK if you count a series of impulses for a short time interval.

Please, consider using a special external counter in this mode.

Zigbee2MQTT commands

read - immediately reads the counter value.
Topic: zigbee2mqtt/[friedly_name]/get/[channel]
Channel: l1, l2, l3 … l16
Payload: 1
Returns: The counter value {"[channel]": float_value}
write - resets the counter, or sets any initial value.
Topic: zigbee2mqtt/[friedly_name]/set
Payload: {"[channel]": value}
Channel: l1, l2, l3 … l16
Value: any positive number

Comments
Harvey Specter
Posted at 14:51 November 23, 2021
kds
Reply
Author

Hi,
For counters, could you please elaborate a bit more on how debounce interval works?
Is it a low-pass or high-pass software filtering? = how long or how short the signal must be maintained.

    Harvey Specter
    Posted at 13:49 November 24, 2021
    Owner
    Reply
    Author

    The debounce filter is used to exclude noise on an input. It is a low-pass filter.

Harvey Specter
Posted at 18:28 October 24, 2021
Tim
Reply
Author

Hi !

I’m a bit confused by the screenshot above.
Why do you set-up the counters as output ? I would think it should be inputs ?

Other question: Is there a way to configure the value of each pulse ?

    Harvey Specter
    Posted at 03:29 October 25, 2021
    Owner
    Reply
    Author

    Hi! Please, ignore the place where you define a sensor or function. It is mainly related to GPIO.

Harvey Specter
Posted at 04:47 October 15, 2021
kds
Reply
Author

Hi,
Is there a way to connect to optical pulse sensor ?
For energy metering of course

    Harvey Specter
    Posted at 04:58 October 15, 2021
    Owner
    Reply
    Author

    No problems, but you cannot make it with a battery-powered Zigbee device.

Harvey Specter
Posted at 19:34 June 15, 2021
Felix Göhringer
Reply
Author

I want to monitor RPM on a motor with max 3000 RPM and 3 pulse per RPM. So max 9000 pulse per second.
Would this work with a PCF8583?

    Harvey Specter
    Posted at 03:40 June 16, 2021
    Owner
    Reply
    Author

    No, it will not work. You need a specialized counter or device for RPM measuring.

Harvey Specter
Posted at 18:18 June 1, 2021
Nobodyman
Reply
Author

Ok, I will try it.
What kind of CC2530 module do you prefer? I need one to operate at 3V battery power.

    Harvey Specter
    Posted at 03:30 June 2, 2021
    Owner
    Reply
    Author

    I use E18 MS1 modules from Ebyte.

Harvey Specter
Posted at 15:22 May 30, 2021
Nobodyman
Reply
Author

Is there any plan to support it? Or is it possible to implement it myself? I think this could be a simple solution to count pulses from gas meters and publish them to zigbee.

Harvey Specter
Posted at 08:56 May 30, 2021
Nobodyman
Reply
Author

Is it possible to use the DS1682?

    Harvey Specter
    Posted at 09:13 May 30, 2021
    Owner
    Reply
    Author

    The firmware does not support it.

Harvey Specter
Posted at 21:58 March 26, 2021
Damian
Reply
Author

It is possible to disable 3 seconds alive time in PSM mode after receiving impulse? I want to build battery powered pulse counter with impulse frequency about 1 impulse per 1-2 seconds.

    Harvey Specter
    Posted at 05:39 March 27, 2021
    Owner
    Reply
    Author

    No, it is not possible. Therefore my firmware is not acceptable for fast counters without an external hardware counter like pcf8583.

      Harvey Specter
      Posted at 17:53 March 27, 2021
      Damian
      Reply
      Author

      OK, thanks for suggestion, I can go that way, but I see pcf8583 is not supported by your generator, and it needs to by initialized to act as counter. Can I find an example for using custom i2c device with your firmware?

        Harvey Specter
        Posted at 11:11 March 28, 2021
        Owner
        Reply
        Author

        I’ll add it in the next version.

Leave a Reply