RP Pi input interference / minimal push time of button

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 :wink:

cheers, Rogier

[{"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"]]}]

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