I'm trying to drive an 220 V solenoid water valve with a relay, but I'm having problems: when I turn off the solenoid, the microcontroller reboots.
I believe the source of the problem is the spike voltage generated by the solenoid switching off (an inductive load).
So I read some similar post in the internet, and they said I needed an RC snubber circuit.
So now I want to now how to size the resistor and the capacitor to make the filter.
The valve works with 220 VAC and I don't switch it frequently (typically once every several minutes, but I'd like to protect against 2 or 3 switches per second for a few seconds too). I don't know the valve inductance; it seems a necessary value to size the snubber, but I don't know.
Secondary question: do I need this filter in parallel with the valve or in parallel with the switch? I have read some conflicting information about this.
Can someone explain how can I size the filter? If you need some value I didn't tell (for example the inductance) you can leave it as a variable or guess it if it's easy to guess.
Also, other solutions for the problem are welcome.