Hello,
I'm trying to run a mini DC motor with those specifications :
Rated Voltage: 3-6V DC
No-load current: 0.7A
Locked-rotor current: 1.3A
I'm using a PN2222 transistor, a 1N4007 diode and a 220 Ohm resistance as well. The components are assembled as shown on the picture.
I use this code :
int motorPin = 3;
void setup(){
pinMode(motorPin, OUTPUT);
}
void loop(){
analogWrite(motorPin, 200);
}
At speed 250 it works fine but when I decrease the speed (around 100) the motor stops working and the transistor heats a lot (until it burns - 3 transistors already).
Could someone tell me what's the matter with this circuit ?
TX
The PN2222 transistor is totally inadequate for that motor.
Either use a bipolar transistor rated for at least 2 Amperes continuous collector current, or better, a logic level MOSFET.
Also, you should not use a breadboard for motors. They are intended for logic circuits, and the tracks will burn when subjected to high currents.
Thanks jrmington, I'll try with your advices !
I was also thinking that maybe the diode 1N4007 wasn't "fast" enough to stop the flyback generated by the DC motor. Could a 1N4148 diode be a better option in my case ?
And do you have any recommendations to avoid using the breadbord ?
The 1N4007 is fine. The 1N4148 (450 mA maximum repetitive forward current) cannot handle the motor current.
For permanent projects, solder motor wires and motor battery leads to components (e.g. on a small "breadboard" PCB) or use a motor driver with screw terminals.
If you are just experimenting, a breadboard will work for a while, but you may burn the tracks and end up having to buy another.
Super, thanks a lot jremington for helping me through this !
I just got to get adequate components then.
Problem solved, topic closed !
The flyback diode, reverse-biased, is not in series with the motor.
The current that does flow through it, briefly, results from the motor's (a coil's) collapsing magnetic field.
I looked more closely at the diagram and now see that the transistor is installed backwards, according to my PN2222 data sheet. Of course, it is impossible to trust Fritzing diagrams, which is why no one on this forum recommends their use.
Also, attempting to power a motor from the Arduino 5V output will eventually damage or destroy the Arduino. Use a 4XAA battery pack instead, and connect the grounds.
OP's circuit posted correctly:
I noticed as well that the transistor was installed in the wrong direction in the diagram ! I modified it in the circuit.
I'll follow your advice about the power supply for the motor, I don't want to burn the Arduino !