Project tutorial
Automatic Servo Tester with Arduino Nano

Automatic Servo Tester with Arduino Nano © CC BY-NC

Some servos may be corrupted or may be working incorrectly. With this project you can make a fast servo tester.

  • 997 views
  • 0 comments
  • 7 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

With this project you can make your own servo tester device. I made project with Arduino Nano which can test two servos at the same time. Project has automatic and manual testing mode. With potentiometer you can test servos manually. Also if you press the push button the servos will test automatically. This project usefull for who make projects with servos and works. Some broken servos can interrupt your project, especially if you are doing many projects related to servos. So with this project you can automatically or manually test your two servos at the same time. You need to solder components on the blank circuit board. Don't solder Arduino Nano directly on the blank board. Use female headers. Also I will add photos of under the circuit.

The device diagram as shown below:

The project video as shown below:


Code

Automatic/Manually Servo TesterArduino
That code is automatic/manually servo tester for Arduino.
#include <Servo.h>

Servo myservo1,myservo2;  // create 2 servo objects to control servos

int potpin = A0;  // analog pin used to connect the potentiometer
int butonpin = A1; // analog pin used to connect the push buton
int val;    // variable to read the value from the analog pin
bool press=LOW;  // variable to store the buton press 
int pos = 0;    // variable to store the servo position
void setup() {
  myservo1.attach(3);  // attaches the servo1 on pin 3 to the servo1 object
  myservo2.attach(5);  // attaches the servo2 on pin 5 to the servo1 object
  Serial.begin(9600);  // generates serial connection
}

void loop() {
  
  	press=digitalRead(butonpin);		   // reads the value of the buton (HIGH or LOW)
    Serial.println(press);
  if (press == 1) {                   // if push buton pressed automatic mode starts
    for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo1.write(pos);              // tell servo1 to go to position in variable 'pos'
    myservo2.write(pos);              // tell servo2 to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo1.write(pos);              // tell servo1 to go to position in variable 'pos'
    myservo2.write(pos);              // tell servo2 to go to position in variable 'pos'
     delay(15);                       // waits 15ms for the servo to reach the position
  }
  } else {
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180)
  myservo1.write(val);                 // sets the servo1 position according to the scaled value
  myservo2.write(val);                 // sets the servo2 position according to the scaled value
  delay(15);                           // waits for the servo to get there

  }
  }

Schematics

Automatic/Manually Servo Tester
Diagram of Automatic/Manually Servo Tester
Uploads2ftmp2fa68741ec 8555 4d94 b2ee d45021acce642fdiagramofservotester 9py9c1vdsb

Comments

Similar projects you might like

All About Servo Motors and Servo Motor Tester

Project tutorial by RoboCircuits

  • 2,155 views
  • 0 comments
  • 8 respects

Automatic Device Tester with Arduino

Project tutorial by Brian Lough

  • 6,376 views
  • 13 comments
  • 37 respects

Arduino Nano Tetris Game on Homemade 16x8 Matrix

Project tutorial by Mirko Pavleski

  • 3,465 views
  • 3 comments
  • 22 respects

The Magnetic Field and RGB Tester

Project tutorial by Kutluhan Aktar

  • 4,612 views
  • 0 comments
  • 17 respects

Arduino Nano "One Digit" Big LED Clock

Video tutorial by Mirko Pavleski

  • 1,531 views
  • 0 comments
  • 6 respects

Scorbot ER-V+ Controller & Simulator Design

Project tutorial by Amit Nandi (BigWiz)

  • 990 views
  • 2 comments
  • 6 respects
Add projectSign up / Login