Starters kit project 9: Motorized Pin Wheel. Motor spins weak with transistor

Hi, I am working on the starter's kit project #9: Motorized Pin Wheel.

Everything sort of worked out well, but I found that when the transistor was connected, the motor spun really weak. Most of the times I had to give it a little push to initialize it.

On the other hand, if I create a loop that bypasses the transistor, or if I just replace the transistor with a switch (modified the codes accordingly), the motor spins pretty strong.

I was able to find the specs of this transistor, it only had 8.7m ohm. So I don't understand why it will cause such a difference for the motor performance?

I am new to electronics I would really appreciate some explanations on this. Thank you very much in advance for your replies!

Show us a good schematic of your circuit.

Show us a good image of your wiring.

Give links to components. Posting images:

https://forum.arduino.cc/index.php?topic=519037.0

Hello pp98yuan,
Welcome to the forum.

You might or might not be surprised to know that those of us reading your post (well, me anyway) have no knowledge of starters' kit project #9 because we don't know which starters' kit you have and even if we did know, you can's assume we've ever had one or seen one.

To be of the slightest help we need to see at the very least a circuit diagram and your code. Please read 'how to use this forum - please read', then come back and provide the information asked for. Once we can see what you are doing then we can help. at the moment any answers would be educated guesses and probably wrong.

Thank you.

My apologies! I was directed here via google search, so I am not familiar with the rules of using this forum.

Attached are the wiring diagram, my wiring picture, and the code I am using for this project.

Thank you very much for your understanding and sorry for the inconvenience. I really appreciate your inputs!

The transistor I used was the Irf520 N transistor. see IRF520 MOSFET Pinout, Datasheet, Features & Alternatives

Here is my code:

int switchPin = 2;
int transisPin = 8;
int switchState = 0;
void setup() {
// put your setup code here, to run once:
pinMode (switchPin, INPUT);
pinMode (transisPin, OUTPUT);
Serial.begin (9600);
}

void loop() {
// put your main code here, to run repeatedly:
switchState = digitalRead (switchPin);
if (switchState == HIGH){
digitalWrite (transisPin, HIGH);
}
else {
digitalWrite (transisPin, LOW);
}
}

Appears your motor/battery circuit is not wired as per the schematic.

The red wire of the battery is plus 9v, goes to motor top and cathode of the kickback diode.

BTW the PP3 9v battery will not power your motor very long as it’s capacity is quite low.

Is an IRF520 reliable with 5V logic?

I know the OP's link says it's good with Arduino because the threshold voltage is 4V, but my understanding (which may very well be wrong, so feel free to correct me anyone) is that the threshold voltage is where it guarantees to turn off, not on.

meltDown:
Is an IRF520 reliable with 5V logic?

I know the OP's link says it's good with Arduino because the threshold voltage is 4V, but my understanding (which may very well be wrong, so feel free to correct me anyone) is that the threshold voltage is where it guarantees to turn off, not on.

You are correct. If the MOSFET is not logic level it won't work very well with 5V logic. The symptoms pp98yuan decribes are consistent with it not being logic level.

From what I can see in the photo I'm surprised it works at all. I can't see any connection, other than the flyback diode, to the black wire from the motor (although there might be a connection and it's just not clear on the photo).

pp98yuan,
Check your wiring against the schematic you have posted. It might be useful to put aside the schematic of how it should be and draw another one of how it actually is, then compare the two.
Get a logic level MOSFET, such as IRL520.

I am not familiar with the rules of using this forum.

Erm, I get that you are new here but there are instructions... I'm guessing you've now read 'how to use this forum - please read' now but please go back and read #7 again about code tags.

Thank you.

It seems odd that Arduino would provide this part in their official Starter Kit if it's not well suited for the kit's project.

IRF520 might work but the OP needs to definitely wire the circuit properly as ‘currently it is not’.

meltDown:
Is an IRF520 reliable with 5V logic?

I know the OP's link says it's good with Arduino because the threshold voltage is 4V, but my understanding (which may very well be wrong, so feel free to correct me anyone) is that the threshold voltage is where it guarantees to turn off, not on.

I always think of the gate threshold as being the point where the MOSFET just about starts to conduct. So in switching mode you usually need much higher gate voltage because you want it fully switched on. Indeed the "datasheet" linked to says something close to the same thing.

In a real datasheet e.g. https://www.vishay.com/docs/91017/91017.pdf the parameter to look for is what Vgs (gate-source voltage) the Rds(on) is specified at. For an IRF520 that's only specified at 10V. Logical level MOSFETs usually give Rds at 4.5V or lower and their typical maximum threshold voltage is around 2.5V.

Steve