So I´m trying to control a DC motor with a transistor and Arduino.
I´ve connected the 5V of the arduino to the collector of the transistor (it´s a 2N2222 transistor) , the base to pin 9 of the arduino, which is set to "blink", and the emitter to the motor and finnaly the motor to the ground of the arduino. Also I have a diode in parallel with the motor and I´m sure it is not placed the wrong way. Now when I connect the motor directly to the 5V and ground everything goes as expected. When I try to connect things the way I just said... not so much. Sometimes the motor works for a second or so, others not at all or for just an instant. Altough when I tried to add an ammeter to the circuit in series with the motor, the circuit miraculously started to work, wich made me even more confused. What am I doing wrong?
I´ve connected the 5V of the arduino to the collector of the transistor (it´s a 2N2222 transistor) , the base to pin 9 of the arduino, which is set to "blink", and the emitter to the motor and finnaly the motor to the ground of the arduino. Also I have a diode in parallel with the motor and I´m sure it is not placed the wrong way. Now when I connect the motor directly to the 5V and ground everything goes as expected. When I try to connect things the way I just said... not so much. Sometimes the motor works for a second or so, others not at all or for just an instant. Altough when I tried to add an ammeter to the circuit in series with the motor, the circuit miraculously started to work, wich made me even more confused. What am I doing wrong?