# RP Pi input interference / minimal push time of button

**URL:** https://discourse.nodered.org/t/rp-pi-input-interference-minimal-push-time-of-button/11910
**Category:** General
**Created:** [6 June 2019 12:13 UTC](https://discourse.nodered.org/t/rp-pi-input-interference-minimal-push-time-of-button/11910 "2019-06-06T12:13:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)
#### Post date: [6 June 2019 12:13 UTC](https://discourse.nodered.org/t/rp-pi-input-interference-minimal-push-time-of-button/11910/1 "2019-06-06T12:13:25Z")

</div>

Hi!

I have a challange with a raspberry input pin.  
Because of some interference the input sometimes jumps up and down.  
So i tried a 10nF and all other stuff but without succes.  
So the idea came up to create a check if the button is pressed for more then 1 second ( example time )  
To do this i created the following below.  
All comments idea's and other things are welcome and maybe i can help some one with it 😉

cheers, Rogier

```auto
[{"id":"1fe56d11.6af823","type":"rpi-gpio in","z":"6757f875.ed348","name":"","pin":"10","intype":"down","debounce":"25","read":false,"x":220,"y":1200,"wires":[["57c9d010.857ae8","29785741.882f1"]]},{"id":"57c9d010.857ae8","type":"function","z":"6757f875.ed348","name":"estop1 0","func":"var i = msg.payload;\nflow.set(\"estopx\", i );\n\nif ( i == 1 ){\n msg.payload = i\n return msg;\n\n} else {\n msg.reset = 9;\n return msg;\n}","outputs":1,"noerr":0,"x":400,"y":1200,"wires":[["14bfa6ae.fa4f19"]]},{"id":"14bfa6ae.fa4f19","type":"trigger","z":"6757f875.ed348","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"1500","extend":false,"units":"ms","reset":"9","bytopic":"all","name":"","x":600,"y":1200,"wires":[["6eb1a605.4bceb8"]]},{"id":"7aa80d80.739a54","type":"trigger","z":"6757f875.ed348","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"1500","extend":false,"units":"ms","reset":"9","bytopic":"all","name":"","x":600,"y":1260,"wires":[["6eb1a605.4bceb8"]]},{"id":"29785741.882f1","type":"function","z":"6757f875.ed348","name":"estop1 1","func":"var i = msg.payload;\nflow.set(\"estopx\", i );\n\nif ( i == 0 ){\n msg.payload = i\n return msg;\n\n} else {\n msg.reset = 9;\n return msg;\n}","outputs":1,"noerr":0,"x":400,"y":1260,"wires":[["7aa80d80.739a54"]]},{"id":"432edbd5.5f75d4","type":"function","z":"6757f875.ed348","name":"state change","func":"var buttonState = msg.payload;\nvar lastButtonStateEstop1 = flow.get(\"lastButtonStateEstop1\");\n\nif (buttonState != lastButtonStateEstop1) {\n msg.payload = buttonState;\n flow.set(\"lastButtonStateEstop1\",buttonState)\n return msg;\n\n } else {\n return null;\n }","outputs":1,"noerr":0,"x":1010,"y":1220,"wires":[["76b36738.ccda38"]]},{"id":"76b36738.ccda38","type":"debug","z":"6757f875.ed348","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1210,"y":1220,"wires":[]},{"id":"6eb1a605.4bceb8","type":"function","z":"6757f875.ed348","name":"","func":"var i = msg.payload;\nvar m = flow.get(\"estopx\");\n\nif ( i == m ){\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"x":810,"y":1220,"wires":[["432edbd5.5f75d4"]]}]

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 June 2019 12:37 UTC](https://discourse.nodered.org/t/rp-pi-input-interference-minimal-push-time-of-button/11910/2 "2019-06-06T12:37:29Z")

</div>

node-red-contrib-debounce should do what you want I think.
