I'm looking to do 2 projects that sense solenoid valves in a separate system, specifically 12v automotive shift solenoids & fuel injectors. They are low-side switched with mosfets or transistors. The big problem is the inductive spike when they turn off & I'm not sure what hardware to use.
A primary requirement is I can only tap into the solenoid power wires. I can't tap into the logic level nor can I use anything that senses the magnetic field; CAN-Bus data isn't present. For one project the frequency is sub-Hz so I can use simple signal relays in parallel. The other will be as high as 7000 Hz (batch-fire EFI) or 8.5 milliseconds, so I'm thinking optocouplers?
I'm just not sure how I would protect it properly from the inductive spike, aside from a flyback diode on the solenoid. For the circuit I'd imagine the optocoupler could be used similar to this: