I designed this circuit to switch on/off 8 solenoid valves for a programmable dancing fountain that I am building. The GPIO is coming from a Raspberry Pi. VCC is coming from a 12V deep cycle car battery. I built and tested this circuit and it is behaving properly on 6 out of 8 mosfets.

control circuit

This is the behavior of the 2 non-functioning mosfets:

  • Solenoid switches on as soon as the battery is attached (bad)
  • Solenoid valve heats up
  • ~7.5V observed on the mosfet gate (should be 0 unless triggered)

Could the 7.5V gate voltage be due to a broken mosfet?

I noticed this behavior after hooking up 2 solenoid valves at once (to different mosfets). I have tested all 6 other mosfets individually and they all work.

If I have broken the mosfets, what steps can I take to protect them in the future?

  • \$\begingroup\$ The top end of R3 should go to VCC, not the drain of the misfit. kevin \$\endgroup\$ Mar 26, 2015 at 2:41
  • 1
    \$\begingroup\$ Not sure what you're seeing but R3 goes from VCC to the collector of the optoisolator \$\endgroup\$
    – Isaac
    Mar 26, 2015 at 3:23
  • \$\begingroup\$ Are the two GNDs totally separate (As they should be)? If so the pull down needs to be attached to the other GND symbol (The - of the battery). I'd also think about an inline fuse. Shorts are going to be dangerous \$\endgroup\$
    – Dan
    Mar 26, 2015 at 5:18
  • \$\begingroup\$ Yup looks like I drew them wrong here. The left side of the opto-isolator (the LED) and the raspberry pi share a ground. the right side of the opto-isolator (the transistor) and the mosfet share the battery's ground. \$\endgroup\$
    – Isaac
    Mar 26, 2015 at 5:30
  • \$\begingroup\$ My mistake - the schematic is not drawn well there - in general it is not good to have a 4-way junction - it looked like a crossover to me. Kevin \$\endgroup\$ Mar 27, 2015 at 3:44

2 Answers 2


Often a punch-through failure on the gate due to ESD can cause the gate to fail with some voltage on it leaking through from the body. If this is ESD damage, then handling the FET according to safe ESD practices will prevent future failures.

Keep the FETs in ESD safe packaging until needed. Use a wrist strap that's correctly grounded when handling the FETs. Do assembly on a bench with a grounded ESD mat.

Also, some newer FETs have gates that are only rated to 8V. Make sure your FET gate is rated for 12V operation.

  • \$\begingroup\$ The absolute max gate-source voltage for this FET is +-20V so I think ESD damage is my issue. I'll swap them out while wearing my wrist strap. \$\endgroup\$
    – Isaac
    Mar 26, 2015 at 3:32
  • \$\begingroup\$ Swapped out the misbehaving mosfets (while properly grounded). All good now. \$\endgroup\$
    – Isaac
    Apr 2, 2015 at 1:33

Equally possible is the optocoupler. Try this. With no FET in the circuit, what is the gate voltage when the opto input is zero? If it's not zero, it's the opto.

  • \$\begingroup\$ Not sure about that, the diagram shows a phototransistor type of opto, not a photovoltaic opto. So light acts like base current, turning the transistor on. No way for the opto to generate more than Vcc for the gate unless the diagram is wrong and it's actually photovoltaic. \$\endgroup\$
    – John D
    Mar 26, 2015 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.