Go Down

Topic: how can i add more motors to work for the arduino (Read 3 times) previous topic - next topic


Jul 10, 2011, 12:18 am Last Edit: Jul 10, 2011, 01:16 am by cr0sh Reason: 1

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

I've updated focalist's schematic to (hopefully) make it more clear how to hook things up (and to label the pins of the transistor); the collector of the transistor goes to the motors, the base of the transistor to the resistor (and on to the Arduino), and the emitter goes to ground. I've shown three motors connected to the transistor in a parallel configuration - I'm sure you can see how to add the fourth:

                                                                                      |                 |
                                                                         +------------+----[Motor2]-----+---- 9 VDC
                                                                         |            |                 |
                                                                         |            +----[Motor3]-----+
                                                                         |            |                 |
                                                                         |            +-------->|-------+
                                                                         |               Flyback Diode (1n4001 or similar)
                                                                         / Collector
                                                            Base        /
                    Arduino Digital Pin 8 --------\/\/\/\/--------[NPN transistor]
                                                1k resistor             \
                                                                         \ Emitter
                                                                         +---------------- GND

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

I can't comment on that - it seems a bit out of left field; why do you think you need a USB host shield for motor control (or is it in relation to another task)?

p.s.s. would two motor controllers make it more complicated and time consuming?

The only real reason to use motor controllers (for this project) is if you need the capability to:

1) independently control each motor
2) independently control the speed of each motor
3) independently control the direction of each motor

If you don't need any of those capabilities, then using one or more motor controllers will only raise the cost of the project and make it larger while causing it to draw more current; if you insist on using 9 volt batteries, larger isn't the direction you want to be headed in (for your small motors, I agree with everyone else that using a 9 volt PP3 battery is the -wrong- choice; the battery will not last long at all, and they are expensive to replace as well).
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.


I've updated focalist's schematic to (hopefully) make it more clear how to hook things up

What no 'flywheel diode', I thought you knew better.  :smiley-mr-green:


Jul 10, 2011, 12:26 am Last Edit: Jul 10, 2011, 12:35 am by focalist Reason: 1
All four motors as Crosh has shown.  Using one of the PWM outputs would even allow you to vary the speed of the motors.  PWM simply turns the power off and on really fast to provide what "looks" like a variable supply to the motors.  However, it makes sense to walk before you run, so stick with off and on at first.  Only the software will change (and only a few lines) to add PWM speed control, the hardware stays the same.

Stick with the idea that the transistor is a valve and the arduino "turns" that valve off and on via the base of the transistor.  The valve lets the current flow, which turns the motors.  It's really not all that different than waterand plumbing, and people understand pipes and valves pretty well.  The 9v battery works in that model too- it's got plenty of water pressure, it's just got a tiny tank.

By the same token, the digital output of the arduino doesn't have a big enough tank to run the motors either.. but it does have enough to turn a valve off and on, which can be connected to whatever water reserve you want.  The "water" flowing through the "pipes" (wires) is what makes the motors turn around... and Ground is simply where it all goes down the drain.   ;)

It's a really crude analogy, but it's helped me more than once.. and starting out, demystified things quite a bit- even if a bit inaccurate for the sake of making it understandable to a neophyte..
When the testing is complete there will be... cake.


It's really not all that different than water, and people understand pipes and valves pretty well.

Good, could you come over and solve an intermittent leak I have under my kitchen sink. Oh and bring a bright flashlight with you.  ;)


Jul 10, 2011, 12:47 am Last Edit: Jul 10, 2011, 01:12 am by focalist Reason: 1
No prob, as long as the ticket is waiting at Logan.  I'd love a few days in Frisco.. far too long since I've been, and I love the city.  Almost as much as I like the Humboldt country and Big Sur.  Heck, I find most things north and south of LA to be pretty great, just skip 100 miles on each side as a sort of quarantine, and California becomes a lot nicer place.  I was born in San Diego but moved away as a young kid... Navy brat.  Los Angeles is...ummm...Hmm.  Gommorrah?  Okay maybe that's a LITTLE overboard, but you get the sense of my feelings about that fine metropolis.  I'd miss Cali if it fell into the ocean, LA not so much.  I've not been to Frisco since I got back into photography.. and Frisco is one of the most picturesque cities in the world.  Come to think of it, I think I might have to start ferreting away nickels and dimes.  I didn't go anywhere this year, but I usually try to travel for a few days every late winter to just do photography and get away.  Frisco would be a great destination.

Own a house on a fixed income, and you learn about tradeskills you never imagined you'd be doing...  I can't afford a plumber or an electrician or a carpenter every time something dies or breaks.  Sometime before the fall, I need to sweat a new solenoid valve, cutoff and about three feet of pipe into the heating system plumbing or I'll not have heat.. but I learned how last time one went, so this time it's just a matter of getting the parts and then having a time to do it.  I tend to work in spurts when I'm feeling good, and plan/purchase during the other times so when I feel decent, I'll be looking "at" it, rather than looking "for" it, whatever it may be.  I've gotten smart enough to stockpile things like PVC and Copper pipe, a small spool of 12/3 Romex, breakers and GCFI sockets in the basement on a shelf.  Not a ton, just realistic amounts- I rarely buy ONE of anything, as if it broke once, it's gonna break again sometime, most likely.  If I'm not Jerry-rigging one thing or another to an Arduino, I'm Jerry-rigging some appliance, device, chunk of furniture, wall covering, or family pet to avoid calling one "pro" or another... hehe.  By the way, I don't suppose one can still get Ether very easily, and they want to know WHY you want to buy suture kits, whether or not it's LEGAL to buy them or not.  Sometimes it's a good thing I can't get required supplies, I think.

You become a master of Duct Tape, PVC pipe (both for plumbing and for building lightweight frames and supports), Epoxies of every flavor, goops and sealants, and eventually even how to do some things right.  I plumbed in our kitchen sink, all the way to the outflow including cleanouts.. and it has one of those nice pull-out-kinda-thing spouts and all that, a Boiling Water tap (neato toy I got as a gift), as well as garbage disposal and dishwasher... not a single leak in five years..  The thing is a deep-bowl double sided monster.. made of Black synthetic granite.  More durable and lighter, kinda like Corian, but I forget the name.  DuPont polymer something or other.  Looks pretty snappy.
When the testing is complete there will be... cake.

Go Up