basic motor control help.

Hey!

I need to run 5 basic motors, 2 just rotate. and 3 move ether side to side or up and down. Do I really need a motorsheild do to this or can I do it another way? also what can I use the analong in for?

thanks
Mariah

Audrima:
Hey!

I need to run 5 basic motors, 2 just rotate. and 3 move ether side to side or up and down. Do I really need a motorsheild do to this or can I do it another way? also what can I use the analong in for?

thanks
Mariah

If by "just rotate" you mean rotate in a single direction, and by "side to side or up and down" you mean you need to be able to reverse the direction of the motors, then...

Let's look at this - for the first two motors, you only need two output pins, and for the other 3, you need at minimum 6 output pins (there are ways to reduce this, at the expense of flexibility). So - the number of output pins needed won't be an issue.

Most "motor-shields" have a maximum number of motors that can be controlled in one or both directions. Typically, the h-bridges used may be "half-bridges" that can control a motor running one direction (on or off), so that if the shield can control 2 motors in both directions, it can control 4 with each running in a single direction. Some shields you can only use in "full-bridge" mode, that that you can control say, 2 motors, each in both directions (cw/ccw/on/off).

I doubt that you'll be able to find a single shield that does what you need; what you might want to look for is a shield that can do most of what you need, that you can buy two of and stack them (of course, this brings up issues of its own - mainly whether the shields are designed to be stacked and controlled independently - or if you'd have to modify them to be able to do so).

Probably the next easiest thing to do, depending on your motor current requirements (if you don't know these requirements, you need to find this out for all the motors -FIRST-), is to build your own interface PCB using h-bridge ICs and the other needed parts. If you current requirements are fairly low, then the L293 is a popular choice. It doesn't need many external components to get the motors to run. Build it on a breadboard first, then transfer it to a prototyping PCB board if you need something more "permanent" for the final phase of the project. Going this route (which won't be a shield - you would connect it to the Arduino using jumper wires) will allow you to get exactly what you need, and may end up being less expensive (and you'll learn a lot along the way in designing and assembling it).

Lastly - regarding the analog-in pins on the Arduino - these can be used for many things, basically anything where you need to sense an analog (changing voltage) signal (like a light sensor, or a potentiometer). For your motors, you could in theory sense a voltage rise across a small resistor to measure a motor's current draw; as a motor has an increasing load placed on it, this voltage rises. When the motor is stopped, current draw (and voltage level across the resistor) is at its maximum. If you know what these maximums are, you can detect when or if a motor is about to be stopped (or is stopped), and shut down the motor, or reverse it (depending on the need/application). If, for instance, the motor was driving a wheel on a robot, you could detect when the robot was getting stuck (or, say the motor controlled the gripper on the robot - you could tell when the robot had exerted enough "pressure" for the gripper closing).

Finally - take a look around the playground, this forum, and other resources out there - there is plenty only a simple google search away that will answer most if not all of your questions.

Good luck with your project!

:slight_smile:

Hey,

Thanks, All I need honestly is 2 motor that will turn around to make a doll "jump" (a oblong piece of world on it.) the others, one will wiggle noise, one will wiggle tail and the last one (which is completely optional) will make it bow. I was thinking of using basic 2 wire motors from cheap (Re $3) rc wired car. Nothing special. I am working with a bread board thing, and rather not use premade shields. Would the L293 chip work for this?

Thanks,
Mariha

Audrima:
Hey,

Thanks, All I need honestly is 2 motor that will turn around to make a doll "jump" (a oblong piece of world on it.) the others, one will wiggle noise, one will wiggle tail and the last one (which is completely optional) will make it bow. I was thinking of using basic 2 wire motors from cheap (Re $3) rc wired car. Nothing special. I am working with a bread board thing, and rather not use premade shields. Would the L293 chip work for this?

Thanks,
Mariha

That would all depend on the current requirements of the motors - the L293 is limited to about 1 amp of current max (500 mA per each bridge, IIRC?) before it goes into thermal shutdown (and to reach that 1 amp, you need to use a heatsink on the chip). The L298, on the other hand, is limited to 4 amps (2 amps per each bridge). The L293, however, is easier to work with on a breadboard (the L298 has weird pin spacing that needs a custom PCB to use - there do exist adapter PCBs, though).