Try the Continuous Servo

  1. Warning: While the board is powered and the wires are connected in the Arduino board, do not to let the red and black wires touch. Students need to be especially careful if the exposed wires are bent and might touch when inserted in the end of the Servo.
  2. Disconnect the white, red, and black wires from the socket of the standard Servo.
  3. Insert the same white, red, and black wires into the matching sockets of the continuous Servo.
  4. Notice the Servo is rotating in one direction and then the other.  

STEM Connections

Connect the Black Wire to the Arduino board

  1. Insert the black wire into any GND pin on the Arduino board.

  2. Black wire = electricity (power) out.

STEM Connections

Just like an LED needs to be connected from the positive terminal to the negative terminal (or ground) of a power source to light up, a Servo also needs a complete circuit to operate. Plugging the black wire into one of the GND pins on the Arduino board will complete the circuit and provide power to the Servo.

Connect All the Wires to the Servo

  1. Warning: Double check to make sure your wires are in the right place, as placing the wires incorrectly may cause the Servo to break.

  2. Insert the white wire into the white wire socket of the standard Servo.

  3. Insert the red wire into the red wire socket of the standard Servo.

  4. Insert the black wire into the black wire socket of the standard Servo.

Upload the Code to the Arduino board

  1. Press the upload button (arrow) to upload your Servo program to the Arduino board.

STEM Connections

The upload button translates the code you wrote into a program and sends that program to the Arduino board. Immediately after the Arduino board receives this program it begins running it. Once the Servo is properly connected to the Arduino board, you will see the program’s effect on the Servo.

Write Code For a 2 Second Delay

  1. Type: “delay(2000);” after “myservo.write(180);” and before the last curly bracket.

STEM Connections

This delay function will cause the program to pause and not read the next line for 2000 milliseconds (or 2 seconds).  Meanwhile, the Servo has been instructed to move to 180 degrees, which it will do and then remain there until it receives another command.

Write Code to Make the Servo Move the Other Way

  1. Type: “myservo.write(180);” after “delay(2000);”

STEM Connections

Remember, the write function determines the angle to which a standard Servo moves. So, the line of code “myservo.write(180);” tells the standard Servo to move to 180 degrees.

Before the Arduino board runs this line of code, the Servo was at angle 0. When the Arduino board runs this line of code, it will cause the standard Servo to rotate to the right from 0 degrees to 180 degrees.

Pages

Subscribe to Thinkabit Lab RSS