Electronic – Push-Button Voltage Spike (not debouncing)

buttonvoltage

I have a circuit which reads push-button presses. If it is pressed, it turns on the door by rotating motor. In this system, safety and stability are keys.

I added r/c filter to debounce button and cables are also shielded. Pull-up resistors also exist but there is a problem which is voltage spike.

Let me explain with some examples, when i run a drill next to cables, it reads randomly button presses or when i shake circuit roughly, it randomly reads button presses.
It happens rarely but the system should be stable and does correctly for a long time such as months, years, so these random presses are not acceptable.

To solve this, I added a relay and connected it to power with a push button. When push button pressed current flows to relay and switch it. I read button presses from relay. It works stable. But I am not sure that i am doing right or whether there is a better way to prevent those spikes.

If there are any other viable solutions to this problem, i would like to appreciate to hear.

(Push button wires are about ~50cm)

Kicad project files
Kicad Project Files

Circuit http://ozmach.com/public/board-v2.zip
1: http://ozmach.com/img/schematic.pngenter image description here

Best Answer

Although determining and eliminating the true cause of the interference (because that's what probably is, since it happens rarely, as you say) should be better for an high reliability system, it could be useful to add also some "strong" software debouncing routine.

If those "spikes" are short in duration, say less than 5-10ms, then design the button-reading routine so that it acknowledges a button-press only if it lasts at least, say, 100ms (if those buttons are meant to be pressed by humans, requiring a 100ms press is not going to degrade the "user interface" perceived responsiveness).

In this way you could get rid of the relays, which are bulky, costly and power-hungry (assuming you need a low-power design).