element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Data Conversion
  • Challenges & Projects
  • Project14
  • Data Conversion
  • More
  • Cancel
Data Conversion
Blog Micro Servo motor Tester #1 : The Initial Prototype
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Data Conversion to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dubbie
  • Date Created: 25 Feb 2021 5:02 PM Date Created
  • Views 2925 views
  • Likes 10 likes
  • Comments 9 comments
  • nano
  • 10 turn pot
  • micro servo tester
  • dataconverch
  • adc
Related
Recommended

Micro Servo motor Tester #1 : The Initial Prototype

dubbie
dubbie
25 Feb 2021

For the Data Conversion Project14 challenge I decided that I wanted to use a multi-turn potentiometer so I have started to make a micro servo motor tester. I have wanted a  servo motor tester for some time but didn't want to spend any money, plus I could always knock together a Nano project that did the job. So combining a multi-turn pot with a Nano to make a proper piece of test equipment seemed a good idea. I also wanted to try and make a good looking 3D printed casing to go with this - which is not going quite so well.

 

Multi-Turn Potentiometers

 

I original wanted to use digital potentiometers but after looking around I realised that what I thought a digital potentiometer was not what most digital potentiometers were. I wanted a digital potentiometer that provided many steps per revolution, something like 100 but nothing like that seems to exist at a sensible price. Instead I have used 10 turn wire wound potentiometers instead which should provide me with the resolution I wanted (100 steps per revolution) and multi-turn capability (well - 10 turns anyway). I found some reasonably low cost potentiometers so purchased a pack of five (ZHITING 5pcs WXD3-13-2W 10K Ohm Multi-Turn Wirewound: AmazonSmile: Electronics). I was expecting these to be relatively small but they are quite big which makes the 3D printed casing a bit more of a challenge. However, that is for the future.

 

Circuit Diagram

 

The complete circuit is fairly simple, consisting of two potentiometers (I wanted to control the frequency and pulse width eventually) so two analogue inputs, a Nano and three LEDs, just for some user interfacing, (three digital outputs), plus the digital output for the micro servo motor. The prototype circuit is illustrated below. For the future I will also add some buttons to select various functionality, plus some sort of battery power supply to make it completely independent.

 

image

 

I wired this all together using a small protoboard and 3D printed a rectangular front plate just to keep it all tidy. The potentiometers didn't come with any knobs so I 3D printed some. They do not look brilliant but they do the job. For the final version I might (maybe) create a more attractive 3D printed knob.

 

Programme

 

The programme is correspondingly simple, at this point. All it does is flash the blue LED for 500 ms at the beginning of the programme, just to show to the user that everything is working. Then it enters an infinite loop where it reads the ADC (from the right hand 10 turn potentiometer) and uses that to create a microsecond delay between 200 and 2000 us, followed by the required 18 ms space delayed needed for the micro servo motor. The Nano uses 10 bit ADCs so for a 10 turn potand to use the whole range each turn is dividied into 100 increments. The default reference voltage is 5V so with 1000 increments this provides a quantisation step of 0.005 V or 5 mV. The conversion from the ADC value to microseconds was achieved empirically. For a more robust future version some sort of proper calibration will be needed. I'm not sure at this stage how stable this conversion process is and to be honest, I'm sure how I might find out, but it is good enough for my testing purposes.

 

There is a serial text output sequence but I am only using it for testing and it should not affect the timings as most of the text is sent during the 18 ms space delay of each pulse. The Arduino programme is listed below. It works so is satisfactory at present.

 

/*  Dubbie Dubbie

*  Servo Tester and Pulse Generator

* 

*  5th Feb'21

*  Just for Fun

*/

 

#define ledblue  2

#define ledwhite 4

#define ledred   6

#define adcwidth A0

#define adcfreq  A1

#define testservo 8

 

void setup(void)

{

  pinMode(ledblue, OUTPUT);

  pinMode(ledwhite, OUTPUT);

  pinMode(ledred, OUTPUT);

  pinMode(testservo, OUTPUT);

  digitalWrite(ledblue, LOW);  

  digitalWrite(ledwhite, LOW);  

  digitalWrite(ledred, LOW);

  digitalWrite(testservo, LOW); 

  delay(100);        

  Serial.begin(19200);

} /* setup */

 

void loop(void)

{

 

int width;

int freq;

 

width = 0;

freq = 0;

 

Serial.println("Servo Motor Tester " );

Serial.println("Dubbie Dubbie : Just for Fun " );

Serial.println(" 5th Feb'21 ");

Serial.println();

delay(500);

 

  digitalWrite(ledblue, HIGH);   // Shows it's working

  delay(500);

  digitalWrite(ledblue, LOW);  

 

while(1)

  {

    digitalWrite(testservo, HIGH);

    delayMicroseconds(200);       // Start of the 1 ms pulse

    delayMicroseconds(width);     // Makes up the rest of the pulse

    digitalWrite(testservo, LOW);

    Serial.println(width);

    width = analogRead(adcwidth); //Assumes 100 us conversion time

    width = width * 2;

 

    delay(18);                    // The rest of the pulse

  } /* while */ 

} /* loop */

 

The Working System

 

Power is currently supplied from a USB connection used for programming and debugging which should be enough for a single micro servo motor. A video showing the operation of the system is shown below.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

(Note : In the video I do say it provides 10 steps per revolution, it is actually 100 steps per revolution.)

 

It seems to work quite well and I can now test out micro servo motors, including the continuous rotation ones and I have already tested two servo motors. Even in this prototyping stage the indicators are that this will be a good project.

 

Future Options

 

When designing this system I thought it would be a useful additional function to be able to act as a pulse generator (variable frequency as well as variable pulse width), which is why there are two 10 turn potentiometers. This will be a future step as it gets a little bit more complicated on determining the required pulse widths when frequency is also being varied. I will need to add some user input, probably at least one push button, to be able to select between the two different modes: servo tester or pulse generator. When in pulse generator mode it would be good to have some feedback to the user as to the actual frequency and pulse width being output and some sort of graphic display seems a good idea, so I might do the display part first.

 

Dubbie

  • Sign in to reply

Top Comments

  • milosrasic98
    milosrasic98 over 4 years ago +6
    Great project! I love the use of the 10 turn potentiometer. I've made a crude version of that also using an Arduino Nano, but with using only a single turn potentiometer. I've been thinking of maybe upgrading…
  • milosrasic98
    milosrasic98 over 4 years ago in reply to dubbie +4
    This was just a small thing I made for testing out a gripper, I posted it on here, but as a part of a blog here: Servo Tester . Here are some pictures of the inside: It was a powered over a USB micro port…
  • DAB
    DAB over 4 years ago +3
    Nice update. I like the fine movement control. DAB
  • dubbie
    dubbie over 4 years ago in reply to milosrasic98

    Milos,

     

    I remember the Cookie Jar project. I must just have been paying attention to the servo tester item - at the time I wasn't looking for one.

     

    I did see the commercial servo tester that you pictured,  but it didn't look very impressive to me so in the end decided to make my own rather than purchase.

     

    Dubbie

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • milosrasic98
    milosrasic98 over 4 years ago in reply to dubbie

    This was just a small thing I made for testing out a gripper, I posted it on here, but as a part of a blog here: Servo Tester. Here are some pictures of the inside:

    image

    image

    It was a powered over a USB micro port and just has an Arduino Nano and potentiometer inside. I put 2 capacitors inside for safe measure to keep it a bit more stable as I had bad experience with some servos drawing a lot of power on start up. Besides that, it's just a 2 part 3D printed case with small clips. I've also uploaded the files if anyone wants to modify them ( https://github.com/MilosRasic98/1MeterOfPi/tree/main/3D%20models/Servo%20Tester  ), but it would need a lot of modification to fit 2 10 turn pots. I've also looked into buying something simple, and this is the thing that would pop up constantly:

    image

    I will be remaking this now for sure, thanks for the inspiration. I like the 10 turn pots, also your plan for having variable frequency.

     

    Milos

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 4 years ago in reply to milosrasic98

    Milos,

     

    Is this an Element14 project? I had a look before I started mine - I was even thinking of buying one if I found something useful (I didn't!).

     

    Dubbie

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 4 years ago in reply to DAB

    DAB,

     

    I know, I was impressed myself.

     

    Dubbie

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • neilk
    neilk over 4 years ago

    Nice project, Dubbie. Great idea to use a 10 turn pot/

     

    Neil

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube