Getting my robot setup

Alright guys, so basically Im a complete beginner to arduino and Im a little ocnfused on how im supposed to setup the motors. So I have a 12v DC motor and a 180 degree servo motor that I want to use to drive the robot. The only problem is, I dont know what the circuit is supposed to be like to set the two up together. Ive been reading alot, but everything i read is another different setup and Im just confused as to what to do. if someone can give me some advice, it would be a huge help!

Thanks!!

P.S: I have an arduino uno R3. I dont know if that matters or not.. Thanks again!!

banditojosh1997:
So I have a 12v DC motor and a 180 degree servo motor that I want to use to drive the robot.

More info is needed:

  1. What do you mean by "drive the robot" - what are these parts for?

  2. Do you need the 12 VDC motor to be able to change speed?

  3. Do you need the 12 VDC motor to be able to change direction of rotation?

  4. Do you need the servo to work a full 180 degree of travel?

Answers to these questions will help us help you better.

banditojosh1997:
The only problem is, I dont know what the circuit is supposed to be like to set the two up together.

Fair enough: it is sometimes difficult to see how to bolt two bit of code into one sketch, and two circuits together. BUT..... have you actually gone as far as getting two individual circuits and appropriate sketches working in isolation of each other yet?

I'd get the two parts working separately first, then we can advise on hooking the whole thing together if that's the stumbling block.

But as cr0sh says, we need mor info. Help us help you :smiley:

Answers:

  1. These motors will be used to make the robot mobile. The 12v DC motor powers two back wheels that always go in the same direction (forward/backward). This will allow the robot to move front and back. The servo will be used to rotate an axle that connects two front wheels which will allow for steering either left or right.

  2. Yes, I need the 12v DC motor to be able to change speed.

  3. Yes, I need the DC motor to change direction (rotate clockwise and counterclockwise).

  4. It would be preferred to be able to have the servo be able to rotate the full 180 degrees, but even if its able to turn a little, that would be enough for my steering purposes.

Thanks again!!

banditojosh1997:

  1. These motors will be used to make the robot mobile. The 12v DC motor powers two back wheels that always go in the same direction (forward/backward). This will allow the robot to move front and back. The servo will be used to rotate an axle that connects two front wheels which will allow for steering either left or right.

What you describe here is the basic outline of any decent hobby R/C car chassis; in fact, you might look into such a chassis, or at the very least - the mechanics and setup of how such a chassis is built, and how the servo is connected to the steering (known as "Ackermann Geometry").

banditojosh1997:
2) Yes, I need the 12v DC motor to be able to change speed.

  1. Yes, I need the DC motor to change direction (rotate clockwise and counterclockwise).

Then you have a couple of options - you can go with an h-bridge to drive the motor (spec of h-bridge will be determined by spec of motor, which you haven't yet provided to us) - or, if you go with a pre-built hobby R/C car chassis (or parts), you can use a brushed (not brushless) ESC (electronic speed control).

For the former method, you would need to develop your own control routines to activate the h-bridge and control the speed (via PWM); for the latter ESC method - you would simply need to use the Servo library (an ESC will typically have some form of "arming" sequence that you will have to code for using the library; the sequence will be detailed in the manual for the ESC).

banditojosh1997:
4) It would be preferred to be able to have the servo be able to rotate the full 180 degrees, but even if its able to turn a little, that would be enough for my steering purposes.

Most servos will do 180 degrees using; many will do much more (270 degrees or so, which is about the limit of a standard potentiometer used for feedback in the servo). You may need to play with the Servo library to get it to work properly, but it shouldn't be an issue. As a matter of fact, for steering using Ackermann geometry, the servo arm only really needs to move 45-60 degrees or so; again, look into the geometry and into how hobby-grade R/C vehicles are built.

The reason I mention hobby-grade R/C vehicles as a platform for your needs, is that they are readily available, and are very easy to control with an Arduino (just use the Servo library, as I mentioned earlier); the downside of such a platform is their cost (they can be pricey).

If cost is an issue - then simply studying how they are built, etc can get you along to a point where you can build your own chassis (or use a cheaper "toy-grade" RC car chassis), outfitting it with your motor and servo to control the vehicle. An example: