Hey so I have two dc motors that I want to control with the Arduino but power with a seperate 9v battery because my arduino is already powering otherthings. I can control the speed of the two Dc motors just fine if they are connected to the 5v on arduino but if I connect them as shown in the diagram they simply rotate at full power, the arduino has no control. Any ideas? I think it should work acording to this diagram,
The second one at google docs is wrong:
It is hard to see, but some wires shortcut things, or the diode is from collector to base. That would cause the motor to run full speed. Perhaps your Arduino is damaged, and perhaps the transistors are fried by now.
So please don't use that second picture. I'm sure you can do better than that. Try to extend the first picture for two motors. A fly-back diode is parallel to the load (the motor).
Sorry I'm not very good with this. Is this more appropriate?( I changed the right side)
But im still confused, the arduino controls the motors just fine if the motor is connected to the 5V on arduino, but not if its connected to 9v. The motors are suppose to be 6v but I'd like to run them at 9v so that there faster( they seem fine, a little warm but nothing concerning). Could that be it?
It is not okay.
Do you know how the holes are connected on the breakboard ?
The power lines are the two horizontal on top and the two on bottom.
The rest is vertical, covering 5 holes.
A small 9V battery is useless for powering motors. You need battery pack that can provide
enough current (several amps peak will be expected). This means good quality branded
AA rechargables or alkaline, LiPo or SLA.
PP3 9V battery - perhaps 100mA
AA cell, cheap - perhaps 500mA
AA cell, quality - 1A to 2A
LiPo/SLA - 10A+, fuse required.
Ok thanks for the advice, but I dont understand how this is causing the problem. If the motor was not turning at all, or just really slowly I could understand, but the problem is is that I cant CONTROL the speed when its connected to the 9v battery. I can though if its connected to the arduino 5v. This makes me think that its not that the transistor wired up wrongly but something else.
Thanks for the help so far
@Peter Thanks for the video, but I can assure you I do know how breadboards are connected
Reallyhappyman:
Ok thanks for the advice, but I dont understand how this is causing the problem. If the motor was not turning at all, or just really slowly I could understand, but the problem is is that I cant CONTROL the speed when its connected to the 9v battery. I can though if its connected to the arduino 5v. This makes me think that its not that the transistor wired up wrongly but something else.
Thanks for the help so far
@Peter Thanks for the video, but I can assure you I do know how breadboards are connected
Welcome to Arduino, these guys love to make irrelevant comments
I don't see how your setup would control the speed of your motor, so I'm not very useful to you there. However, would it be possible to run the current from the battery through PWM? I think not, but I could be wrong. This would be a good way to control a DC motor.
Btw, be careful with hooking your motor up directly to your board(don't do it). It's not made to handle that much load.
This makes me think that its not that the transistor wired up wrongly but something else.
This makes me think you have not got a common ground between the arduino and your power supply, or that you have connected up the transistors incorrectly.
How about posting a photograph, well focused and less than 1000 pixels wide.
Ok well I was gonna upload a picture but I couldnt get a clear picture, my circuit is very messy. So I thought I would draw the entire thing in fritzing. I thought about what you said @mike, so I double checked all the grounds, I dont know if this helped but I also made sure all the grounds were of the same "type". So if the gnd was connected to a 5v sensor then it was connected to a powerstrip of 5v gnd. Which I almost finished but before I finished I replaced the 9v batteries and it started working fine after that. I dont know, it seems to work fine now though =) Thanks everybody!