Skip to main content

A Simple USB to Servo Adapter that works.

The Servo Adapter allows python programs to connect to RC Servos using off the shelf low cost boards such the Raspberry Pico or SparkFun Pro Micro - RP2040. The Servo Adapter appears on the computer as a serial port (no device installation required) and acts as a USB to Servo bridge, with the servo_adapter Python package providing an easy to use API.

For example, the diagram below shows the wiring of a servo to one of the 8 servo outputs of the Servo adapter.



Highlights

  • Support up to 8 independent servo channels.
  • Hardware based 1us resolution servo PWM timing generation.
  • Supports Windows/Mac/Linux.
  • Uses low cost low cost off-the-shelf boards as adapters.
  • Does not require driver installation (it appears on the computer as standard a serial port).
  • Comes with an easy to use Python API.
  • Easy to modify/extend and to adapt to new hardware.
  • Permissive open source license. Comercial use OK, sharing and attribution not required.
  • Provides additional 8 general purpose auxilary input/output signals.

Python API Example

Package installation

pip install servo-adapter --upgrade

In the example below, we use an Servo Adapter that control a servo that is connected to servo output 0.

import time
from random import randrange
from servo_adaptr import ServoAdapter

# Serial port name. Adapt to your system.
port = "/dev/tty.usbmodem1101"

# Connect to adapter and enable PWM servo out 0.
adapter = ServoAdapter(port=port)
adapter.set_servo_state(0, True)

while True:
    # Random pulse width in the range 1000us to 2000us.
    pw_us = 1000 + randrange(1000 + 1)
    adapter.set_servo_pulse_width(0, pw_us)
    time.sleep(1.0)

Documentation

Full documentation is available at https://servo-adapter.readthedocs.io/

Metadata

Release files for servo-adapter 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for servo-adapter 0.0.3
File Size Uploaded
servo_adapter-0.0.3.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for servo-adapter 0.0.3
File Interpreter ABI Platform
servo_adapter-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / servo_adapter-0.0.3.tar.gz

Download URL servo_adapter-0.0.3.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
79e3813d966e88f94d51382a337807335a12a911c27c6d43f8a6e74354997884
BLAKE2b-256 checksum
How to use checksums
2868dc1e12ade69d37355ffd8fac7d42dae6ae48fd3f4d2c8fe5e83fe64426e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.1

Release files / servo_adapter-0.0.3-py3-none-any.whl

Download URL servo_adapter-0.0.3-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c61a03c094092871ebf3070a084dfd0ccf2ef469f9c8e0a99710ca0277ea5d58
BLAKE2b-256 checksum
How to use checksums
7bc92bcfdd704b392c84ef95e48706f7fea42756595ce77482aea15a3617b3d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page