How to make a DIY servo motor tester with the Arduino

How to make a DIY servo motor tester with the Arduino

Hello, and welcome back. In this project, we will learn how to make a servo motor tester using an Arduino pro-mini board. I used simple methods for that. Therefore, everyone can easily create it. Also through this project, we can control two servo motors at the same time. If you want you can create a PCB(Printed Circuit Board) for this project. But I used a piece of dot board. Now you can see below the different types of servo motor testers in the market.

How to make a DIY servo motor tester with the Arduino

But don’t worry we will make it step by step at home. The required components are given below.

Step 1

Firstly, identify these components.

Step 2

Secondly, solder the Arduino pro-mini board to the dot board as you like.If you want you can connect it through the female pin headers.

Step 3

Thirdly, connect the 2 pin terminal near the Arduino board.

Step 4

Then, connect it to the Arduino board. For that, use the circuit wires. The circuit diagram is below.

How to make a DIY servo motor tester with the Arduino

Step 5

Next, solder the potentiometer to the dot board and connect it to the Arduino board.

Step 6

Ok, then attach the pin headers as follows. After, connect it to the Arduino board.

OK, the controller is finished. I think it was done according to the circuit diagram above.

Step 7

Now, let’s program this controller using the Arduino UNO board. For that follow the steps below.

  • First, connect this controller to the Arduino UNO board. To do this, use the circuit diagram below.
How to make a DIY servo motor tester with the Arduino

Step 8

Next, connect it to the computer and remove the RX and TX jumper wires.

Step 9

Now select board and port. After, upload an empty sketch to the Arduino UNO board.

Step 10

  • Then, reconnect the RX and TX jumper wires and upload the program to the Arduino pro-mini board. The program is below.

The complete program of this project — Download

/*Servo motor tester.
 * http://srituhobby.com
 */
#include <Servo.h>
Servo servo;
#define tester A0
void setup() {
  Serial.begin(9600);
  servo.attach(11);
}
void loop() {
  int value = analogRead(tester);
  value = map(value, 0, 1024, 0, 180);
  Serial.println(value);
  servo.write(value);
}

Code explanation

First, the servo motor library is included and an object was created. Also, the potentiometer analog pin is defined.

#include <Servo.h>
Servo servo;
#define tester A0

In the setup function, the serial monitor is started and the servo pin is included.

void setup() {
  Serial.begin(9600);
  servo.attach(11);
}

In the loop function, the analog value of the potentiometer is read, and this value is converted from 0 to 180. Later, this value is written on the servo.

void loop() {
  int value = analogRead(tester);
  value = map(value, 0, 1024, 0, 180);
  Serial.println(value);
  servo.write(value);
}
  • Now, select board and port.
  • Finally, click the upload button and press the reset button when the program is uploading.

OK, now remove the Arduino UNO board and connect the external power supply(5v to 12v) to the controller board. After, connect the servo motors to it. So, enjoy this project. The full video guide is below. We will meet in the next project.

How to make a DIY servo motor tester with the Arduino

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart