Today, we are going to be setting up and controlling servo motors. We will also be starting to prototype some ideas for our final project.
1. Open up the servo motor circuit link. Use the diagram to set up the circuit. The colors of the wires are slightly different on our servos.
Connect the RED wire (power) to 5 Volts (5V)
Connect the ORANGE wire (signal) to digital pin 9
Connect the BROWN wire (ground) to ground (GND)
2. Download the servo circuit from below and copy it into a new Arduino sketch.
3. Read through the information in the sketch to see what is there. Pay attention to:
a. libraries
b. 'void setup' for the program and 'void loop'. The program controls servos in two different ways.
4. Challenges
a. Modify the program to change the movement of the servo.
b. Modify the program so only the first part controls the servo.
c. Add a second servo to the circuit and program it to move also.
d. Add an LED to your circuit and program.
5. Check out the MORE ADVANCED SERVO PROGRAM below. See me for the potentiometer.
6. If you want a more basic circuit for the potentiometer, see the POTENTIOMETER AND LED CIRCUIT below.
1. Open up the servo motor circuit link. Use the diagram to set up the circuit. The colors of the wires are slightly different on our servos.
Connect the RED wire (power) to 5 Volts (5V)
Connect the ORANGE wire (signal) to digital pin 9
Connect the BROWN wire (ground) to ground (GND)
2. Download the servo circuit from below and copy it into a new Arduino sketch.
3. Read through the information in the sketch to see what is there. Pay attention to:
a. libraries
b. 'void setup' for the program and 'void loop'. The program controls servos in two different ways.
4. Challenges
a. Modify the program to change the movement of the servo.
b. Modify the program so only the first part controls the servo.
c. Add a second servo to the circuit and program it to move also.
d. Add an LED to your circuit and program.
5. Check out the MORE ADVANCED SERVO PROGRAM below. See me for the potentiometer.
6. If you want a more basic circuit for the potentiometer, see the POTENTIOMETER AND LED CIRCUIT below.
basic_servo_circuit.docx |