2 small dc motors with forward and reverse

Im new to the arduino and was wondering if there was an easy circuit to make a dc motor have a forward and a reverse.

Yes, it is called an H-bridge.
You can implement one with transistors (bipolar or MOSFET) or with relays.
Or, more simply, you can just use a DPDT relay.

Have a read of this
http://www.thebox.myzen.co.uk/Workshop/Motors_1.html

natecus:
Im new to the arduino and was wondering if there was an easy circuit to make a dc motor have a forward and a reverse.

The cheapiest and easiest way is to modify a servo for continous rotation.

natecus:
Im new to the arduino and was wondering if there was an easy circuit to make a dc motor have a forward and a reverse.

Yes but the best answer on how to do that depends on answering some detail questions.

What is the voltage and maximum current draw for the motor?
Do you wish to also be able to stop the motor?
Do you require variable speed control on the motor or just full speed forward or reverse?
How fast can the change of forward/reverse/stop decision be.
What do you wish to use to control the motor, an arduino board running your sketch code, your just
your fingers moving a switch?

Lefty

What is the voltage and maximum current draw for the motor?
Do you wish to also be able to stop the motor?
Do you require variable speed control on the motor or just full speed forward or reverse?
How fast can the change of forward/reverse/stop decision be.
What do you wish to use to control the motor, an arduino board running your sketch code, your just
your fingers moving a switch?

ok sorry for not being very specific.
i haven't picked out any motors yet because i was going to see if there were any suggestions, all i want to do is to be able to attach a laser pointer to a platform that will turn left to right and point up or down. i would like a variable speed and i have found a parallax 277800 2-axis joystick that i would like to use to control it through the arduino.

natecus:

What is the voltage and maximum current draw for the motor?
Do you wish to also be able to stop the motor?
Do you require variable speed control on the motor or just full speed forward or reverse?
How fast can the change of forward/reverse/stop decision be.
What do you wish to use to control the motor, an arduino board running your sketch code, your just
your fingers moving a switch?

ok sorry for not being very specific.
i haven't picked out any motors yet because i was going to see if there were any suggestions, all i want to do is to be able to attach a laser pointer to a platform that will turn left to right and point up or down. i would like a variable speed and i have found a parallax 277800 2-axis joystick that i would like to use to control it through the arduino.

Well then it sounds like you need a full H-drive module to control the motor rated to be able to handle the voltage and current demands of the motor you do end of selecting. So select the motor for the speed and power you require, then select a compatible H-drive shield or module and power supply and then get down to writing the sketch. Simple no? :wink:

Lefty

any suggestions on a motor, it doesn't need to turn very fast and i would like to run it off a 12 volt battery.

ok sorry for not being very specific.
i haven't picked out any motors yet because i was going to see if there were any suggestions, all i want to do is to be able to attach a laser pointer to a platform that will turn left to right and point up or down. i would like a variable speed and i have found a parallax 277800 2-axis joystick that i would like to use to control it through the arduino.

You should look at the servo based cam pan/tilt setups that use two servos. You could adapt the below "knob" example for use with the two pots in your joystick to control two servos.

// Controlling a servo position using a potentiometer (variable resistor) 
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott> 

#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
 
int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin 
 
void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
} 
 
void loop() 
{ 
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023) 
  val = map(val, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180) 
  myservo.write(val);                  // sets the servo position according to the scaled value 
  delay(15);                           // waits for the servo to get there 
}

natecus:
any suggestions on a motor, it doesn't need to turn very fast and i would like to run it off a 12 volt battery.

Well the 12 volt part is helpful. But 'not very fast' is not a good specification and of course how much load the motor must handle is a specification that is probably most important to know before selection can be made.

Lefty

if i used a servo with that program would i be able to let go of the joystick and have it stay in that spot?

natecus:
if i used a servo with that program would i be able to let go of the joystick and have it stay in that spot?

If the joystick spring returns to neutral, the servos will follow. In another programing language I made a simple program and used the joystick trigger switch to control when new positions were sent to the servo. Pull the trigger switch to allow the servos to be positioned by the joystick. When the servos are in a desired position, release the trigger switch to block new control positions to the servos, then release the joystick.

Well the 12 volt part is helpful. But 'not very fast' is not a good specification and of course how much load the motor must handle is a specification that is probably most important to know before selection can be made.

sorry i wasn't more specific on these points but the reason is because speed doesn't really matter right now and the load i thought wouldn't be enough to really matter, i am just turning a laser pointer that is on an aluminum platform i built that rides on ball bearings so if i have it balanced right i figured it wouldn't need much torque at all, is that wrong?

natecus:

Well the 12 volt part is helpful. But 'not very fast' is not a good specification and of course how much load the motor must handle is a specification that is probably most important to know before selection can be made.

sorry i wasn't more specific on these points but the reason is because speed doesn't really matter right now and the load i thought wouldn't be enough to really matter, i am just turning a laser pointer that is on an aluminum platform i built that rides on ball bearings so if i have it balanced right i figured it wouldn't need much torque at all, is that wrong?

Well the point is that there are 12vdc motors available that would be too small to turn the load, as there are many that would work but might be grossly over sized for what you actually require. So I don't know how to make a 'goldilocks' choice for you. So I can't and won't give a specific recommendation for any given motor as I just don't know enough to be certain that if it would work. Sorry.

Lefty

If your laser pointer is the typical hand held type, then servos could move it around without much trouble. Below very simple p/t cams worked 24/7 for several years (frequent rubberband replacement!).

zoomkat, that is exactly the sort of thing i am looking to build. was that something that you built? and what does it use as input?
lefty, i understand you can't tell me exactly which motor i would need if you don't know exactly what it would be for but thanks for all your other help.