Tim's Servo Tester

by Palingenesis in Circuits > Tools

43 Views, 0 Favorites, 0 Comments

Tim's Servo Tester

Tims Servo Tester 001.png
Micro servo SG90_photo.png
Tim's Servo Tester [The Prototype]

There are plenty of cheap servo testers on the market — and for basic tasks, they work well. Most simply rotate a servo by turning a knob, which was perfectly fine back in the days of analogue servos, when “does it move?” was all you needed to know.

But modern servos — especially digital ones — are far more capable, and far more varied. Most budget testers still operate within the traditional servo control range: 1ms to 2ms pulse width at 50Hz frequency. That’s no longer enough.

Today’s servos often contain dedicated microcontrollers. Manufacturers have extended the usable pulse width range to 0.5ms to 2.5ms, and many servos now support higher PWM frequencies — up to 300Hz. If your tester can’t reach those extremes, you’re not seeing the full behaviour of your servo.

One thing remains consistent: 1.5ms pulse width is the midpoint for nearly all servos. But the amount of travel on either side of that midpoint varies widely. Using only 1ms to 2ms, you’ll often get just 90° total rotation — 45° each side. To achieve a full 180° sweep, you need to go beyond.


🔧 Why I Built My Own Tester

My tester allows:

  1. Pulse width adjustment from 0.4ms to 2.6ms
  2. Fine control in 0.01ms steps, and 1µs precision when holding a button — perfect for measuring deadband
  3. Selectable frequencies: 50Hz, 100Hz, 150Hz, 200Hz, 250Hz, 300Hz
  4. Live square wave display, showing Pulse Width, Period, and expected Angle


🤖 Why It Matters

Servos aren’t just for RC planes anymore. They’re everywhere in robotics, where precise control, repeatability, and matching behaviour between units really matters.

Microcontrollers give us the ability to position servos with sub-degree accuracy — but only if we understand the servo’s true limits.

This tester lets you:

  1. Explore a servo’s full range
  2. Measure its deadband
  3. Match pairs for synchronized movement
  4. See how it responds to different frequencies


🛠 What You'll See in This Instructable

I’ll show both the Prototype and the Pro version of the tester.

The prototype is ideal for hobbyists and experimenters.

The Pro version

— Made with the help of PCB from PCBWay.

— Is built for reliability and polish.

Whether you're building robots, animatronics, or precision control systems, this tester gives you the insight cheap ones just can't.

Supplies

Tims Servo Tester 002.png
STM8S103F Module 02.png
830 Solderless Breadboard.png
Logic Level Converter 01.png
Encoder 15mm Round.png
Button_6x6.png
Dupont Cable.png
Resistors.png
Capacitor Kit.png
LEDs.png
ST-Link v2.png
Micro servo SG90_photo.png
PCBWay logo 1200x1000.png

The Prototype

The prototype is built on a solderless breadboard — ideal for quick testing and experimentation.

Core Components:

  1. 1× Solderless Breadboard (830-point)

Resistors & Capacitors Used for pull-up and debounce — values are flexible depending on your modules:

  1. 2× 4.7kΩ Resistors for the I²C bus (Note: Some OLED modules may need different values or none at all)
  2. 7× 22kΩ Resistors for encoder switch and buttons
  3. 7× 100Ω Resistors for encoder switch and buttons
  4. 7× 100nF Capacitors for encoder switch and buttons

Power Supply & Logic Levelling:

  1. Hobby servos typically run at 5V, but the STM8S103 modules (Small Blue Pill) are designed for 3V — so a logic-level shifter is required.
  2. STM8S103 Module (Make sure the chip ends in 3P — if it ends in 2P, it won’t have enough memory)
  3. Logic Level Shifter Module

Interface Components:

  1. 0.96" OLED SSD1306 I²C 128×64 LCD
  2. Rotary Encoder Switch with push button
  3. Push Buttons

Optional Diagnostic LED:

  1. LED (Blue) — useful for debugging STM8S103F code
  2. 1× 76Ω Resistor

Other Essentials:

  1. Jumper wires and connectors for prototyping
  2. ST-Link V2 Programmer
  3. ST Visual Develop IDE from STMicroelectronics
  4. 1× Servo — for testing and fun

Going Professional

I have ordered my PCB from PCB from PCBWay

Once I’ve received my PCBs and built the Pro version, I’ll share:

  1. A link to my Shared Project
  2. A downloadable parts list for the PCB version

Stay tuned — the Pro build is designed for reliability and polish, and ideal for robotics or precision control setups.

🧱The Prototype

Tims Servo Tester_bb.png
Tims Servo Tester_schem.png

Here are images and files showing how to build the Prototype on a solderless breadboard.

I’ve included:

  1. A Fritzing file (.fzz) — so you can view and modify the layout
  2. PDFs of the schematic and breadboard view — for easy reference and printing
  3. Images showing the physical layout and wiring

These resources will help you understand the circuit in more detail and replicate it accurately.

🧠Programming the STM8S103F

ST-Link v2.png
STM8S103F Module 02a.png
ST-Link.png

To interact with the buttons and display, the STM8S103F microcontroller needs to be programmed.

🧰 What You’ll Need:

  1. ST Visual Programmer Download and install the ST Visual Develop IDE from STMicroelectronics — it includes the programmer tool.
  2. ST-Link v2 USB Programmer This is required to upload code to the STM8S103F.

🔌 Connecting the ST-Link to the STM8S103F

The ST-Link can connect in two ways:

  1. SWIM (Single Wire Interface Module) — this is the method we’ll use for STM8
  2. SWD (Serial Wire Debug) — used for ARM chips, not applicable here

For STM8, you’ll need to connect four wires between the ST-Link and the STM8S103F:

  1. 3.3V
  2. GND
  3. RST
  4. SWIM

These are same-to-same connections — match each pin directly between the ST-Link and the STM8 module.

Your attached images show:

  1. The STM8S103 module with labelled programming pins
  2. The ST-Link device as bought and assembled
  3. The correct wiring setup

💾 Programming the Microcontroller

To program the STM8S103F:

  1. Open ST Visual Programmer
  2. Follow steps 3 to 6.

Note: The attached files have a .s19.txt extension to allow uploading. After downloading, remove the .txt extension so the files end in .s19.

These .s19 files contain the compiled firmware needed to run your Servo Tester.

🛠️Programming [Configuration]

01 Configuration 001.png
01 Configuration 002.png
01 Configuration 003.png

Once you're connected as described in Step 2, you're ready to configure the programmer.

🧭 Selecting the Correct Microcontroller

When you open ST Visual Programmer, it's crucial to select the correct device:

  1. Make sure STM8S103F3 is selected in the dropdown box at the top toolbar (A)
  2. You can also set this in the Configuration Dialog Window (B)

⚙️ Opening the Configuration Window

Follow these steps to configure ST Visual Programmer:

  1. Click Configure on the toolbar (1)
  2. Choose Configure ST Visual Programmer (2)
  3. In the dialog window that opens:
  4. Set Hardware to ST-LINK (3)
  5. Set Port to USB (4)
  6. Set Programming Mode to SWIM (5)
  7. Set Device to STM8S103F3 (6)
  8. Click OK to confirm (7)

⚠️ Notes on Module Variants

I’ve purchased several STM8S103F modules from eBay. So far, I’ve encountered two variants:

  1. STM8S103F2 8 KB ❌ Not compatible
  2. STM8S103F3 16 KB ✅ Works for this project
  3. Only the STM8S103F3 variant works reliably for this build due to its larger flash memory.

💾Programming [PROGRAM MEMORY]

02 Program 001.png
02 Program 002.png
02 Program 003.png
02 Program 004.png

Now that the configuration is complete, it’s time to upload the main firmware to the microcontroller.

🧭 Loading the .s19 File

  1. Select the PROGRAM MEMORY tab (1)
  2. Click File on the toolbar (2)
  3. Choose Open (3)
  4. In the dialog window:
  5. Browse to the location where you downloaded tims_servo_tester.s19 (4)
  6. Select the file (5)
  7. Click Open (6)

🚀 Uploading the Firmware

Once the file is loaded:

  1. Click Program on the toolbar (7)
  2. Select Current tab (8)

The file will now upload to the STM8S103F3 microcontroller.

⚠️ Locked Microcontroller?

If the microcontroller is locked, the upload may fail. In that case, skip ahead to Step 6: Programming — OPTION BYTE, then return here.

🧠Programming [DATA MEMORY]

03 Data 001.png
03 Data 002.png
03 Data 003.png
03 Data 004.png

This step uploads the data memory configuration to the STM8S103F3.

📂 Loading the Data Memory File

  1. Select the DATA MEMORY tab (1)
  2. Click File on the toolbar (2)
  3. Choose Open (3)
  4. In the dialog window:
  5. Browse to the location where you downloaded DATA_MEMORY.s19 (4)
  6. Select the file (5)
  7. Click Open (6)

🚀 Uploading the Data Memory

Once the file is loaded:

  1. Click Program on the toolbar (7)
  2. Select Current tab (8)

The data memory file will now upload to the microcontroller.

🔐Programming [OPTION BYTE]

04 Options 001a.png
04 Options 002.png
04 Options 003.png
04 Options 004.png

The OPTION BYTE tab is used to configure special settings on the STM8S103F3, including unlocking the microcontroller if needed.

🧭 Loading the Option Byte File

  1. Select the OPTIONS BYTE tab (1)
  2. Click File on the toolbar (2)
  3. Choose Open (3)
  4. Browse to the location where you downloaded OPTIONS_BYTE.s19 (4)
  5. Select the file (5)
  6. Click Open

🚀 Uploading the Option Byte

Once the file is loaded:

  1. Click Program on the toolbar (6)
  2. Select Current tab (7)
  3. This will apply the option byte settings to the microcontroller.

✅Prototype Done

Tims Servo Tester 003.png
Tims Servo Tester_bb.png

Once the prototype has been assembled, you're ready to start testing your servos.

  1. This setup supports servos running at up to 5 volts
  2. Connect your power supply and servo as shown in the Fritzing breadboard image

🛠️Lets Go Pro.

PCBWay logo 1200x1000.png
Tims Servo Tester 004.png
Tims Servo Tester 005.png
Tims Servo Tester 006.png
Tims Servo Tester 007.png

I've designed a custom PCB for this project, and it's currently being manufactured by PCB from PCBWay.

  1. Their service is fast — but I’m on a budget, so I went with the slower, cheaper mail option
  2. The 3D views show the board layout and component placement
  3. Once the PCBs arrive, I’ll assemble the final version and upload a finished video

You can get my PCB from my Shared Projects: Tim's Servo Tester. at PCB from PCBWay.

Stay tuned — this step will be updated with build photos, soldering tips, and final testing once the boards are in hand.

📺Fitting the Display

Tims Servo Tester 008.png
Tims Servo Tester 009.png
Tims Servo Tester 010.png

The display I’ve used is a 0.96" I²C OLED module — a popular choice, but with a frustrating twist:

  1. These modules are monochrome, though some versions use different coloured LEDs (e.g. yellow/blue split) to highlight the top two pages like a header
  2. Pin arrangements vary wildly between manufacturers — especially for GND, VCC, SDA, and SCL
  3. To handle this, I’ve added solder jumper pads on the PCB:
  4. Pins 1 & 2 can be configured for GND and Power
  5. Pins 3 & 4 can be configured for SDA and SCL
  6. You’ll need to solder the jumpers to match your specific display’s pinout — I’ve included an example using one of my modules

For a cleaner, lower-profile fit:

  1. I’ve soldered the display directly to the PCB using header pins
  2. No pin sockets — this keeps the module snug and compact
  3. Images show the jumper configuration and how the display sits over the board.

Using the Servo Tester

Tims Servo Tester 011.png

🧭 Using the Servo Tester

Main Control: Rotary Encoder Switch

  1. Pressing the encoder toggles between Pulse Width and Period modes.
  2. A cursor on the display indicates the current mode.
  3. Rotating the encoder adjusts the value for the selected mode.

🧪 Deadband Testing To test servo deadband:

  1. Hold down the “1µs” button while rotating the encoder in Pulse Width mode.
  2. This adjusts the pulse width in 1µs steps, allowing you to find the smallest change that causes the servo horn to move.

📶 Frequency Control

  1. Modern servos often include dedicated microcontrollers — that’s why they’re called digital servos.
  2. In Period mode, rotating the encoder changes the signal frequency sent to the servo.
  3. Available frequencies: 50Hz, 100Hz, 150Hz, 200Hz, 250Hz, 300Hz
  4. Frequency is capped at 300Hz to allow for extended pulse widths (0.5ms to 2.5ms).
  5. Some racing servos support higher frequencies (e.g. 500Hz), but only with standard pulse widths.
  6. You can’t have both extended pulse width and high frequency — the longer pulse won’t fit in a shorter cycle.

🎯 Pre-Set Positions

  1. 1.5ms – Standard center position for most servos.
  2. 1ms – Typically -90°, but may vary with extended pulse width servos.
  3. 2ms – Typically +90°, also varies with extended pulse width servos.

📐 Angle Display

  1. Based on classic analog servos: assumes 180° movement between 1ms and 2ms.
  2. Modern digital servos may move less or more — the displayed angle may not match actual movement.
  3. Some servos only move 90° total, even if the display shows 180°.

⚙️ Pulse Width Notes

  1. The only consistent standard is that 1.5ms means center position.
  2. Beyond that, pulse width ranges vary by manufacturer:
  3. Some support extended ranges (e.g. 0.5ms to 2.5ms).
  4. Others are fixed at 1ms to 2ms.

📡 Transmitters and Receivers

Digital Systems

  1. Built around microcontrollers.
  2. Support:
  3. Custom pulse widths.
  4. Servo type selection.
  5. Endpoint adjustment.
  6. Sub-trim and travel.
  7. Ideal for extended rotation or non-standard setups.

Analog Systems

  1. Use fixed circuitry (e.g. 555 timers).
  2. Pulse width locked to 1ms–2ms.
  3. No software configurability — changes require hardware mods.
  4. May limit servo movement and prevent full use of extended-range servos.