Arduino Nano - Feedback Actuator
In a prior tutorial, we discussed the linear actuator without feedback. Now, we will be exploring the feedback linear actuator (also known as the feedback linear actuator). This type of actuator provides information to determine the position of its stroke and then control it. Specifically, we will be looking at:
- The workings of a feedback linear actuator
- How to identify the position of a feedback linear actuator (in millimeters)
- How to control the position of a feedback linear actuator

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of Feedback Linear Actuator
A linear actuator with feedback is available, which provides a signal to identify its position and control it. This feedback is in the form of a potentiometer that outputs a voltage value that is proportional to the stroke's position.
Feedback Linear Actuator Pinout
A Feedback Linear Actuator has 5 wires:
- Actuator Positive wire: This wire is used to control the linear actuator by utilizing high voltage (12V, 24V, 48V...).
- Actuator Negative wire: This wire is used to control the linear actuator by utilizing high voltage (12V, 24V, 48V...).
- 5V wire: this wire is used for the feedback potentiometer. Connect this wire to 5V or 3.3V
- GND wire: this wire is used for the feedback potentiometer. Connect this wire to GND
- Potentiometer wire: (also called feedback wire, or output wire) this wire outputs the voltage value in proportion to the stroke's position.

How It Works
If we supply high voltage to the positive and negative wires, the stroke of the actuator will be extended or retracted. Specifically:
- If 12V (12V, 24V, 48V...) is connected to the positive wire and GND to the negative wire, the linear actuator will extend at full speed until it reaches the limit.
- If 12V (12V, 24V, 48V...) is connected to the negative wire and GND to the positive wire, the linear actuator will retract at full speed until it reaches the limit.
- If power is stopped to the actuator (GND to both positive and negative wire), the actuator will cease extending/retracting.
※ NOTE THAT:
- The voltage necessary for operating the actuator is determined by its specifications. To find out the exact voltage value, consult the datasheet or manual.
- Even when power is cut off, the actuator can maintain its position while carrying a load.
The voltage in the potentiometer wire is related to the stroke's position on the actuator. By measuring this voltage, we can determine the stroke's position.
Wiring Diagram
The two power wires of the actuator go to a BTS7960 motor driver. This driver has one strong H-bridge, works with 5.5V to 27V on its B+ / B- terminals and can take up to 43A at the peak. That matters, because an actuator draws a big current when it starts and when it stops at the end of its stroke. The three small feedback wires go straight to the Arduino Nano.

Keep the 12V adapter unplugged while you connect the wires.

This image is created using Fritzing. Click to enlarge image
| From | Connect To |
|---|---|
| BTS7960 RPWM | Arduino Nano D9 |
| BTS7960 LPWM | Arduino Nano D10 |
| BTS7960 R_EN | Arduino Nano D12 |
| BTS7960 L_EN | Arduino Nano D11 |
| BTS7960 VCC | Arduino Nano 5V |
| BTS7960 GND | Arduino Nano GND |
| BTS7960 B+, B- | + and - of the 12V power adapter (via the DC power jack) |
| BTS7960 M+, M- | actuator positive and negative wires |
| Actuator 5V wire | Arduino Nano 5V |
| Actuator GND wire | Arduino Nano GND |
| Actuator potentiometer wire | Arduino Nano A0 |
You can also mount the Arduino Nano on a Screw Terminal Expansion Board for Arduino Nano. Each wire then sits under its own screw, which is safer than a jumper wire on a moving machine. The drawing below shows how:

This image is created using Fritzing. Click to enlarge image
See The best way to supply power to the Arduino Nano and other components.
How to control extend/retract a linear actuator
Check out the tutorial on Arduino Nano - Actuator.
In short, with R_EN and L_EN HIGH: a PWM value on RPWM (and 0 on LPWM) extends the actuator, a PWM value on LPWM (and 0 on RPWM) retracts it, and 0 on both stops it.
How to find the position of the linear actuator
This is an example of how to locate the stroke on a linear actuator. It provides an illustration of the process.
Calibration
- Determine the length of the actuator's stroke (in millimeters) by either measuring it with a ruler or consulting the datasheet.
- Run the following code to determine the output values when the linear actuator is fully extended and fully retracted.
- Observe the log on the Serial Monitor as demonstrated in the example below.
Make a note of the following three values and update them in the code below: the minimum value, the maximum value, and RPWM_PIN and LPWM_PIN. If the minimum and maximum values are swapped, also swap RPWM_PIN and LPWM_PIN.
Arduino Nano code that calculate the position of the actuator
- Refresh the three calibrated values in the code
- Transfer the code to Arduino Nano
- Check the outcome on Serial Monitor