Akshay Joseph
Published © LGPL

Control Servo motor with Arduino Uno and POT

Control a Servo Motor SG90 with Arduino and potentiometer. The servo position is determined by the output of the potentiometer.

BeginnerProtip333
Control Servo motor with Arduino Uno and POT

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
UTSOURCE Electronic Parts
UTSOURCE Electronic Parts
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino Web Editor
Arduino Web Editor

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Schematics

Control Servo motor with potentiometer

Code

Control Servo motor with potentiometer

Arduino
#include<Servo.h>
Servo Myservo;
int pos;
void setup()
{
  Myservo.attach(3);
  pinMode(A0,INPUT);
}

void loop()
{
pos=map(analogRead(A0),0,1024,0,180);
  Myservo.write(180);
  }

Credits

Akshay Joseph

Akshay Joseph

22 projects • 58 followers
B.Sc. Electronics Student at Govt. College Tanur
Thanks to Tinkercad.

Comments