Hi so i recently got an arduino uno and am trying out the dc motor. When I upload the code the motor wont run and the arduino continuously disconnects and reconnects rapidly and i cant get it to work.
If you are powering the motor from the arduino, don't. Motors need an external power supply. Attempting to power a motor from an arduino will probably crash the arduino and may cause damage
I looked some more things up and i think what is happening is that the polyfuse is activating and cutting the link to my pc. But im not sure why this would happen. Im using the ultimate starter kit and one of the projects in it says to set up a motor driving circuit and i followed it exactly.
Im using the ultimate starter kit and one of the projects in it says to set up a motor driving circuit and i followed it exactly.
So how did that work for you? Arduinos (and pc USB ports for that matter) are not made to power motors or heavy load components. Kits often abuse this just to be able to include something mechanical in the kit.
Separate and adequate power is needed for a motor - never try to run them off the Arduino
5V rail, that is meant to be clean, spike- and dropout-free power for digital chips, not power
for motors or servos.
Remember even a small motor can pull current of an amp or more at startup.
When I plug the motor straight into the board it powers up with tremendous power. But it doesn't seem like it's good for the board. How would I power it with out using the board? I tried plugging in the 9v battery but it doesn't seem to do anything.
I add another 330 ohm resistor (total 660ohm) and switch the emitter and collector logs then it works!
You need a transistor, diode and a separate 5V, at least 1 Amp power supply, circuit below good to about 600 mA.
blackshards:
When I plug the motor straight into the board it powers up with tremendous power. But it doesn't seem like it's good for the board.
I said never do this, no its not good for the board!
How would I power it with out using the board? I tried plugging in the 9v battery but it doesn't seem to do anything.
Use a power supply adequate for the motor. So what stall current does your motor need? You can measure the resistance of the motor winding and calculate that for any supply voltage.
But im not sure why this would happen. Im using the ultimate starter kit and one of the projects in it says to set up a motor driving circuit and i followed it exactly.
sobhsepid:
But im not sure why this would happen. Im using the ultimate starter kit and one of the projects in it says to set up a motor driving circuit and i followed it exactly.
I do not have an ultimate starter kit. So I do not know how you have things wired up.
Can you show us your wiring diagram? A pencil, paper and a camera are good enough if you include relevant detail. See this handy image guide.
It is unfortunately not uncommon for resources on the web like this to use such bad practices. I'd never
use a logic supply rail to power a motor, its just asking for completely avoidable trouble...