I know this question was asked before, But couldn't understand properly the datasheet reading.

I would like to control water pump via RPI.

Wanted to make sure Im reading the datasheet correctly + Im connecting everything properly.

enter image description here

So if I understand correctly, on the worst case, the water pump will need 6v. so the calculations will be according to Ipump(max)

Ipump(max) = 1.8w/6v = 300mA
Ipump(min) = 0.6w/4v = 150mA

According to 2N2222 data sheet, figure 11:

enter image description here

When Ic=300mA, Vbe(sat)=0.9v and hfe=10.


Ib = Ic/hfe -> 300m/10 = 30mA
R1 = (Vrpi - Vbe)/Ib -> (3.3-0.9)/30m = 80ohm

In order to make sure the water pump will get the current it needs, we will limit Ic to higher value:

Ib=(3.3-0.9)/50= 48mA
Ic=Ib*hfe= 48m*10 = 480mA

So R1=50ohm

Wanted to ask :

1. Do I read the `hfe` correctly? is it the right value to make sure the saturation?
2. There is a need to connect a diode in parallel to the water pump? resistor in series to the water pump?

Thanks for the guidance.

  • 3
    \$\begingroup\$ Problem is, Raspberry Pi can only source 16mA from its GPIOs. You won't be able to properly bias the transistor with a direct connection. A logic-level MOSFET would be a better choice than a 2N2222 - the VN2222 at 3.3V can pass more than 1A (be careful of power dissipation, though) \$\endgroup\$ – Adam Lawrence Nov 24 '20 at 20:05
  • 1
    \$\begingroup\$ To your other points, your maths seem OK. And yes, any sort of switched inductive load generally needs a clamp diode to protect against inductive kickback when the switch opens. \$\endgroup\$ – Adam Lawrence Nov 24 '20 at 20:09
  • 1
    \$\begingroup\$ In my opinion you're "pushing" things to their limits a bit too much, the assumed hfe = 10 is quite low resulting in that you need a lot of base current. Actually more than an Rpi should be delivering. It can be done I guess if you limit the current from the Rpi to about 10 mA so then hfe = Ic/Ib would be 30 (=300 mA / 10 mA) and getting a bit close to the lower limit of the NPN's own hfe. I agree with Adam that an NMOS would be a much better choice. I would use an AO3400 they're cheap and have a very low on resistance. They're small though, SMD only. \$\endgroup\$ – Bimpelrekkie Nov 24 '20 at 20:39
  • 2
    \$\begingroup\$ The peak current for a pump may be considerably higher than the average current, both during starting and due to torque changes during motor rotation. That could result in the motor stalling with a large voltage across the transistor, which would subsequently suffer damage. Unless you want to measure the actual start/peak run currents I would suggest allowing for a few A, with a logic-level MOSFET such as AO3400A. You should also put a flyback diode across the motor. \$\endgroup\$ – Spehro Pefhany Nov 24 '20 at 20:39
  • 1
    \$\begingroup\$ @Bimpelrekkie Good suggestion. lol \$\endgroup\$ – Spehro Pefhany Nov 24 '20 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.