First of all, it is my first topic and i want to say hi to you all!! Secondly, i am really a terrible noob and sorry for that :(

I need to make a smart greenhouse project with Arduino Mega 2560, and i found a video to help me with my servomotor(MG996R) which will start working when raindrops module detect rain and 12v DC Fan which will start working when LM35 sensor calculates the weather as hot. However, my third actuator, 5V DC Mini Water Pump, which needs to become turned on when soil humidity sensor measures the soil as dry, is where i am left without an opinion. All the water pumps people use is 12 V, so i dont know which specific components i should use. I researched a bit and found that people use transistors and diodes for it. Which ones should i use and how to make the connections?

I would appreciate if someone helps me what components, specifically, should i buy and how to connect them together with Arduino 2560? It would be great if you can draw it, like with fritzing or something.

Thanks if you read this far :)

closed as too broad by sempaiscuba, MichaelT, VE7JRO, per1234, Juraj Feb 3 at 12:41

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Welcome to arduino.stackexchange.com .

As motor is usually a high current load, controlling a switch to control the motor's power is the solution.

If you are not interested in h/w design just want to use a interface out of box you can use relay module like this relay. For only one load connection will be simple and I don't think Arduino current supply limit will be a problem.

see this answer for example connection using relay. It is almost similar use case I think. Also here is a Fritzing image using the relay in the first link. I have used four 3V battery pack as 12V source. It doesn't have to be battery.

enter image description here

If you like to do from scratch, you can use BJT(Bi polar junction transistor) or MOSFET.

Here is a possible schematic.


simulate this circuit – Schematic created using CircuitLab

Different power supplies are used for Arduino and Motor because recommended voltage range is 7-12V in Vin pin. Different sources, voltage levels like 5V from USB may be used according to your ease.

node b, c and e are base, collector and emitter of the BJT. Diode D1 is called flyback diode.

Let, the current needed for motor IL, motor voltage needed VL, collector current Ic and base current Ib and the resistor between arduino and base Rb. Note that IL = Ic

Operating mode of transistor will be saturation mode. So, the base current (supplied by arduino) will be,

  • Ibe = (current gain at saturation)*Ic

How to find the current gain? Look through the datasheet of transistor for hfe(sat) which is basically Ic/Ib at saturation mode. Some datasheet may use α instead of hfe(sat)

Then find the Vbe(sat) as you will be operating in saturation mode. Find the needed base resistor value Rb,

  • Ib = 5-Vbe/Rb

While designing this you have to be careful about these condition (I am talking about design using BJT)

  • Vce(max)(max) > VL
  • Ice(max) > IL
  • Arduino digital pin max I > Ib

All the devices should have same ground. Be sure to use the diode(D1) mentioned in the design as motor is an inductive load, sudden powering down may create large voltage across motor.

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