Arduino Forum

Using Arduino => Motors, Mechanics, and Power => Topic started by: jjmuteteke on Jul 09, 2011, 03:27 pm

Title: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 09, 2011, 03:27 pm
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
Title: Re: how can i add more motors to work for the arduino
Post by: AWOL on Jul 09, 2011, 04:25 pm
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?"
Title: Re: how can i add more motors to work for the arduino
Post by: zoomkat on Jul 09, 2011, 05:16 pm
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.
Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 09, 2011, 05:42 pm
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.
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 09, 2011, 05:53 pm
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
Title: Re: how can i add more motors to work for the arduino
Post by: growler on Jul 09, 2011, 06:42 pm
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?
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 09, 2011, 07:58 pm
"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
Title: Re: how can i add more motors to work for the arduino
Post by: growler on Jul 09, 2011, 08:39 pm
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.
Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 09, 2011, 08:59 pm
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.
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 09, 2011, 09:14 pm
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
Title: Re: how can i add more motors to work for the arduino
Post by: retrolefty on Jul 09, 2011, 09:21 pm

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
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 09, 2011, 09:32 pm
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
Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 09, 2011, 10:45 pm
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. 
Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 09, 2011, 11:03 pm

                                                                        -----------------<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 (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.
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 09, 2011, 11:55 pm
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
Title: Re: how can i add more motors to work for the arduino
Post by: cr0sh on Jul 10, 2011, 12:18 am

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:

                                                                                     
                                                                                      +----[Motor1]-----+
                                                                                      |                 |
                                                                         +------------+----[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).
Title: Re: how can i add more motors to work for the arduino
Post by: retrolefty on Jul 10, 2011, 12:21 am

Quote
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:

Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 10, 2011, 12:26 am
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..
Title: Re: how can i add more motors to work for the arduino
Post by: retrolefty on Jul 10, 2011, 12:32 am
Quote
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.  ;)
Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 10, 2011, 12:47 am
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.
Title: Re: how can i add more motors to work for the arduino
Post by: retrolefty on Jul 10, 2011, 01:01 am
Quote
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....  ...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.


For anyone having never been to California, focalist has summed up the situation as precisely as a well written Arduino sketch. California has amazing almost unlimited diversity and things you will not see anywhere else in the world (I love giant Redwood trees) but by no means should the lure of Disney Land or Universal studios sucker you into visiting LaLa land.

Lefty
 
Title: Re: how can i add more motors to work for the arduino
Post by: cr0sh on Jul 10, 2011, 01:16 am


Quote
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:




Ya know, after I posted it, I realized I should've added it - and thought I'd get some guff; sure 'nuff was right!

:smiley-mr-green:

There - fixed it for ya!

:)
Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 10, 2011, 01:25 am
Yeah, but you guys are stuck with the Giants.

We have the Pats... The Bruins.. The Celtics and of course the Red Sox. 
Nothing beats Fenway and a cold beer.  It'll cost a fortune these days, but it's worth it once a year.

They don't always win (but often do)-  but NOTHING on this PLANET is quite a New England sports fan.  You guys like your teams, people LIVE AND DIE for who is on the ice for a B's game any given night.  It's plain bizarre.

To be honest, the pretty new england winter gets old around the second of january, on either side is four months where sports is a reasonably good option as a timekiller to prevent cabin fever during blizzards..
Title: Re: how can i add more motors to work for the arduino
Post by: cr0sh on Jul 10, 2011, 01:27 am

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.


This is the truth. I don't live on a fixed income (and if something breaks beyond my ability, I call in a pro - depending on the need, it will either be a contractor I've hired in the past, or it will be someone via my TotalProtect plan), but I have done tons of my own little home plumbing and electrical jobs. One repair or another, indoors or out. I also have a large supply of goops and sealants (favorite two: Permatex Copper silicone gasket, and JB Weld - the Permatex is great for all kinds of gaskets, whether your car or your home - and JB Weld is the same way - provided you want it as nearly permanent as possible). I've got a few lawn sprinklers I need to fix, and I have to install a new mister system in our back yard. At some point my wife and I need to replace the bathroom sinks (that may turn into a "call the expert" thing, depending on how difficult it is to remove and replace the current sink and backsplash; they're almost 40 years old now).

Part of me loves being a homeowner, another part of me wonders if it's really worth it (glad to have my shop, though!).

:)
Title: Re: how can i add more motors to work for the arduino
Post by: retrolefty on Jul 10, 2011, 01:29 am
Quote
Yeah, but you guys are stuck with the Giants.


Oh, you mean the present WORLD CHAMPION Giants? You may kiss the ring at the left.

It was an amazing playoff run, funny I don't recall seeing the Red Sox participating? They must have misplaced the team's visa card last year?

Lefty
Title: Re: how can i add more motors to work for the arduino
Post by: cr0sh on Jul 10, 2011, 01:36 am

Quote
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....  ...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.


For anyone having never been to California, focalist has summed up the situation as precisely as a well written Arduino sketch. California has amazing almost unlimited diversity and things you will not see anywhere else in the world (I love giant Redwood trees) but by no means should the lure of Disney Land or Universal studios sucker you into visiting LaLa land.

Lefty
 


Northern California seems to be the saner end of Cali. California's basically nice if you avoid the southern end (though I do like the area around San Diego up thru Santa Barbara) and the middle valley area. I just wish the gun laws were more like Arizona's (well, except for the whole concealed carry into a bar - that's just a ticking time bomb, there).

The only real problem with California (if you discount the middle valley section) is how expensive it is to live there...

:)
Title: Re: how can i add more motors to work for the arduino
Post by: retrolefty on Jul 10, 2011, 01:42 am
Quote
The only real problem with California (if you discount the middle valley section) is how expensive it is to live there...


That and our dysfunctional state government. Sometime starting in the 70s the government decided they would never be able to run out of spending other people's money. Probably something they learned back in D.C.  ;)

Lefty


Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 10, 2011, 01:56 am
Hey I wonder how he's doing with that motor thing... lol
Title: Re: how can i add more motors to work for the arduino
Post by: retrolefty on Jul 10, 2011, 02:01 am

Hey I wonder how he's doing with that motor thing... lol


What motor thing?  Oh wait..........

Hey Saturdays were made for hijacking posting threads, goes well with the beer.  ;)
Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 10, 2011, 02:46 am
True that.  Kids sent off to their rooms/neutral corners and they both have something to keep them busy, so we're going over to a neighbor's house for a cool one.

Have a "thing" tomorrow, only good part is that it's on the water down the Cape Cod way for a few hours, and I might see something worth pointing a camera at.  The Cape and Martha's Vineyard really are gems that few outside of New England know about-- but it's where the Presidents go on their summer vacations- guess that says SOMETHING...
Title: Re: how can i add more motors to work for the arduino
Post by: retrolefty on Jul 10, 2011, 03:14 am
Quote
The Cape and Martha's Vineyard really are gems that few outside of New England know about-- but it's where the Presidents go on their summer vacations- guess that says SOMETHING...


In the early 90s I took my wife and mother in law on a 10 day trip down to the cap, and then north, off for the fall colors all the way to upper NY and returned in a big circle route. The Mane coast remined me alot of parts of our north coast here.

The fall colors were everything they say about them. We may have bigger trees out here but you make up for it in quanity and colors in late fall. That is not a visit to miss if you haven't seen it or live there.  ;)
Title: Re: how can i add more motors to work for the arduino
Post by: focalist on Jul 10, 2011, 05:13 am
I do flat water kayaking when I can.. local state park lake and a meandering local river.  I've made it out for paddles twice now during the "Foliage Season", a Maple in full regalia arching over a riverbank.. I'll see if I can find one of my photos.  It really can be beautiful.

Maine, especially the North Coast is stunning.  My wife has family up that way, outside of Bar Harbor.  Last year we actually went camping for a few days in Acadia National Park, which is is on "Mount Desert Island".  I am not kidding.  The point is, Acadia includes Mount Cadillac, which is a huge mass of granite (leftover volcano so I am told) right on the coast.  1500 feet of pink granite in like a distance of five miles from the water, all of national park. http://www.acadiamagic.com/CadillacMountain.html  (http://www.acadiamagic.com/CadillacMountain.html)

I've never posted/shown the photos I took of it anywhere publicly, but when I was there, it was bathed in fog which burned off like wisps of fire as the rising sun hit it.  Not shabby shots.  Several I think are superior to the ones the travel and tour companies use, in my own humble opinion ;)  The top of Mount Cadillac is the first place in the USA to see the sun every day.

I guess I should post a few of those too... I really want terribly to have even a single day of shooting in Yellowstone.... Big Sur also has that stunning scenery you'll see nowhere else.  Last time I was there, I was in grade school.  Having a camera just gives me an excuse to walk around and stare at nothing all day and look legitimate doing it.
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 10, 2011, 02:28 pm
I would like to thank every body for helping me you all just literally saved my life but i have one more quick question so do i use schematic by cr0tch and if i do do i need the diode? also based on the schematic i don't need to give the motors(4 of them) their own 9v battery?. also im going to go to radio shack so can i get the final schematic on wether to use the diode or not? also for the programming want to control the speed of motors so  can i get the programming on that based on the PWM pin nine on the arduino duimilanove ATMEGA328.
thank you very much for your help

Title: Re: how can i add more motors to work for the arduino
Post by: cr0sh on Jul 11, 2011, 12:42 am
I would like to thank every body for helping me you all just literally saved my life but i have one more quick question so do i use schematic by cr0tch and if i do do i need the diode?


You should use the diode if you want the transistor to live for any reasonable amount of time. This diode prevents what's called "flyback voltage" (caused by the collapse of a magnetic field in a coil - as in the case of a motor) from back propagating through the transistor, which can break it. The voltage generated is generally much, much larger than the supply voltage. IIRC, the 1n4001 is good for about 50 volts, which is well within the range of what your are working with (if you want to be "doubly sure", sub in a 1n4004, which is good up to 400 volts).

See also this wikipedia article on flyback diodes: http://en.wikipedia.org/wiki/Flyback_diode


also based on the schematic i don't need to give the motors(4 of them) their own 9v battery?


Well, technically no - you only need one 9 VDC source. With that said, four of those motors running off a single PP3 9 volt battery is going to run that battery down to nothing in no time flat. You really want to use a better source for the entire project (something based on AA cells, minimum - if sticking with alkaline/NiCd/NiMH - otherwise you are looking at having to use a lithium-based battery, and all the potential recharging hassle/expense that can entail).

also im going to go to radio shack so can i get the final schematic on wether to use the diode or not? also for the programming want to control the speed of motors so  can i get the programming on that based on the PWM pin nine on the arduino duimilanove ATMEGA328.


I hope I've answered the question; but you are free to wait for any second opinions, of course (I'm certainly not one for thinking I'm the last word on any topic).

As far as the PWM control is concerned, just hook the circuit to the pin for the PWM control, and use the analogWrite() function to control it (see the Fade sample code/tutorial - or any other of the myriad tutorials for motor speed control using PWM for the Arduino out there).

thank you very much for your help


Good luck, and have fun! :)
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 11, 2011, 01:40 am
so i guess i can add one more motor to the schematic and other then that thank you very much for your help and i will let yall know if i have any more questions
thank you very much for your help
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 12, 2011, 04:19 am
hey i tried the schematics by cr0tch on page 2 and 4 some reason its not working any suggestion on why?
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 13, 2011, 07:37 am
                                                                                           +----[Motor1]-----+
                                                                                      |                 |
                                                                         +------------+----[Motor2]-----+---- 9 VDC
                                                                         |            |                 |
                                                                         |            +----[Motor3]-----+
                                                                         |            |                 |
                                                                         |            +-------->|-------+
                                                                         |               Flyback Diode (1n4001 or similar)
                                                                         |
                                                                         / Collector
                                                            Base        /
                    Arduino Digital Pin 8 --------\/\/\/\/--------[NPN transistor]
                                                1k resistor             \
                                                                         \ Emitter
                                                                         |
                                                                         |
                                                                         |
                                                                         +---------------- GND
Title: Re: how can i add more motors to work for the arduino
Post by: jjmuteteke on Jul 13, 2011, 07:44 am
                                                                                           +----[Motor1]-----+
                                                                                      |                 |
                                                                         +------------+----[Motor2]-----+---- 9 VDC
                                                                         |            |                 |                  (i used a nine volt connector clip so i connected + to motors and - to THE GND WERE THE EMITTER IS CONNECTED TO)
                                                                         |         
                                                                         |            |                 |
                                                                         |            +-------->|-------+
                                                                         |               Flyback Diode ( i used a 1n4004 )
                                                                         |
                                                                         / Collector
                                                            Base        /
                    Arduino Digital Pin 8 --------\/\/\/\/--------[NPN transistor]
                                                1k resistor             \          (i used the TIP120 DARLINGTON TRASNSISTOR)
      (i used a 1K resistor 1/2 watts 5% tolerance)                         \ Emitter
                                                                         |
                                                                         |
                                                                         |
                                                                         +---------------- GND
HERES THE PROGRAM I USED
#define LED 8


void setup()
  {
    pinMode(LED, OUTPUT);
   
  }
 
  void loop()
    {
      digitalWrite(LED, HIGH);
      delay(10);
      digitalWrite(LED, LOW);
      delay(10);
     
    }

thank you very much for your help