I'd like to read from a relay on a CNC machine with a microcontroller running at 3.3V, the wire will be 1-1.5m twisted pair from the micro to the relay and screwed in to a terminal.
There's a lot of noise in these machines as there's 3 phase servo drivers and lots of other stuff going on.
I'd like to ideally just be able to read a rising or falling edge to count the number of times the relay activates.
Having read around the subject:
Trying to keep it simple (No mosfets) I think there's reasonable noise suppression in this design. Since most of the time the Normally Closed(NC) switch will leave the input pin HIGH I think this is fairly robust. I'm wondering if you could help with the following questions please:
A) If I need a series inductor to deal with larger current spikes?
B) I won't be installing this unfortunately, and I can't guarantee someone won't short the GND (V+ should be OK since there's a current limiting resistor) to a positive voltage somewhere, or cause some kind of Electro-Static Discharge (ESD). I'm wondering if maybe a Resettable Fuse (PTC) in series with the GND return would be sensible? Or maybe a TVS to V+?
Relay:
Circuit Design:
Thanks in advance!