0
\$\begingroup\$

I am implementing a system using an ATmega 16, a 12V/ 0.4mA/4.8W DC water pump, a 2N2222a transistor, a 1N4001 diode, a resistor and, a 12V Power Supply. However, whenever I test the circuit with the code I wrote, the pump does not turn on but when I connect it directly to the 12 V DC, it works. Can you help me figure out why the pump is not turning on when I connect it to my microcontroller circuit?

Here is a picture of how my circuit is connected:enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Also, I may have used the wrong resistor value.... please help \$\endgroup\$ Commented May 11, 2023 at 0:44
  • \$\begingroup\$ 0.4 mA? really? \$\endgroup\$
    – Hearth
    Commented May 11, 2023 at 0:46

2 Answers 2

6
\$\begingroup\$

First, the transistor you have chosen may not be adequate for the job. You state that the water pump motor is rated 4.8 W and 12 V. This implies a rated current of 400 mA, not 0.4 mA. Now the 2N2222A has an absolute maximum Ic of 800 mA. This may not be adequate because when the motor starts, it may draw multiple times its rated current. Say, for the sake of argument 5 times. This would mean it could draw 2A when the shaft is not in motion. This could result in the 2N2222A exceeding its absolute limit. It may, at that point, be junk.

Leaving that aside, the base resistor is too large. That is the primary reason why:

the pump does not turn on but when I connect it directly to the 12 V DC, it works.

In worst case, the current gain for an 2N2222A might be 30. To get 400 mA Ic, might require 13.3 mA base current. You might be lucky and get by with less, but you shouldn't rely on that.

If the microprocessor outputs, say 4.2 V minimum when high, and the base of the transistor needs to be say 0.8V worst case to drive Ic to 400 mA, you have 4.2-0.8 = 3.4 volts to give you 13.3 mA. This gives a maximum base resistance value of 255 \$\Omega\$ to make everything work in worst case. Choose a 220 \$\Omega\$ resistor. In worst case, if the microprocessor outputs 5 V, and the resistor is grounded, 23 mA will flow. The ATMega should survive that.

You might be able to solve both problems (the transistor being too "small" and the resistor being to large) by substituting a logic level MOSFET for the 2N2222A. The gate current of a MOSFET is negligible except when the MOSFET is being turned on, or being turned off. A large gate resistor will slow down turning on and off. So, it might still be advantageous to use a 220 \$\Omega\$ gate resistor. Although the pump probably doesn't care how fast the MOSFET turns on, the MOSFET will generate more heat the slower it switches. Heat is the enemy of most electronic components. So, to preserve the lifespan of your MOSFET, it is better to use a smaller gate resistor.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you so much for your help!! \$\endgroup\$ Commented May 20, 2023 at 23:13
3
\$\begingroup\$

Reduce base resistance from 10kΩ to 470Ω. 10kΩ is too high to produce sufficient base current for 400mA collector current through the motor.

Also, as explained here, the 2N2222 pin configuration is ambiguous, and it's possible you have unknowingly swapped collector and emitter. That won't damage the transistor, but you might have to correct this, for it to work.

\$\endgroup\$

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