Close
0%
0%

Control Multiple Servo motors Using arduino

The project describes how to control one or two servo motors using Arduino

Similar projects worth following
The project describes how to control one or two servo motors using Arduino

About Project

If we attach all the Servos to Arduino supply pins then do not work in a proper way due to the absence of sufficient current to drive all the motors.So we need to utilize a separate power supply for the motors, either it is from some adapters (5v 2A) or from 9v batteries.

Basically, a servo motor is an integration of DC motor, position control system, gears. Servo motors are accessible in various shapes and sizes. A servo motor will have generally 3 wires, one is for positive voltage second is for ground and the last one is for position setting.

For External Power supply we can utilize Adapters, RPS (Regulated Power Supply Instrument), or 9v batteries. Or else we can also utilize a laptop USB port to power the servo. For this, we just need to short the Arduino ground to external supply ground.

Utilize the Arduino code, which is given below to program your Arduino.

  • 1 × Arduino UNO
  • 1 × SG90 Micro-servo motor
  • 1 × 9V 1A Switching Wall Power Supply
  • 1 × Breadboard (generic)

  • 1
    Run a Program

    #include

    Servo servo1;
    Servo servo2;
    Servo servo3;
    Servo servo4;

    int i = 0;

    void setup() {
    servo1.attach(3);
    servo2.attach(5);
    servo3.attach(6);
    servo4.attach(9);
    }

    void loop() {
    for (i = 0; i < 180; i++) {
    servo1.write(i);
    servo2.write(i);
    servo3.write(i);
    servo4.write(i);
    delay(10);
    }
    for (i = 180; i > 0; i--) {
    servo1.write(i);
    servo2.write(i);
    servo3.write(i);
    servo4.write(i);
    delay(10);
    }

    }

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates