Hi,
I am trying to control the speed of a toy 130 DC motor using arduino and transistor. Using the following layout:
I am using a S8050 transistor
The S8050 has a different pin config than the one shown in the dummies website, so basically Ive reversed it.
The pot. value is ok and the value fed to pin 9 is ok (as seen from the serial output). However, a lot of the voltage seems to have been lost. If I use the 3V from the arduino to feed the circuit, then the motor barely moves. It looks like in this case about 2.6 v is lost in the transistor leaving very little for the motor. Am I doing something wrong?
My basic idea is to run a motor using 2 AA batteries and have speed control.
How would I go about trouble shooting this? Please let me know if you need any more details.
There is a mistake in the diagram.
The base resistor is 2k2. Maybe ok for a LED, but way too high for a motor.
Change the base resistor to 220 or 330ohm.
Leo..
That motor will draw about 80 mA when running unloaded. You need the base current of the transistor to be about 1/10 th of the motor current to switch it on (saturate it) fully.
So with 3 V supply the voltage across the base resistor is 3 - 0.7 = 2.3V.
For 8 mA base current you need the resistor to be 2.3/0.008 = 287 ohms.
So 270 ohms should work but better to be a bit lower as the starting current will be higher.
If you are going to get work out of the motor you will need more current.
I am now using a 220 ohm resistance. I am using PWM to control the motor and its inconsistent. For instance, if I do a
digitalWrite of 250, sometimes it runs, sometimes it doesnt. Is it an insufficient current problem? Would a lower resistance help?
Small motors will take stall currents more like 0.5 to 1A, that transistor isn't really up to it.
The no-load running current is the least useful parameter, that's easy, its the current
under load and at stall that are key to designing a driver that doesn't burnout. No-one
buys a motor to run it under no-load after all!
You say a "toy 130 DC motor" - could you actually tell us what the motor is? Or at
least measure the stall current or motor resistance?
Well clearly you'll need to handle 800mA (or 1.6A if reversing since instantaneous
reverse current = twice stall current) peaks.
So I'd recommend find devices that will comfortably handle 500mA and withstand
peaks of 2A. Can probably halve those values from 3V, assuming the stall rating
is for the nominal 6V.
What voltage is the Arduino operating at if the motor is at 3V?
5V then. You can drive PNP top-side drivers with that voltage difference, but
in general its not a good idea to reverse-bias the Vbe of a transistor, a few volts
(usually about 5) of reverse bias is the easiest way to fry a transistor.
So use an NPN low-side driver if at all possible. If you can find a generously
rated transistor with > 1A of collector current it would be good. Alternatively
a logic-level n-channel MOSFET will be good.