Pages: [1] 2 3   Go Down
Author Topic: how can i add more motors to work for the arduino  (Read 3034 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello guys and thanks for reading this. im working on a important project and i need motors to run on 9volt power but when i attach one motor to the arduino duimilanove that i have the motor is not spinning fast enough. can someone plese tell me how to make to motor spin faster and also i have to add 3 more motors so can someone please tell me how to make four motors spin fast from an arduino duimilanove ATMEGA328.
THANK YOU
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26631
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i need motors to run on 9volt power
With a sense of foreboding, I'm going to ask the question "what is providing the 9V?"
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Tesla Member
***
Karma: 148
Posts: 9750
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can someone plese tell me how to make to motor spin faster and also i have to add 3 more motors so can someone please tell me how to make four motors spin fast from an arduino duimilanove ATMEGA328.

Use an appropriately large *external* power supply, which usually requires some type of motor controller.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Boston Suburbs
Offline Offline
God Member
*****
Karma: 16
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

what they are saying is that you've not really provided any information for us to even try to answer your question.

What kind of motor is it?  How fast is it going, and how fast do you want it to go?  How are you powering it, and how are you connecting it to the Arduino?  Are you using an H-Bridge?

We need more information from you to even try to help.
Logged

When the testing is complete there will be... cake.

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok thank you for your replies first i have nine volt batteries and i was wondering is there any way i can make the motor run on nine volt batteries from the arduino and if their is can someone please tell me how? the motors im thinking of using is between a radio shack 1.5v-3.0v DC motor and a 7.5v dc motor alsofrom radio shack. also when i connect the motors to the arduino the arduino does not give the motors enough power to get a high rpm but when i connect the motors to a nine volt batteries i received way more rpm and that is what im trying to do. and ive ordered 2 motor controllers now im new at the arduino and i don't want to mess up on my project so if motor controllers are the only way how would i program them to control motors and their speed and when to turn them on and off and how would i connect it to an arduino duimilanove ATMEGA328. any help or links would be greatly appreciated
Logged

Portland, OR
Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should not be powering either of those motors directly from the arduino, as you will damage it.

Arduino pins can provide an absolute max of 40mA but its really better not to exceed say 20mA. You see the motor turn faster when connected directly to the battery because part of the batteries power isn't being used to heat your arduino unnecessarily.

You will need additional components to switch power to the motors, that way the arduino can simply control the motors and not try to power them directly. Depending on what kind of control you want over the motors this could be as simple as a transistor or relay, or it could be more complicated, googling h-bridge could help.

Finally, 9 Volt batteries are really expensive for current capacity compared to pretty much any other option. And they don't work that well under relatively high current demands (read DC motors here).  And you haven't described anything that needs 9V in the first place so it looks like you would be using a good deal of your power heating various voltage regulators or something anyway. Consider AA's?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"You will need additional components to switch power to the motors, that way the arduino can simply control the motors and not try to power them directly. Depending on what kind of control you want over the motors this could be as simple as a transistor or relay, or it could be more complicated, googling h-bridge could help."

based on what you said can you elaborate on how i can switch the power of the motors because all i want is to make the motors(4 of them) spin at maximum rpm when i press a button that is linked to the arduino and thats what i want to control. plus i need them spinning at max rate for like a minute and thats it. so how would i make the arduino control that and which path would i have to take and also i have ordered two motor controllers are those a possibility and if they are how would i do that?
Thank you for your help
Logged

Portland, OR
Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What motor controllers? I think they are a good possibility and with a link it will make answering other questions much much easier.

This shouldn't be very difficult to setup and code for, you just need to make a couple more decisions, mainly how to power it.
Logged

Boston Suburbs
Offline Offline
God Member
*****
Karma: 16
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nah.. he wants it super simple-- all four run at max together, just switched off and on by the arduino.  He doesn't even need a motor controller, he can get away with a power transistor or a small relay if all he wants is just to switch power on to the motors, wait some time, and then shut them off.

If you arent trying to control them individually and they all just need to turn in one direction at max speed, it's basically a timed switch he needs.  Somebody around here can probably recommend an N-channel mosfet, I'd probably just use a TIP120 or something.  Without knowing the draw of the motors, it's hard to pick a particular transistor.. or he could just use a small signal transistor like 2n3904 to switch a relay off and on, and then he can just use the relay output.

All you'll need is a base resistor (1k is usually decent when ballparking) and the small transisor and whatever relay you want to use.  A flyback diode probably is a good idea too if using a relay.. like a motor, there's an inductive spike with the relay coil.  Some small relays include the diode inside.

You'll need a single output and a single input, and a super simple program on the Arduino, no matter which switching method you choose.
« Last Edit: July 09, 2011, 02:15:45 pm by focalist » Logged

When the testing is complete there will be... cake.

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey for the motor controller here is the link http://www.robotshop.com/sfe-2a-5v-16v-dual-serial-motor-controller-4.html. for the motors i want to make them all turn at full power at the same time and at max speed so if i use a timed switch would the motors still require their own power source witch i wanted 2 use 9v batteries for each individual motor and how would i code that so that the arduino turns on the motors. the two motors i was thinking of using are http://www.radioshack.com/product/index.jsp?productId=2909786 or http://www.radioshack.com/product/index.jsp?productId=2102828
thank you for your help
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey for the motor controller here is the link http://www.robotshop.com/sfe-2a-5v-16v-dual-serial-motor-controller-4.html. for the motors i want to make them all turn at full power at the same time and at max speed so if i use a timed switch would the motors still require their own power source witch i wanted 2 use 9v batteries for each individual motor and how would i code that so that the arduino turns on the motors. the two motors i was thinking of using are http://www.radioshack.com/product/index.jsp?productId=2909786 or http://www.radioshack.com/product/index.jsp?productId=2102828
thank you for your help

As already stated, if you only wish to turn all the motors on and off at the same time at full speed, then you most certainly don't require the expense and complexity of motor controllers. Simple transistor switches is all that you require. 9 volt DC batteries are a very poor choice for powering your motors as they provide minimum current and low total capacity, they are a heavy cost sink.

Lefty
« Last Edit: July 09, 2011, 02:39:45 pm by retrolefty » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok so based on the motors i stated witch transistor switches would i need and also is their any other power source that i can use that still can povide me with max power for the motors.
thank you for your help
Logged

Boston Suburbs
Offline Offline
God Member
*****
Karma: 16
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, those are hobby motors, I'm guessing they probably want as much as 200mA each if you have some kind of load on them, they are rated for 100mA normally.  Give yourself a little room for overhead.

That's 200mA x 4 , 800mA

Now, that's within the ratings of a 2n2222, which you can get at radio shack for cheap, but they also sell TIP120, which is
rated for MUCH higher current and can easily handle the motors.  You might get away with a 2n2222, but it will get awfully hot I'm willing to bet.  You'll do better using something more meaty for a transistor, so it can handle the heat caused by the power running through it a little bit better.  You circuit will run cooler and last longer.

Assume that any transistor is going to have a 2v drop.  Darlington transistors like a TIP120 drop as much as 3v.  Luckily, motors are pretty voltage tolerant.

What they are saying about the 9v batteries is that for their size and weight, they won't be able to power those motors for very long.  Minutes, most likely.  You would be much better off getting a battery holder (say from Radio Shack or whatever) that will allow you to use AA batteries.  Your motors want 7.5v, so we'll try to give them around 9-10v to account for the transistor voltage drop.

That's 1.5v per AA, so it's 6 AA batteries (connected end to end, what's called Series) to give us the 9v we want.  Six AA's will run those motors for a while at least, a heck of a lot longer than a poor little 9v!  Think of it this way.. if we connect eight AA batteries together, that will give us a 12 volt battery (1.5volts each).  Your car battery is also (roughly) a 12v battery.  However, if you disconnect your car's battery and try to crank her over using those eight AA's, you are going to be out of luck.  The AA's provide the right voltage, just cannot provide the amount of Current the car needs to operate the starter and all that.  The 9v battery is like that.. it's got the right voltage, but what it carries for current is too small to be very long-lasting with most motors. 
« Last Edit: July 09, 2011, 03:55:09 pm by focalist » Logged

When the testing is complete there will be... cake.

Boston Suburbs
Offline Offline
God Member
*****
Karma: 16
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


                                                                         -----------------<MOTORS>-----9v
                                                                        /
                       Arduino Digital Pin 8 --------\/\/\/\/----[transistor]
                                                                        \
                                                    1k resistor          -----------------GND


all the motors should be connected in parallel, not daisy chained end to end.  This is the setup for an NPN transistor, 2n2222 and TIP120 are both NPN.  For a PNP transistor, the motors would go between the transistor and ground instead of between the power and the transistor.  Think of the transistor as a switch.  The "base" takes in a small input and turns on or off accordingly.  The other two electrodes are where the power and the load go.. not so hard to understand, really.  You should also have a diode to handle the flyback spike, it gets connected in "reverse" across the motor.  In short, motors can cause a power spike that can kill other components unless you are careful.  That diode (1N4001 is what I use, cheaper than dirt) is your protection from that spike.  You could also use a smallish ceramic capacitor, but I prefer diodes as they are foolproof.  

Here, I want you read this.. it covers a number of really good options in a really well done tutorial:

http://www.me.umn.edu/courses/me2011/arduino/technotes/dcmotors/motorcontrol/motorcontrol.html

When the author refers to "fancy version" of motor control, he means the chip on that controller board you pointed to.  Besides being overkill, it interfaces via Serial, which is great in some respects but not so great in others.  He refers to it in the section named "Bidirectional Motor Control".  It's just more pain than you need and certainly more cost.

The code will be very simple.  I picked pin 8 randomly by the way.

You'll just be doing:

digitalWrite(8, HIGH);

to turn the motors on, and

digitalWrite(8, LOW);

to them off.

Now, all you need to do is detect the switch and add a few delays for timing and you're cooking with gas.
« Last Edit: July 09, 2011, 04:40:26 pm by focalist » Logged

When the testing is complete there will be... cake.

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

first for the 9v batteries i only need for my project to run for a short period of time and also for the motors how would i put them in parallel and from that schematic do i need to multiply the components time 4 for each motor and will all four motors run at max power from one pin. also would it make any difference if i used the PWM pins from the duimilanove ATMEGA328. if so how would i make the programming to control all 4 motors
thank you for your help

P.S. would you happen to no how to program a usb host shield

p.s.s. would two motor controllers make it more complicated and time consuming?
again thank you very much for helping me
Logged

Pages: [1] 2 3   Go Up
Jump to: