In this instructable, we will test the servo function of SG 90 micro servo. Using the Arduino Micro controller.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: What All You Need
SG 90 MICRO SERVO
MALE TO MALE JUMPER WIRES
Step 2: 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
Step 3: The Code
Download the following code, and upload.
Step 4: 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).
Step 5: 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.