> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/qtech/datscan-and-data-loggers/q48-cellular-remote-data-logger/debounce.md).

# Set the debounce time

Choose and set the input debounce time for PIR sensors or door switches.

Debouncing is used to avoid switch chatter or doors not closing fully and subject to movement in windy conditions. Debouncing is also used to avoid overcounting the number of people using the door.

{% hint style="info" %}
**Applies to:** Q48 Cellular Remote Data Logger (PD8600). The debounce command was added in user guide v3.0 (July 2019), which supports firmware V1.08.
{% endhint %}

## How it works

Debouncing means the signal will be detected on the first (edge) transition then the new state (level) will be sampled again at the end of the debounce time and this state will be used. Debouncing applies to all inputs.

## Choose a time

| Input                             | Debounce time                                                                                                                                       |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Door reed switch                  | A debounce time of 1s is usually sufficient                                                                                                         |
| Door reed switch in a windy place | A debounce time of 3-5s is recommended                                                                                                              |
| PIR sensor                        | 500ms-1s is normally sufficient but should be adjusted if "overcounting" is experienced. Long debounce times (greater than 2s) are not recommended. |

The PIR pulse generated when a person is detected is re-triggerable but can last only a second or two. With long debounce times (greater than 2s) there is a risk of not detecting the door open event and thus not counting it. Set the debounce time larger if too many records are being produced and smaller if too few records are being produced.

The debounce time can also be used to minimise the effects of lots of foot traffic near a door but not actually passing through it.

## Set it

Text `<PIN> Debounce <time>`, with the time in milliseconds. For example, `<PIN> Debounce 5000` sets 5 seconds.

* The range is 10-10,000 ms. Values less than 10 or greater than 10,000 as the debounce time will use 10 and 10,000 respectively.
* If the debounce message is sent without a value the command is ignored.

Use `Request config` to get the current debounce setting. The reply shows it as **Debounce**.

{% hint style="warning" %}
**After firmware upgrade the debounce time must be explicitly set using the SMS message, irrespective of door reed or PIR sensor use.** Verify after power up or remote reboot or after firmware upgrade that the debounce time has been set. It defaults to 10s which is too long for most systems. Use `Request config` to get the current debounce setting.
{% endhint %}
