# Automation HAT debounce

**URL:** <https://forums.pimoroni.com/t/automation-hat-debounce/8725>\
**Category:** Support\
**Created:** [September 19, 2018, 3:44am UTC](https://forums.pimoroni.com/t/automation-hat-debounce/8725 "2018-09-19T03:44:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![twoerner](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/twoerner/32/4597_2.png) [@twoerner](https://forums.pimoroni.com/u/twoerner)\
**Post date:** [September 19, 2018, 3:44am UTC](https://forums.pimoroni.com/t/automation-hat-debounce/8725/1 "2018-09-19T03:44:15Z")

</div>

I’m interested in getting an Automation HAT for an HVAC project. Do I have to be concerned with debounce on the inputs? Or does the HW or SW take care of that for me?

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [October 8, 2018, 9:46am UTC](https://forums.pimoroni.com/t/automation-hat-debounce/8725/2 "2018-10-08T09:46:38Z")

</div>

There’s no built-in hardware or software debouncing, but you could probably tackle it in software alone depending upon your signal. Generally it’s better to strip away the library and use straight RPi.GPIO (or your GPIO access library of choice) for this, though.

---

<div class="post-metadata">

**Author:** ![pi\_dummy](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@pi\_dummy](https://forums.pimoroni.com/u/pi_dummy)\
**Post date:** [December 24, 2019, 5:07am UTC](https://forums.pimoroni.com/t/automation-hat-debounce/8725/3 "2019-12-24T05:07:18Z")

</div>

I don’t know if this is called debounce, but I do have ghost input. Meaning no one pressed the ring/doorbell button, but the Xmas music started on it’s own.

I would need to make sure I have a firm human press on the button and not the wind or some electromagnetic effect.

We have just been woken up in the middle of the night by Mariah Carey. Any hint?

---

<div class="post-metadata">

**Author:** ![pi\_dummy](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@pi\_dummy](https://forums.pimoroni.com/u/pi_dummy)\
**Post date:** [December 24, 2019, 9:43am UTC](https://forums.pimoroni.com/t/automation-hat-debounce/8725/4 "2019-12-24T09:43:48Z")

</div>

I solved my problem by double checking that there was something on that input:

> <https://gist.github.com/dglaude/7ac54e7a198c2a869879c8b016703431>

Here is my code. It is working in my test, but I don’t know the nature of my “interference” and how long they do last.

```
while True:
    if automationhat.input.one.is_on():
        print('Is this a ghost event???')
        time.sleep(0.1)
        if automationhat.input.one.is_on():
            print(' Someone has his finger on it.')
```
