solenoid valve causing microcontroller reset
I'm useing AN2131QC ( 8051 base USB Microcontroller from Cypress) in a circuit that turns ON/OFF a solenoid valve. The valve coil works with 24V AC. I use a relay between the microcontroller and the solenoid valve. Eventually, when the valve switches, the microcontrollers resets.I am isulate micro from relay with optocupller pc123 and place capecitor with R in series across the solenoid valve load and it work better but after 10 min reset the micro again.
Coud you help me solve this problem?
Thanks alot