Electronic – Solenoid Valve blowing power LED – how can i protect the LED

12vprotectionsolenoid-valve

I have this simple circuit setup and working well to turn a solenoid valve on (close it) and off (open it again) for a watering system I use.

missing is an on/off switch before the VCC. However, I have an LED connected to indicate when I have my switch on (system ready/on). If I leave the relay in the "ON" position (so the solenoid is powered), switch the system off, then back on again (powering the solenoid on, because the relay is latching and left in the on position), sometimes the LED blows (i.e. stops working and i have to replace it).

I want the feature of leaving the relay in the on position (why I chose a latching version), but how can I protect the LED from whatever is happening (I assume a negative over voltage is being created by the solenoid??).

circuit example

Best Answer

Connect a reverse biased diode in parallel to the solenoid, like this:

schematic

simulate this circuit – Schematic created using CircuitLab

That will prevent the solenoid from generating voltage spikes when turning off.