I've connected an Arduino to a MOSFET to control a valve.

I've connected the Arduino's GND to the negative lane (word?) on the breadboard (for clarity modeled by SW1 in the circuit diagram). I noticed that if I don't do this, it does not work (no voltage at the gate) - why do I need to use the same ground?

And: Is my circuit any good or could it be damaging my Arduino?

See sketch here


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ I tidied your circuit diagram a bit so it is easier to read. I attempted to make it identical to the Fritzing image. I modeled the GND connection between Arduino and breadboard by SW1 as this is the main topic of your question. electronics.stackexchange.com/questions/28251/… \$\endgroup\$
    – jippie
    Commented Apr 3, 2013 at 15:57

2 Answers 2


Voltage is a potential relative to a point. In electronics, most of the time that point is circuit common, or ground. When the grounds aren't shared, there is no reference, so the 5V coming from the Arduino is meaningless.

Another thing, put the common lead of the power supply as close as possible to MOSFET return path, ideally in the pin next to it. That will keep the return current off your ground bus, and that is known to make microcontrollers behave in undesirable ways. It may not be a problem for this circuit since its only 120mA, but it's a good habit.

  • \$\begingroup\$ Thank you! So the rule is: always use one common ground? (for basic stuff like this, anyway - I suppose the more I understand the clearer this will become) Also, the thing about the positioning the lead next to the mosfet, is this in any way related to the diode that Botnic would place to the valve? (return current vs voltage peaks?) \$\endgroup\$
    – PhilW
    Commented Apr 3, 2013 at 16:22
  • 1
    \$\begingroup\$ You always need to have a common ground, regardless. More complex circuits may be a power, analog, and digital ground. The grounds are separated for noise immunity, but they are tied back together at the power supply. That is where the lead position comes in. The flyback suppression diode is always a good idea, however, Botnic's schematic has the diode backwards. \$\endgroup\$
    – Matt Young
    Commented Apr 3, 2013 at 16:56

It seams strange to me to connect the Gate to a constant 5V pin. Shoudn't this be on a IO-pin?

I would add a diode to the valve in order to prevent voltage peaks when turning the FET off. enter image description here

  • \$\begingroup\$ Sorry if this was not clear - yes, it's a digital output pin that supplies 5V (HIGH). Thanks for the diode idea! I've only read about it but wasn't able to put it to use so far. \$\endgroup\$
    – PhilW
    Commented Apr 3, 2013 at 16:18
  • 2
    \$\begingroup\$ That diode is shorting the valve. Don't do that. \$\endgroup\$
    – Matt Young
    Commented Apr 3, 2013 at 16:55
  • 1
    \$\begingroup\$ Oh yes your right, I correct that. Ok now the Diode is in the right direction. \$\endgroup\$
    – Botnic
    Commented Apr 4, 2013 at 6:36
  • \$\begingroup\$ While this is a useful note, it does not answer the question. You should've commented instead. \$\endgroup\$
    – user17592
    Commented Apr 4, 2013 at 6:46

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