Dear Friends:

I have a problem with the Z axis limit switch. Sometimes the limit switch input activates itself. But the worst thing that in other 2 occasions has been generated an overvoltage that has burned the input of the breakout board because of the Spindle. For this I designed an additional circuit with optocouplers in order to protect this input. For this, it requires incorporating a 0.1uF ceramic capacitor to see if this can attenuate these voltage surges as explained in the attached image. The circuit usually works quite well. The problem that when incorporating the capacitor and activating the limit switch, the system does not activate. However, when the capacitor is removed, the circuit is activated normally. Is it possible that the capacitor is wrongly connected or some other component is missing in the circuit? I am not an expert in electronics and it is likely that I am making some basic error in this. For this reason, I ask for your help. I have also incorporated shielded cable in the spindle and in the limit switch of the z axis to solve this problema.

Best regards