Difference between revisions of "Tutorials/Arduino Projects/Mobile Robotics/BoeBot/Connecting A Servo"

From ROBOTC API Guide
Jump to: navigation, search
(Servo Cable)
(Wiring the Connection with a Breadboard)
Line 8: Line 8:
 
To help you to understand how the servo connections work, we are going to show you how to hand wire the connections.
 
To help you to understand how the servo connections work, we are going to show you how to hand wire the connections.
  
First we are going to need the two 3-pin headers for connecting the servo cables to the breadboard. We are also going to need five jumper wires. The wires can be of any color, but follow the circuit we recommend that you have 1 black wire, 2 red wires, and 2 wires of other colors (we will use blue and yellow).
+
First we are going to use the two 3-pin headers to connect the servo cables to the breadboard. To do this we are going to need five jumper wires; functionally the wires can be of any color, but to follow the circuit we recommend that you have one black wire, one blue wire, one yellow wire, and two red wires.
  
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_parts.jpg|thumb|c|center|300px|Parts needed]]
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_parts.jpg|thumb|c|center|300px|Parts needed]]
 
+
Next we want to look at the schematic for the connections.
First we want to look at the schematic for the connections.
+
  
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_Schematic.png|thumb|c|center|300px|Servo connection schematic]]
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_Schematic.png|thumb|c|center|300px|Servo connection schematic]]
Line 18: Line 17:
 
As you can see, both servos have their black wires connected to ground and their red wires connected to 5V. However, the white signal wires each connect to a different Arduino pin. The left servo gets connected to digital pin 10, while the right servo gets connected to digital pin 11. This is because we want to be able to control the servos independently.
 
As you can see, both servos have their black wires connected to ground and their red wires connected to 5V. However, the white signal wires each connect to a different Arduino pin. The left servo gets connected to digital pin 10, while the right servo gets connected to digital pin 11. This is because we want to be able to control the servos independently.
  
Since the black wires can be connected to each other, as well as the reds to each other, but the whites can't, we need to place the servo connectors so that the signal wires are not connected but still requires as little extra work as possible.  
+
Since the black wires are both being connected to ground (called 'common ground'), we can connect both of the black wires to one ground port. Likewise, the two red wires can be connected together to the a +5 volt port (since they are both using +5 volts). The two white signal wires, however, will be using two different signal pins in order to control the servos independently and should not be wired together.
  
First lets place the 3-pin headers for connecting the servos to the breadboard
+
First we will place the 3-pin headers for connecting the servos to the breadboard:
  
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_servo_connectors_placed.jpg|thumb|c|center|300px|Placing the servo connectors]]
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_servo_connectors_placed.jpg|thumb|c|center|300px|Placing the servo connectors]]
Line 32: Line 31:
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_Connecting_signal_pins.jpg|thumb|c|center|300px|Connecting the signal pins to the Arduino pins]]
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_Connecting_signal_pins.jpg|thumb|c|center|300px|Connecting the signal pins to the Arduino pins]]
  
Once that is completed we are ready to connect the servo wires to the connector pins as seen bellow.
+
Once that is completed we are ready to connect the servo wires to the connector pins (shown below).
  
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_Connecting_the_servos.jpg|thumb|c|center|300px|Servos connected to the breadboard circuit]]
 
[[image:Hand_Wire_Servos_BoeBot_Breadboard_Connecting_the_servos.jpg|thumb|c|center|300px|Servos connected to the breadboard circuit]]

Revision as of 14:00, 11 October 2012

Servo Cable

The continuous rotation servos that come with the BoeBot have a 3-wire cable for connecting it to the power and controller. The black wire is the ground, the red wire is the power (positive) and the white wire (sometimes yellow, depending on the servo) is the signal wire. The signal wire is used to send the control signal to the servo. All three wires run together into a single, standard hobby servo connector.

Wiring the Connection with a Breadboard

To help you to understand how the servo connections work, we are going to show you how to hand wire the connections.

First we are going to use the two 3-pin headers to connect the servo cables to the breadboard. To do this we are going to need five jumper wires; functionally the wires can be of any color, but to follow the circuit we recommend that you have one black wire, one blue wire, one yellow wire, and two red wires.

Parts needed

Next we want to look at the schematic for the connections.

Servo connection schematic

As you can see, both servos have their black wires connected to ground and their red wires connected to 5V. However, the white signal wires each connect to a different Arduino pin. The left servo gets connected to digital pin 10, while the right servo gets connected to digital pin 11. This is because we want to be able to control the servos independently.

Since the black wires are both being connected to ground (called 'common ground'), we can connect both of the black wires to one ground port. Likewise, the two red wires can be connected together to the a +5 volt port (since they are both using +5 volts). The two white signal wires, however, will be using two different signal pins in order to control the servos independently and should not be wired together.

First we will place the 3-pin headers for connecting the servos to the breadboard:

Placing the servo connectors

Now we can connect the power and ground pins.

Connecting the power and ground

Next we can connect the signal connector pins to the Arduino pins.

Connecting the signal pins to the Arduino pins

Once that is completed we are ready to connect the servo wires to the connector pins (shown below).

Servos connected to the breadboard circuit

Notepad.gif NOTE: The servo wires in the image are yellow for visibility reasons. The actual color of the signal wire of the servos in the kit are white.

BoeBot Shield connections

While hand wiring the connections is not hard, it does take up a good bit of space for something that will often be in use. Thankfully the BoeBot Shield has 4 connections on the shield that allow you to simply plug the servo connector in and be done with it. If you look at the shield you will see a group of pins shielded by plastic. These are the servo pins. When connecting the servos always make sure that they are plugged in the correct way or you could damage the servo and possible the Arduino. Always have the black wire closer to the breadboard. The servo bank is wired to the Arduino's digital pins 10, 11, 12 and 13. You can tell which pin the signal is connected to by the small number by the signal wire of the plug.

A close up of the numbers identifying the servo connection

The drive servos will always be used with pins 10 and 11, so please remove the servo connections from the bread board and plug them into the servo bank connections 10 and 11, with the left servo plugged into number 10.

Servos connected to the servo bank connectors
Servos connected to the servo bank connectors