# Controlling 12V 2A Max DC Water Pump With Arduino Uno

**URL:** <https://forum.arduino.cc/t/controlling-12v-2a-max-dc-water-pump-with-arduino-uno/1083240>\
**Category:** General Guidance\
**Created:** [January 28, 2023, 5:02am UTC](https://forum.arduino.cc/t/controlling-12v-2a-max-dc-water-pump-with-arduino-uno/1083240 "2023-01-28T05:02:15Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![PerryBebbington](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/perrybebbington/32/238766_2.png) [@PerryBebbington](https://forum.arduino.cc/u/PerryBebbington)\
**Post date:** [January 29, 2023, 10:12am UTC](https://forum.arduino.cc/t/controlling-12v-2a-max-dc-water-pump-with-arduino-uno/1083240/17 "2023-01-29T10:12:43Z")

</div>

Ok, I like that you are thinking about this, well done for that.

> [@beginnersluckk](#):
>
> Ohhh okay... I thought it would protect the digital pin from voltage spikes

Read this: [Flyback diodes and why you need them](https://forum.arduino.cc/t/flyback-diodes-and-why-you-need-them/675409)  
The diode gets rid of the spikes. Also, in a MOSFET the gate is isolated from the source - drain anyway, so there is little or no opportunity for noise to get to the micro-controller pin in normal operation. You are trying to fix a non-problem.

Your new schematic with the 2N2222 is no good because you don't have the diode across the motor and the maximum current for a 2N2222 is 600mA, well below the 2A you want.

> [@beginnersluckk](#):
>
> If i use the ground (Number 2 optocoupler) at another ground pin at arduino, would that help?

No, they are all the same and there is no help to be had because it's an attempt to fix a problem that does not exist.

> [@beginnersluckk](#):
>
> From my understanding if we use 12V for the gate of the IRLZ34 the voltage would need to go back to about 2 Volt to turn off the transistor. So its faster for IRFZ34 to turn off the transistor since it only needs to go down to 5 volt.

I've not watched the video, from your description I'm not sure I want to. The gate of a MOSFET is a small capacitor. Capacitors in series with resistors charge and discharge according to some maths I have forgotten (some homework for you, find the equation), however I can remember 2 important things: Rule of thumb is it takes 5RC seconds to (dis)charge a capacitor through a resistor. This is not strictly true but it's close enough for most practical purposes. So look at the gate capacitance from the data sheet and the resistance used for charging it and do the maths. The other thing is that current, voltage, time and capacitance are related by 1. What I mean is that if you (dis)charge a 1F capacitor with 1A for 1 second then the voltage across it will change by 1V. Note I said 1A, not a particular value of resistor, I mean a 1A constant current source, which you don't get with a resistor.

> [@beginnersluckk](#):
>
> I think i will stick to my design from before.

If you mean the schematic in reply #9 then yes, do that.  
However, if you want to learn there's no harm in building the other circuits to experiment and compare them, if you are interested. An oscilloscope would help a lot.

---

_[View the full topic](https://forum.arduino.cc/t/controlling-12v-2a-max-dc-water-pump-with-arduino-uno/1083240)._
