Tab Content
Tab Title
Instructions
Tab Content
  1. Insert the white wire into pin 9 on the Arduino board.

  2. Notice the standard Servo, as programmed, is rotating from 0° to 180° and pausing for 2 seconds at each position.

 

STEM Connections

When writing our program code, “myservo.attach(9);" in the "Assign a Pin to the Servo" step, we chose pin 9 to be the pin that sends instructions to the Servo. Inserting the white wire into pin 9 will allow the Servo to receive the instructions written in the void loop section of your program. The Servo will begin to move as you instructed it to in the code you wrote.

Tab Title
Implementation
Tab Content

At the Thinkabit Lab, we emphasize the purpose of the white wire, by doing the following:

  • Ask students: Where do you think the white wire should attach to?

  • Answer: 9, from the line of code, “myservo.attach(9);” Students may not know the answer. Hint: the answer is in the code. Which pin did we associate with the Servo?

  • Ask students to notice how the standard Servo goes from one position to another, moving from 0° to 180°, pausing for 2 seconds at each angle.

  • As with the previous 2 steps, we recommend that your students write down where the wires go, “White –> 9”

 

If you are using the Thinkabit Lab Notebook:
 

Have students fill in the last blank at the bottom of page 15:
White Wire:        Pin 9       

Students can read page 16 to help reinforce how the code relates to the motion of the standard Servo. Students can also add a comment in their own words, such as “white wire needs to connect to the pin indicated in the code “myservo.attach(9)".

Tab Title
Troubleshooting
Tab Content

Pin 9 has a wire stuck in it

  1. Change boards and upload the code again. Note: You will need to first select the correct port before uploading by going to Tools>Port and selecting the COM# with (Arduino/Genuino Uno) next to it.
  2. Program another PWM pin to attach to. Note: This means changing the number in “myservo.attach(  );” from 9 to either 3, 5, 6, 10, or 11, a number with a tilde ~.

  3. Teacher uses a box cutter or pliers to get it out.

Servo doesn’t work

  1. Check to make sure that the wires are all connected to their corresponding color on the Servo connector.

  2. Check to see that the program was successfully uploaded to the Arduino board by looking for the “Done Uploading” message on the Arduino software.

  3. Check to make sure that the wires are connected to the correct pins on the Arduino board. Remember, Red –> Vin, Black –> GND, and White –> Pin 9.

  4. If all else fails, replace the Servo. Note: It is not uncommon for Servos to break after repeated use.

Instruction Category
Video