SERVO MOTOR TEST
Hi,
In this instructable, we will test the servo function of SG 90 micro servo. Using the Arduino Micro controller.
What All You Need
SG 90 MICRO SERVO
ARDUINO UNO
MALE TO MALE JUMPER WIRES
ARDUINO IDE
The Connections.
Connect the servo with the Arduino UNO as described in the diagram.
RED to VDD
BLACK to GND
YELLOW or ORANGE to PIN 9
The Code
Download the following code, and upload.
Downloads
It Sweeps.
After uploading the code, the servo motor starts to sweep from 0 degrees to 180 degrees.
I have also mentioned in the code that, you can change the angle between the servo sweeps by changing the numbers in the for() loops. (change in both for() loops).
Troubleshooting
If your servo did not sweep even after uploading the code.
check for these.
check that you have properly connected the pins.
you may have got confused with red and orange pins.
check that your pins in the board are properly inserted.
If the servo does not sweep and return in the same path, and instea it rotates continously,
then it is an AC servo.
only DC servo motors rotate in both directions.
If still, your servo is not rotating, try pressing the Reset button in the Arduino borad.
If none of these steps worked, then, your servo may have a problem.