Arduino and Servo Motor Tutorial
Arduino and Servo Motor Tutorial
b. Arduino Shield: mounts on top of Arduino Uno board lining up the pins. The use of the shield is to
expand the flexibility of the Arduino Uno board.
2. Link the Arduino Shield on top of the Arduino Board linking the proper pins to each port
Arduino and Servo Motor Tutorial
By: Matthew Jourden
Brighton High School
d. “servo name”. write (“value 0-180) : writes the rotational direction for the motor
1 Motor Movement: Servo motor movements are rated 0 to 180 degrees
a 0 = Clockwise Rotation
b 90 = Neutral position
c 180 = Counter-Clockwise Rotation
4. Servo Wires
Wires: Use Servo Motor Wire to Female End to connect to the board
Wire the Motor to the Arduino Shield in Pin Row 4
Colors
Brown or Black= Ground (G)
Red or Red= Voltage (V)
Orange or White= Signal (S)
Arduino and Servo Motor Tutorial
By: Matthew Jourden
Brighton High School
5. Ultrasonic Sensor
Wires: Use Four (4) Female to Female wire connectors
Wire the Following
Follow the proper color set
Show Mr. Jourden to make sure all wires are connected properly before suppling
power to the unit
Program: Motor with Ultrasonic: Upload and test the program using the single motor
Arduino and Servo Motor Tutorial
By: Matthew Jourden
Brighton High School
Arduino and Servo Motor Tutorial
By: Matthew Jourden
Brighton High School
Wiring Diagram
Send and
Receive
signal
Program
Assignment
1. Add a Photoresistor and motor to the circuit
2. Modify/Add to the code above
a. If Photoresistor is > 200 and IR does not sense an object > move set motor to
0 (clockwise rotation)
b. If Photoresistor > 50 and Photoresistor < 200 and IR does not sense an object
> set motor to 180 (counterclockwise rotation)
c. Else Photoresistor < 50 and IR senses an object > Stop Motor