I have an RC car, and I'm trying to control the motor with my Arduino Uno.
My circuit is the same circuit as Circuit 12 in the Sparkfun Inventor's Kit (basically through a diode and motor, to a transistor back to ground), but I just bought a TIP31AG transistor to replace the P2N2 222A transistor, and a IN5404 HVCA diode to replace the 1N4148. The only problem is, it doesn't work. ---I even tried the TIP120 transistor, and it didn't work. Is there something I'm doing wrong?
I tried simple code to make the motor spin (I set the motor pin on HIGH and delayed it by 1000), and nothing happens. I think it's the transistor, but I'm not sure.
Can someone please help me?
My battery I'm using to power this RC car is a 7.2 volt battery, with 2 amps of current.
I think it may have to do with the transistor because if I bypass the transistor and connect it straight to ground, the motor spins perfectly fine.
You don't give us a lot to go on.
You have tried a tutorial with no mistakes in it and it does not function.
Therefore you are doing something wrong, so post a link to what you are doing and post a photo of what you have done, then we can check and try and see what you have done wrong.
dc42:
Off to bed now - you're welcome to the night shift
Well I was in bed when I answered that, that is the beauty of the iPad.
Now it is 4 in the morning.
No all that current dosen't flow through the arduino's ground, it only flows to your supply. The common ground is needed for the very small current to flow from the arduino, through the base of the transistor and back to the arduino. It is the only way to control the transistor.