Thursday 19 July 2018

Servo Motor with an External Power

0

Servo Motor with an External Power



Servo, can be powered by another power source without Arduino power. Only thing important here is that all the GND are connected to each other.

Like this you can add as many servo motors as you want.


***Important! If you will use high voltage battery and you want give power to arduino with same power source, you need to put a 7805 voltage regulator in, and make a parallel circuit for that too.

Hardware Required :

Arduino or Genuino Board
Servo Motor
Battery for Servo (I used for my servo; four pcs (1.5V) batteries.)
Mini Breadboard
Wires

Recommended site to buy the required hardware:
https://www.banggood.com/?p=CS120478587752016125






#include <Servo.h>

Servo name_servo;

int servo_position = 0;

void setup() {

  name_servo.attach (9);

}

void loop() {

  for (servo_position = 0; servo_position <=180; servo_position +=1){

    name_servo.write(servo_position);
    delay(10);
  }

  for (servo_position=180; servo_position >= 0; servo_position -=1){

    name_servo.write(servo_position);
    delay(10);
  }
}
Milton Omega Coffee Pot 500 Flask
Author Image

About Tech Hunt
Soratemplates is a blogger resources site is a provider of high quality blogger template with premium looking layout and robust design

No comments:

Post a Comment