Skip to content

I2C Servo Controllers

Related Config File Sections:

MPF currently supports PCA9685/PCA9635 based servo controllers via I2C. One example for such a controller is the Adafruit 16-Channel 12-bit PWM/Servo Driver. You can use any I2C platform supported by MPF (see I2C Platforms in MPF).

Overview video about servos:

1. Installing I2C Servo Controllers

Connect the controller to the I2C port and add the following config section:

hardware:
  servo_controllers: i2c_servo_controller

0x40 is actually the default I2C address for this chip but it might be different for some chips.

2. Add your servos

Add your servos to config:

servos:
  servo1:
    number: 0  # first servo on controller

All these config options are explained in-depth in the servos: section of the config file reference.

You can also provide an I2C address per servo:

servos:
  servo_on_controller_63_0:
    number: 63-0  # first servo on board with ID 0x3F / 63
  servo_on_controller_63_1:
    number: 63-1  # second servo on board with ID 0x3F / 63

What if it did not work?

Have a look at our hardware troubleshooting guide.


Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results