How to Use Relays to Control Linear Actuators?

How to Control Linear Actuators with DC Relays

Guest Writer
Guest Writer
PA Engineer

Automated mechanisms are becoming more and more popular. They have even moved inside our homes by adjusting the height of desks and hiding a computer monitor below it or lifting a spice rack from under the kitchen counter. In most of these operations, linear actuators are applied.

In this article, we will be going over how to use relay boards to control the motion of linear actuators. We have 2-channel, 4-channel and 8-channel relay boards available, each performing the same task, the only difference being in how many channels are used. As an example, we will be combining the relay boards with our LC-066 Arduino Uno to show off their control capabilities. The relays control the direction in which the actuator moves. They function by using current from the input source to activate an electromagnet, which pulls a switch that allows higher currents on the opposite side of the relay to flow.


Why Use a Relay?

The control over a linear actuator is exercised by a microcontroller that follows the instructions specified in its code. Thus, it tells the mechanism of what to do. However, the actuator by itself does not power the application.

How DC Relays Work

The relay is a switching mechanism, a kind of a smaller switch that controls a bigger one. It doesn’t need the current of the main load to operate thus a little amount of power is sufficient to trigger an electromagnet in it. The latter pulls a switch permitting the flow of a higher current via the opposite side of the relay. Being a fool proof way to control linear actuators even without a microcontroller, relays are widely used as they are cheap and effective. If a microcontroller is employed, however, relays become indispensable. The reason for it is that a Raspberry Pi or Arduino microcontroller can work only with a meagre electrical output. To handle a heavy electrical charge a relay is imperative.


Controlling an Actuator with a Relay

As stated before, relay boards come in 2-channel, 4-channel, and 8-channel modifications but their functioning is essentially the same. The difference, however, lies in the power supply each model requires. Normally, a 2-channel model can operate using a 5V power supply, while higher channel relays consume more power. The first step in wiring the relay components is connecting the power supply to the VCC and GND pins located on the control side of the relay. On the same side, you will find IN pins. This is where you connect the corresponding microcontroller pins.

Photo of a Arduino Uno Rev3 by Progressive Automations


Check out our 2-channel, 4-channel, and 8-channel relay boards!

In a 2-channel board, the top relay is the IN1 and the bottom one is IN2. The 4-channel relay board is labelled, and the 8-channel relay is furnished with diodes (D1 to D8) prompting you the corresponding pin to be connected to it. Relays are activated as soon as the IN pins are connected to the respective GND pins.

Photo of a relay board to control the motion of linear actuators


The second step focuses on the three terminals on the relay side. The top one is the Normally Closed connection (NC) and the bottom one is the Normally Open connection (NO) with the Common connection (COM) between them.


In case the battery is connected to the IN pin (or the IN pin is free from any connection) one should use screws to connect the NC and COM relay terminals. If the IN pin is joined with the GND pin the relay connection between the NO and COM terminals is mandatory.

The board is now wired and thus ready to program for further usage. Once it is done your device is ready for operation. Below is an example showing how the programming works.

const int forwards = 7;
const int backwards = 6;//assign relay INx pin to arduino pin
void setup() {
pinMode(forwards, OUTPUT);//set relay as an output
pinMode(backwards, OUTPUT);//set relay as an output
void loop() {
digitalWrite(forwards, LOW);
digitalWrite(backwards, HIGH);//Activate the relay one direction, they must be different to move the motor
delay(2000); // wait 2 seconds
digitalWrite(forwards, HIGH);
digitalWrite(backwards, HIGH);//Deactivate both relays to brake the motor
delay(2000);// wait 2 seconds
digitalWrite(forwards, HIGH);
digitalWrite(backwards, LOW);//Activate the relay the other direction, they must be different to move the motor
delay(2000);// wait 2 seconds
digitalWrite(forwards, HIGH);
digitalWrite(backwards, HIGH);//Deactivate both relays to brake the motor
delay(2000);// wait 2 seconds


Linear actuators are used in many industrial and domestic environments necessitating precise positioning. In either case, supplying the device with a relay will provide you with wider automation options and greater flexibility for controlling it. We have also included a video showing off what we have explained in this article. If you wish to learn more about our linear actuators and motion control devices check out our blog for a variety of different articles like this. You can also contact us and talk to one of our on-staff expert engineers to answer some of your more specific questions.

Please wait...