I can't control 3V DC motor with PN2222 transistor. Motor doesn't spin. Please help!!

Thread Starter

siyannnnn

Joined Feb 16, 2020
5
Hi, everyone. I am trying to control my toy robot motor (3V) with transistor by arduino. The wiring diagrams are attached. I tried using different resistors 20 ohms and 10k ohms. I tried using batteries as power supply. But the motor doesn't spin as long as it's connected to the transistor. I think the wiring is ok because when I replace the motor with LED, it's doing fine.

I appreciate anyone who could help!! Thanks again!!
 

Attachments

djsfantasi

Joined Apr 11, 2010
9,156
And what’s different between the LED and the motor? The motor needs a lot more current.

You mention trying two different resistors. Where did you get their values from?

With a BJT (transistor) as a switch, you calculate the base resistor (Rb) such that 1/10th if the current required by the load is applied to the base. Have you done that calculation?

To start...
 

dendad

Joined Feb 20, 2016
4,451
Also, the motor could be pulling the Arduino 5V down too.
Motors can draw a lot of current to start.
It is better to have the motor supply direct from your power supply or battery, not the Arduino.
And use a Field Effect Transistor (FET) in place of the PN2222. Maybe a IRF540N or this one from Spark Fun... https://www.sparkfun.com/products/10213
 

djsfantasi

Joined Apr 11, 2010
9,156
Tough that someone dismisses a major source of information. Makes it difficult for us to respond to a posters questions. The Arduino forums are a reliable source of information. Their diagrams, dismissed as “cartoons” are often appropriate for the two component solutions. If it was a solution that required a dozen or two components, I agree that they be difficult to understand. But a GPIO interface that consists of a resistor and a transistor is capably presented by Fritzing. Don’t let a someone stuck in the 60s dissuade you. But recognize there is a time and place for exerything.

Some members totally dismiss a source of information because of a bad experience or because of an inability to understand the material. Listen to them, but stay open to other points of view.
 

AlbertHall

Joined Jun 4, 2014
12,344
Do you have a multimeter?
Can you connect the motor to a battery via the meter on the current range (start with the highest current range) and let us know what current the motor needs?
 

Thread Starter

siyannnnn

Joined Feb 16, 2020
5
How much current does the motor take?

Wiring diagrams are too hard to follow and don't show circuit details.
Post a schematic of your circuit
Thank you guys!! I know why now. You are right about the current. Strangly I thought 3V batteries were able to power the motor because that's how it worked without transistor. But when I hooked it up to 6V in the transistor circuit, it worked!! Thank you againg!!
 

Thread Starter

siyannnnn

Joined Feb 16, 2020
5
And what’s different between the LED and the motor? The motor needs a lot more current.

You mention trying two different resistors. Where did you get their values from?

With a BJT (transistor) as a switch, you calculate the base resistor (Rb) such that 1/10th if the current required by the load is applied to the base. Have you done that calculation?

To start...
Thank you guys!! I know why now. I thought 3V batteries were able to power the motor because that's how it worked without transistor. But when I hooked it up to 6V in the transistor circuit, it worked!! Thank you againe!!
 

Thread Starter

siyannnnn

Joined Feb 16, 2020
5
Also, the motor could be pulling the Arduino 5V down too.
Motors can draw a lot of current to start.
It is better to have the motor supply direct from your power supply or battery, not the Arduino.
And use a Field Effect Transistor (FET) in place of the PN2222. Maybe a IRF540N or this one from Spark Fun... https://www.sparkfun.com/products/10213
Thank you guys!! I know why now. You are right about the current. Strangly I thought 3V batteries were able to power the motor because that's how it worked without transistor. But when I hooked it up to 6V in the transistor circuit, it worked!! Thank you again!!
 

Thread Starter

siyannnnn

Joined Feb 16, 2020
5
Do you have a multimeter?
Can you connect the motor to a battery via the meter on the current range (start with the highest current range) and let us know what current the motor needs?
Thank you guys!! I know why now. You are right about the current. Strangly I thought 3V batteries were able to power the motor because that's how it worked without transistor. But when I hooked it up to 6V in the transistor circuit, it worked!! Thank you againg!!
 

Reloadron

Joined Jan 15, 2015
7,501
Their diagrams, dismissed as “cartoons” are often appropriate for the two component solutions.
<Off Topic>
You gave me a good chuckle and some fond memories. About 31 years ago I began working for the same boss I had when I retired going on 7 years ago. Mike was one of the most dedicated and hardest working guys I ever knew and was a mechanical type. Mike liked to refer to my schematics as "cartoons". That began over 30 years ago and since I retired I may have used the term but not for years. I had all but forgotten about that till you refreshed my memory.

Thanks
Ron
 

ebeowulf17

Joined Aug 12, 2014
3,307
Tough that someone dismisses a major source of information. Makes it difficult for us to respond to a posters questions. The Arduino forums are a reliable source of information. Their diagrams, dismissed as “cartoons” are often appropriate for the two component solutions. If it was a solution that required a dozen or two components, I agree that they be difficult to understand. But a GPIO interface that consists of a resistor and a transistor is capably presented by Fritzing. Don’t let a someone stuck in the 60s dissuade you. But recognize there is a time and place for exerything.

Some members totally dismiss a source of information because of a bad experience or because of an inability to understand the material. Listen to them, but stay open to other points of view.
While I agree with your appeal for people to be more open minded, I'm not sure I agree about the Arduino forums being reliable.

It's been a few years since I tried, but at least back in 2013-2016 there were countless threads with inaccurate information and misleading answers that went unchallenged. Here, as well as at electro tech and even the Adafruit forums, most threads that I see eventually get steered in the right direction by someone with the appropriate background. In my experiences on the Arduino forums, there are plenty of knowledgeable people participating, and *SOME* threads get very good answers, but countless other threads are left full of bad answers that never get cleaned up. I personally would never advise someone to get electronics advice there (maybe the coding advice is better, but the electronics advice is painful.)
 

Reloadron

Joined Jan 15, 2015
7,501
While I agree with your appeal for people to be more open minded, I'm not sure I agree about the Arduino forums being reliable.

It's been a few years since I tried, but at least back in 2013-2016 there were countless threads with inaccurate information and misleading answers that went unchallenged. Here, as well as at electro tech and even the Adafruit forums, most threads that I see eventually get steered in the right direction by someone with the appropriate background. In my experiences on the Arduino forums, there are plenty of knowledgeable people participating, and *SOME* threads get very good answers, but countless other threads are left full of bad answers that never get cleaned up. I personally would never advise someone to get electronics advice there (maybe the coding advice is better, but the electronics advice is painful.)
I recently was having a code issue so I joined the Arduino forums in hopes of a software resolution. Learning their forum software has a slight curve but only because learning any new forum takes some effort. Rather than Reloadron I broke my usual and went with Ron_Blain which all things considered is my name. My own observation based on a few other forums I participate in between electronics and shooting sports the Arduino Forums are OK. The Electronics section has some very sharp and knowledgeable people and like any forum with knowledgeable people you find your share of arrogant people. Reading the simple easy to follow rules for the electronics section they emphasize provide a drawing or schematic which we also ask for here frequently.

Most uC (micro_Controller) enthusiast have very little working knowledge as to electronics and electronic theory. I see it here as well as there. A few years back I actually started a thread about learning to swim in the deep end of the pool. Personally I like schematics and really don't want to diagnose someone's Fritzing attempts. However, there is no shortage of Fritzing at the Arduino forums. Overall though, while I find the demeanor here much nicer the Arduino forums are OK in my humble opinion. Now personally not being a programmer type I do find their information helpful and mostly on target, as to their electronics section sans a few sharp people it leaves a little to be desired. Then too some of the questions leave much to be desired, much like here. You read the post and question a few times and wonder what the heck thay are asking. :)

Overall I am fine with the place.


Ron
 

BobaMosfet

Joined Jul 1, 2009
2,110
Tough that someone dismisses a major source of information. Makes it difficult for us to respond to a posters questions. The Arduino forums are a reliable source of information. Their diagrams, dismissed as “cartoons” are often appropriate for the two component solutions. If it was a solution that required a dozen or two components, I agree that they be difficult to understand. But a GPIO interface that consists of a resistor and a transistor is capably presented by Fritzing. Don’t let a someone stuck in the 60s dissuade you. But recognize there is a time and place for exerything.

Some members totally dismiss a source of information because of a bad experience or because of an inability to understand the material. Listen to them, but stay open to other points of view.
While I agree with the fact that no source of information should be discounted- the very reason that particular source (and many others) are so full of misinformation is because nobody wants to maintain a basic standard of engineering. And electronics _is_ an engineering science. The chief reason to learn how to read/write schematics, is so that you can correctly and accurately document/design circuits, or evaluate other people's circuits. Schematics ARE the basic language of electronics, like the alphabet is for a language. It isn't a question of the arduino forums. It's part and parcel of a larger problem in virtually everything related to engineering today. Thinking is hard. People don't want to do it.
 

BobaMosfet

Joined Jul 1, 2009
2,110
Hi, everyone. I am trying to control my toy robot motor (3V) with transistor by arduino. The wiring diagrams are attached. I tried using different resistors 20 ohms and 10k ohms. I tried using batteries as power supply. But the motor doesn't spin as long as it's connected to the transistor. I think the wiring is ok because when I replace the motor with LED, it's doing fine.

I appreciate anyone who could help!! Thanks again!!
Disregarding all the other flack over schematics, etc- what we really need from you are some concrete numbers- what can you tell us about the motor? voltage, amps, a part number? What power-supply are you using- 9V, 12V...?
 

Reloadron

Joined Jan 15, 2015
7,501
Without knowing the current your motor takes it is hard to say what the base resistor value should be. You are using the transistor as a switch and the term for when the transistor is On would be saturation. There are formulas to calculate base resistor value but the load (motor) current should be known. This should work with a 3 volt supply. Just winging it less details I would try a 330 Ohm base resistor and if that does not drive the transistor into saturation I would reduce that value to maybe a 220 ohm resistor. Again, with an adequate 3 volt supply and a 3 volt motor the 2N2222 should work. You should not need 6 volts just to make it work.

Ron
 
Top