I’m looking to make a drone capable of deploying a parachute, so I need a servo release mechanism.
How can I configure a servo and map it to a switch in Betaflight?
Drones and Model Aircraft Stack Exchange is a question and answer site for experienced flyers, pilots, and builders of drones and model aircraft. It only takes a minute to sign up.Sign up to join this community
There are multiple ways to enable servos in BetaFlight, but since you need only one servo it is recommended to use
For servo to work you need a free pin on your board and this pin must have timer function.
Then setup the switch you want to use on your transmitter and in Betaflight. Let's say it was AUX4. Make sure it shows in the Receiver tab and that the signal is received.
Then go to the CLI tab and type
resource list for older BF) and hit Enter.
What you're looking for is resources with
PWM function. For example on my board there are 6
MOTOR outputs. I assume you fly 4-motors copter and you also have some spare
You need to remember the MCU pin and MOTOR number and of an output you want to use (
MOTOR 5 for me).
Then you need to type:
resource MOTOR 5 NONE
resource SERVO 1 C09
Use your own MOTOR and MCU pin number instead of 5 and C09!
This will remap MOTOR5 pad to be able to work with PWM Servos.
Servos numbering in CLI starts from 1
Go to the Servos tab in Configurator and hit the checkbox with with your AUX channel on Servo 0 row (AUX4 for me). If you can't see the servos tab check "Enable Expert Mode" on the top right.
Servo numbering on the Servos page starts from 0. So
Servo 1 from CLI tab is
Servo 0 here.
Now you've remapped MOTOR 5 pad to act as a servo output. You can connect your servo's signal wire to it and find any spare +5V and ground pads for it.
If you don't have any spare MOTOR or PWM pad you can remap
LED_STRIP 1 resource if you're not using it for LED.
Here's the guide how you can do this: https://youtu.be/jiD6aC0l1VQ
If you need more than 2 servos to control check Sources for how to use
Channel Forwarding instead.
What you're looking for is Betaflight servo control. It's a bit tricky because the pad you use to drive the servo signal has to have it's own timer. The LED control function requires a timer, so using the LED pad is typically the most reliable method, but you can check the betaflight resource information to find other pads that have a timer available.
Beyond that you'll need to remap the pin resource via the "resource" command in CLI from whatever function you're stealing it from to a SERVO resource (starting with 1 and moving up if you have additional servos). You'll need a pad with a dedicated timer for each servo, though, so keep that in mind.
Once that is done, enable expert mode in betaflight and go to the Servo tab. There you can assign the servo to the correct transmitter channel.
For a full walkthrough, check out Bardwell's video on servo setup in Betaflight here. For more details, check out the Betaflight Wiki here.