Creating servo motor program using Arduino UNO
Required Components
- Servo motor (5V) -1 no
- Arduino UNO board -1 no
- Connecting wires -1 set
Circuit
Steps
- Make sure the components are working properly.
- Connect Arduino board 5v and GND pin to the servo motor by using wires.
- Connect servo motor data pin to the Arduino UNO pin 9.
- Check the Arduino program.
- Check the circuit connections.
- Run the Arduino program.
Arduino Program
#include<Servo.h>
Servo servo1;
void setup( )
{
servo1.attach(9);
}
void loop( )
{
servo1.write(0);
delay(1000);
servo1.write(90);
delay(1000);
servo1.write(180);
delay(1000);
}
Usage
- Industrial robotics.
- CD/DVD players.
- Elevators.
- Rudders.
- Automated doors.
Projects
- Robot-Arm.
- Sensor dustbin.