SERVO MOTOR TEST

by Santhana_krishnan in Circuits > Arduino

19618 Views, 5 Favorites, 0 Comments

SERVO MOTOR TEST

35750493274_8347787c20_b.jpg

Hi,
In this instructable, we will test the servo function of SG 90 micro servo. Using the Arduino Micro controller.

What All You Need

41b7fe63-77bd-4ffb-b8e1-be0f8f43cf4d_1.7446164bdce62e601b104966015fb493.jpeg
Introduction-to-Arduino-UNO.jpg
88814d2c-jumper.jpg

SG 90 MICRO SERVO
ARDUINO UNO
MALE TO MALE JUMPER WIRES
ARDUINO IDE

The Connections.

sweep_BB.png

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.

It Sweeps.

How to test sg 90 micro servo

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.