Electronic – arduino – Transistor circuit to toggle motor on/off not working (Arduino)

arduinomotortransistors

I've been trying to create a simple transistor circuit with a 2N3904 that will toggle a geared DC motor on and off without drawing power from the arduino – I've followed the schematic seen in the 2nd image.

(Breadboard view)

(Schematic)

The circuit isn't behaving as I expect it to. For testing purposes, I've been feeding the 5V from the arduino into the base pin (before the resistor) to activate the 'switch' of the BJT. This only powers the motor when I have a low valued resistor at the base (~10ohms). When I use 1k resistor, the motor does not turn on. Also, I have used a digital pin set at high to attempt to power the base pin and toggle the motor on/off, but this does nothing, regardless of the value of the resistor.

Perhaps my circuit is incorrect? All I want the circuit to do is turn the motor on and off when I feed it a high signal from the arduino.

Notes: The red wire coming into the node at the top is from a 9V battery. The ground bus on the breadboard has both the arduino ground and battery ground connected to it.

Best Answer

Your motor that you linked to is a 4.5V 190~250 mA (No Load) motor. At 9v, the current probably increases. You are overdriving it by 200%. And any load/weight will cause it to increase in current requirements as well. Stall current is probably 10x that at least.

You are missing the protection diode across the motor, that can easily kill the transistor.

The Transistor you are using is a 100mA standard, 200mA Absolute Maximum. One of those motors by itself without any load, can easily kill that transistor.

The base resistor is calculated as (Base Voltage - Base-Emmiter Voltage) / Current required. Base Voltage is the Arduino pin, so 5v, Vbe depends on the collector current which is 200 mA here, so typically 1V. Current required is calculated as Collector Current (200mA) / Hfe (From datasheet, 10~30). On the safe side, lets go with 10, so 200 / 10 = 20mA needed at the base.

(5V - 1V) / 20mA or 4V / 0.02A = 200Ω resistor. A 1kΩ resistor would only allow 4mA at the base, which times the Hfe of 10, would only allow 40mA at the collector, probably no where enough to tun on the motor.

TLDR: You need the protection diode, your 9v power source is too high, and your transistor is too weak for the motor you are using. And you need a bigger resistor at the base because the motor requires more current then you are figuring. A common 2n2222 transistor with a 470Ω resistor would do much better.

Edit: Not making the pin an output also puts a damper on things. Answer, Arduino pins default to input.