Things used in this project

Hardware components:
A000066 iso both
Arduino UNO & Genuino UNO
×1
Adafruit PWM Servo Driver Shield
×1
M3 bolt
×8
M3 washer
×8
LM2596 DC-DC Step down voltage converter
×1
Red PLA
×1
White PLA
×1
180 degree clear math protractor
×1
09939 01
Rotary potentiometer (generic)
×1
9g servo motor
×1
Software apps and online services:
Ide web
Arduino IDE
D94d qxu
Autodesk Fusion 360
Hand tools and fabrication machines:
3drag
3D Printer (generic)

Custom parts and enclosures

Code

Sketch for servo calibrator deviceC/C++
#include <Adafruit_PWMServoDriver.h>
#define analogIn A0

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

int inputValue = 0;
int tmpPwmValue = 0;

void setup() {
  Serial.begin(9600);
  pwm.begin();
  pwm.setPWMFreq(60);
}

void loop() {
  inputValue = analogRead(analogIn);

  // inputValue will be between 0 and 1024
  // By observation, servo min and max PWM values are usually betwee 100 and 612
  // The formula below allows us to simply convert analog input to PWM
  int pwmValue = (int)(100 + (inputValue / 2));
  pwm.setPWM(0, 0, pwmValue);

  // Check to make sure we're not unnecessarily displaying duplicate data
  if (pwmValue != tmpPwmValue)
  {
    Serial.print("Potentiometer Input = ");
    Serial.print(inputValue);
    Serial.print(", PWM = ");
    Serial.println(pwmValue);
  }

  tmpPwmValue = pwmValue;

  delay(15);
}

Credits

Img 3708 ibvm1wx0eh
Jeremy Lindsay
4 projects • 18 followers
I'm a software engineer who likes building things. C#, 3d printing, robotics, embedded software, and electronics.
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog