Maker.io main logo

How to Automate Linear Actuator Using Arduino & Visual Programming

2025-10-08 | By Ron Cutts

License: General Public License DC Motor Drivers / Controllers Motors Arduino

 

In this step-by-step tutorial, you’ll discover how to create sequences that control your actuator with precise timing (in milliseconds or even microseconds). You’ll also see how to set the speed and direction of movement, giving you complete automation control. Perfect for beginners and advanced makers, this project shows just how easy it is to bring your actuator to life with Arduino + Visuino visual programming.

Step 1: What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

  1. Arduino UNO (Or any other Arduino)

  2. Linear Actuator

  3. L298N DC Motor Driver

  4. Jumper wires

  5. Power Supply

  6. Visuino program: Download Visuino

Step 2: The Circuit

The Circuit

  1. Connect the Power supply (batteries) pin (gnd) to the motor driver controller pin (gnd)

  2. Connect Power supply (batteries) pin (+) to motor driver controler pin (+)

  3. Connect the Power supply (batteries) pin (+) to the Arduino pin (VIN)

  4. Connect the GND from the Arduino to the motor driver controller pin (GND)

  5. Connect digital pin(6) from Arduino to motor driver pin (IN1)

  6. Connect digital pin(8) from Arduino to motor driver pin (IN2)

  7. Connect the Linear Actuator to the motor driver, as you can see on the schematic

Step 3: Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino as shown in the first picture. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino. When the dialog appears, select "Arduino UNO" as shown in Picture 2

Step 4: In Visuino, Add Components

In Visuino Add Components

In Visuino Add Components

In Visuino Add Components

In Visuino Add Components

In Visuino Add Components

In Visuino Add Components

  1. Add "Sequence" component

  2. Add "Analog Value" component

  3. Add "Start" component

  4. Add "Toggle(T) Flip-Flop" component

  5. Add "Speed and Direction To Speed" component

  6. Add "Dual DC Motor Driver Digital and PWM Pins Bridge (L9110S, L298N)" component

Step 5: In Visuino Set Components

In Visuino Set Components

In Visuino Set Components

In Visuino Set Components

In Visuino Set Components

In Visuino Set Components

Double click on the "Sequence1" and in the Elements window drag to the left as many "Digital period" elements as you like. In this example, we will add 4 "Digital period" elements, and for each, we will set the Delay in the properties window:

  1. Digital Period1: 1000

  2. Digital Period2: 6000

  3. Digital Period3: 10000

  4. Digital Period4: 15000

Double click on the "AnalogValue1" and in the Elements window drag to the left as many "Set Value" elements as you like. In this example, we will add 4 "Set Value" elements, and for each, we will set the Value in the properties window:

  1. Set Value1: 1000

  2. Set Value2: 6000

  3. Set Value3: 10000

  4. Set Value4: 15000

Step 6: In Visuino Connect Components

imageimage

  1. Connect "Start1" pin [Out] to "Sequence1" pin [Start]

  2. Connect "Sequence1" > "DigitalPeriod1" pin [Out] to "AnalogValue1" > "Set Value1" pin [In]

  3. Connect "Sequence1" > "DigitalPeriod1" pin [Out] to "TFlipFlop1" pin [Set]

  4. Connect "Sequence1" > "DigitalPeriod2" pin [Out] to "AnalogValue1" > "Set Value2" pin [In]

  5. Connect "Sequence1" > "DigitalPeriod2" pin [Out] to "TFlipFlop1" pin [Reset]

  6. Connect "Sequence1" > "DigitalPeriod3" pin [Out] to "AnalogValue1" > "Set Value3" pin [In]

  7. Connect "Sequence1" > "DigitalPeriod3" pin [Out] to "TFlipFlop1" pin [Set]

  8. Connect "Sequence1" > "DigitalPeriod4" pin [Out] to "AnalogValue1" > "Set Value4" pin [In]

  9. Connect "Sequence1" > "DigitalPeriod4" pin [Out] to "TFlipFlop1" pin [Reset]

  10. Connect "AnalogValue1" pin [Out] to "SpeedAndDirectionToSpeed1" pin [Speed]

  11. Connect "TFlipFlop1" pin [Out] to "SpeedAndDirectionToSpeed1" pin [Reverse]

  12. Connect "SpeedAndDirectionToSpeed1" pin [Out] to "DualMotorDriver1" > [Motors.Item[0] pin [In]

  13. Connect "DualMotorDriver1" > [Motors.Item[0].Direction] pin [Out] to "Arduino" pin Digital pin [8]

  14. Connect "DualMotorDriver1" > [Motors.Item[0].Speed] pin [Out] to "Arduino" pin Digital > Analog PWM pin [6]

Step 7: Generate, Compile, and Upload the Arduino Code

Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom, click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Step 8: Play

If you power the Arduino module, the Linear Actuator will start to move according to your settings...

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project that I created for this. You can download it here and open it in Visuino: https://www.visuino.eu

Download Visuino file: Linear-Actuator-Sequence.visuino

Mfr Part # A000066
ARDUINO UNO R3 ATMEGA328P BOARD
Arduino
$226.62
View More Details
Mfr Part # BB-L298
EVAL BOARD FOR L298
Olimex LTD
Mfr Part # FIT0805
6V ELECTRIC PUSH ROD 50MM-128N
DFRobot
$221.70
View More Details
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.