1
\$\begingroup\$

I have been trying to power a motor with a 5 V power source using the 3.3 V strength input of a Raspberry Pi. To simulate this temporarily, I am using a breadboard power source that supplies one end of the breadboard with 5 V and the other with 3.3 V. When I run my circuit on Tinkercad, it works.

enter image description here

The real circuit below doesn't work, as the motor doesn't run! The transistor just heats up. The 3.3 V with resistor is correctly supplying voltage to turn on the transistor. The transistor's voltage when on reads 4.7 V, however the motor's voltage only reads 0.5-ish V. The motor works fine when connected directly to the 5 V power source. What's going on?

I have tried rebuilding the same circuit with replaced components but still it does not work. The transistor just gets really, really hot. I have also tried flipping my transistor's collector and emitter the other way in case I had it wrong but this yielded nothing. The transistor is a 2N2222. The power source supplies accurate voltages.

I consulted a family friend electrician about this but he was unable to draw any conclusions (he was on FaceTime so he couldn't mess with it directly). I am very new to electrical engineering, so I was hoping someone on here could help.

enter image description here

Here is the transistor:

enter image description here

\$\endgroup\$
10
  • 1
    \$\begingroup\$ How much current does your motor draw when it is running? When it is stalled? What is the current limit of your transistor? \$\endgroup\$ Jul 20, 2022 at 21:27
  • \$\begingroup\$ Also you have your transistor inserted backwards. Pay attention to which direction the flat side is facing. \$\endgroup\$ Jul 20, 2022 at 21:28
  • \$\begingroup\$ That transistor emitter should go to the common GND. And 5k base resistor (or is it 50k?) is too-large a value for driving a motor - try substituting a few hundred ohms instead. \$\endgroup\$
    – glen_geek
    Jul 20, 2022 at 21:31
  • \$\begingroup\$ why is the resistor for the base too large? I thought the motor power comes from the 5v circuit @glen_geek \$\endgroup\$ Jul 20, 2022 at 23:38
  • \$\begingroup\$ @ElliotAlderson according to the docs my transistor is the correct direction for the 2n2222A \$\endgroup\$ Jul 20, 2022 at 23:38

2 Answers 2

4
\$\begingroup\$

It is important to know motor DC resistance , and transistor resistance when switched on. For if the transistor is higher resistance, all the heat will be dumped into it and no voltage left for the motor.

Ideally, the transistor switch is < 1% of the motor DC R measured with a DMM. The transistor R is computed from the datasheet with known base current and delta V/ Delta I slope. Normal saturation Vce(sat) is done at Ic/Ib=10 which means your base resistance is making the transistor resistance too high.

If Vbe=0.7 and Rb= 1k Ib= 3.3-0.7 = 2.6 mA. Then if hFE = 100 Ic= 260 mA from 5V or 1W. or ~ 25 Ohms. So the base resistance needs to be around 25 Ohms with driver resistance ~ 50 Ohms and Ib= 3.3-0.8/(25+50)= 36 mA which can saturate switch at least 360 mA or perhaps 500 mA. That means the motor DCR must be at least 5V/0.5A = 10 ohms and base resistor around 22 to 25 Ohms

This assumes the connections are corrected. to EBC.

The Rule of thumb is if drive voltage and collector voltage are similar the base R needs to be about 10x R load and when saturated the hFE drops to about10% of it's maximum. This is support by math and general transistor models when Vce < Vce at Ic= high current and why sat is rated for Vce(Sat) at Ic/Ib = 10 or 10% of hFE max in ratios of 10, 20, 50 .

\$\endgroup\$
8
  • \$\begingroup\$ Max permitted source current from RPi GPIO is 16mA (@~2.3V). That equates to a Base resistor value of ~94 ohms. 100 ohms would be close enough. That should keep the 2N2222 in saturation up to ~500mA. I have a similar (identical?) motor with resistance of ~4 ohms. It needed up to 400mA (at ~1.6V) to start spinning with no load. Once running the current dropped back to ~110mA at 5V. \$\endgroup\$ Jul 21, 2022 at 2:14
  • \$\begingroup\$ Bruce that 16m is for logic levels which do not apply here. The 3.3V supply can supply more current with less power loss than 5V. I believe 36 mA or about 65 mW should not pose a problem elinux.org/RPi_Low-level_peripherals#Power_pins \$\endgroup\$ Jul 21, 2022 at 2:49
  • \$\begingroup\$ But we both agree 1k won't work for base drive an 100 ohms is safe but will create a bit more heat in the transistor than 25 ohms as Vce(sat) rises \$\endgroup\$ Jul 21, 2022 at 2:52
  • \$\begingroup\$ @TonyStewartEE75 I was able to get it to work by removing the resistor on the base! However, I still don't understand all these variables and numbers. How do I calculate what resistance I need so I don't damage my RPI \$\endgroup\$ Jul 21, 2022 at 3:29
  • \$\begingroup\$ No one said to remove the resistor, did they? Either follow instructions or good luck. With a 100 Ohms if it handle can your load, and not overheat, use that or reduce to 50 min, not 0 \$\endgroup\$ Jul 21, 2022 at 4:14
0
\$\begingroup\$

I appears that you have the transistor connected wrong. The 2n2222 pins are E-B-C when the curved side is facing you. From what I can see in the photo, the Base is connected to ground (white wire) and the resistor is going to the collector.

Or if it's a bad angle image, and the resistor is going to the center pin (base), then the collector is going to ground (white wire) and the emitter is going to the motor.

Try flipping the transistor 180 degrees to connect the emitter to ground and the collector to the motor.

\$\endgroup\$
6
  • \$\begingroup\$ according to the docs of the 2n2222 i have it correct. The curved side is cbe \$\endgroup\$ Jul 20, 2022 at 22:30
  • \$\begingroup\$ en.wikipedia.org/wiki/2N2222 \$\endgroup\$ Jul 20, 2022 at 23:07
  • \$\begingroup\$ @BruceAbbott you are looking at the P2n2222, I have the 2n2222 \$\endgroup\$ Jul 20, 2022 at 23:36
  • \$\begingroup\$ @SaveerJain No, that's Wikipedia's entry for the 2N2222 (which agrees with you on the pinout, right?). \$\endgroup\$ Jul 20, 2022 at 23:40
  • \$\begingroup\$ i added an image to the post \$\endgroup\$ Jul 20, 2022 at 23:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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