Pulse counting is available on the following DM devices:
"Optimised" Pulse Counting: Eagle, Falcon*, SensorData LoRaWAN, SensorNode LoRaWAN
Non-Optimised Pulse Counting: Dart2, G62, G120
*Only available on hardware revisions 74.3 and 74.4
TABLE OF CONTENTS
- Optimised Pulse Counting on the Eagle and Falcon (Cellular Devices)
- Rising Edge Counts
- Example Cellular Device Payload
- Pulse Counting on the SensorData and SensorNode LoRaWAN®
- "Non-Optimised" Pulse Counting on the Dart2, G62 and G120
Optimised Pulse Counting on the Eagle and Falcon (Cellular Devices)
The pulse count is designed for low power, and applications such as monitoring rain gauges. As such, pulses much faster than 1Hz, with very short pulse widths (<100ms), may not be able to be detected reliably. However using a shorter debounce time can allow for faster pulses to be counted. So keep this rough limit in mind, and test prior to deployment if you expect fast pulses.
Analogues 1 to 10 are 16 bit), so the count can range from -32,768 to +32,767
Analogues 11 to 20 (32 bit), they range from -2,147,483,648 to +2,147,483,647.
Resets and Count Overruns
Pulse counts are stored in flash memory, so should not be lost should power be lost. They may be reset during a firmware upgrade. If a user wishes to reset the pulse count, this must be handled on the server.
One way to handle resets occurring due to an overrun or FW update, would be to determine if the count goes down from a previous value, ignore any counts from the last value, but start again from the new one. for example, you get 4, 7, 10, 30, 10, 12, ignore the 30 -> 10 difference and start from 10. so it would be 30 + (10-12) = 32
if ( value[n] < value[n-1] )
newValue = value[n-1] + value[n + 1] - value[n];
To set up a Digital input to measure pulses on input 1, you can follow the below parameters
- Set to digital input.
- Logging and Uploads
- In general, Logging and uploads should be disabled to save data on higher frequency pulse sources and accurate timestamps are not required. Heartbeats (see 'Basic Tracking') can be used to periodically upload counts every X minutes/hours.
- Active Level
- The active level will depend on how your application applies to pulse counting. For more information on Active levels, See our article here
- Bias Resistor
- See our Article here
- Debounce Time
- This field is used to determine your debounce time (time input needs to be stable for the pulse to be registered). This is useful for filtering noisy inputs, but also has a direct relation to the shortest pulse widths/highest pulse frequencies that can be measured. If pulses aren't being counted, try lowering this value. If a lot of errant pulses are counted, try increasing it.
- Rising edge Count:
- see next section below.
- Analog Input:
- Chose analogue number to store count in, 1-20. Inputs 11-20 have a higher maximum pulse count due to being 32 bit vs 16 bits for inputs 1-10.
Rising Edge Counts
- Rising Edge Count
- Yes or No
If you want the pulse counter to increase the count on the rising edge which is the first green line, set to yes, if you want the count to increase on the falling edge, set to No.
Example Cellular Device Payload
An example of the pulse count coming through on analogue 17. The count will simply appear in Field ID 6 or 7 (analogue data fields), in the whatever analogue is chosen in parameters:
"6": 9984, // %Battery remaining
"17": 5 //Pulse Count
"FType": 6 // Field ID# - DMT-Data-Fields.pdf
Pulse Counting on the SensorData and SensorNode LoRaWAN®
The same limitations and caveats apply. However configuration is simply slightly different and is covered in the relevant guides:
- SensorNode LoRaWAN® - Configuration and Usage Guide
- SensorData LoRaWAN® - Configuration and Usage Guide
"Non-Optimised" Pulse Counting on the Dart2, G62 and G120
The Dart2, G62 and G120 are primarily vehicle trackers and as such were not designed with pulse-counting as a primary feature/function. So there are caveats to the operation. It may be useful in some applications, and these devices might be desirable for other features meaning they are selected.
Parameter set up is as above for the Eagle and Falcon, with a few caveats:
- The function must be set to Pulse Counter
- The Config parameter sets both the analogue where the count is stored, and the debounce.
- If analogues 1-10 are selected, the debounce time is 10ms
- If analogues 11-20 are used, the debounce time is 20ms
So for all intents and purposes, the "Pulse Count" on these devices is effectively just a fast edge counter, that will not support counting fast pulses reliably. Additionally, the count is not stored in non-volatile memory, and will be lost on a device reset (i.e. parameter change, firmware update, power loss)