I’ve just recently bought my first Raspberry Pi and opted for a Pi 5 as it was the latest.

I’ve had no luck getting gpiozero or gpiod working with Python and my MG996R servos yet.

I don’t mind if it’s not the ‘best’ possible servo control as I’m just experimenting with servos for the first time.

However I can’t find any example python cose That actually allows me to control a Servo.

All examples for previous raspberry pi versions do not work on the Pi 5

Is something ‘official’ coming out soon or can someone point me at some sample python code that works with Raspberry Pi 5.

I want to start playing with my new toy

2 Answers 2


Noobie here,

I'm struggling with something similar, I tried to connect a RFID-RC522 module on a pi 5. Apparently, the new chip doesn't support the old RPi.GPIO library. You need to use GPIOZERO for the scripts. Go through it, you might find something that works for you.

Good luck


Try Joan's lgpio which has timed PWM. There are examples https://abyz.me.uk/lg/py_lgpio.html#tx_servo.

This is also the library used by the latest gpiozero V2 (which has examples).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.