Control Linear Servo Actuator With Potentiometer Using Visuino

by RonFrtek in Circuits > Arduino

93 Views, 1 Favorites, 0 Comments

Control Linear Servo Actuator With Potentiometer Using Visuino

Control Linear Servo Actuator with Potentiometer using Visuino

In this tutorial you will learn how to Control Linear Servo Actuator with Potentiometer and Arduino using Visuino program.

Watch the video!

What You Will Need

2024-10-24_11-31-09.jpg
VisuinoAdvrtisemenPortentaC33.png
potentiometer.jpg
F5OFEUQJJ4ZYFKY.LARGE.jpg
FZEK4WBK3XGYAP0.LARGE.jpg
  1. Arduino UNO (Or any other Arduino)
  2. Linear Servo Actuator
  3. Potentiometer module
  4. Power Supply
  5. Visuino program: Download Visuino


The Circuit

2024-10-24_11-40-13.jpg
  1. Connect Servo motor "Orange" (signal) pin to Arduino Digital pin[2]
  2. Connect Servo motor "Red" pin to Arduino positive pin[5V]
  3. Connect Servo motor "Brown" pin to Arduino negative pin[GND]
  4. Connect potentiometer module pin [Out] to arduino analog pin [A0]
  5. Connect potentiometer module pin [VCC] to arduino pin [5V]
  6. Connect potentiometer module pin [GND] to arduino pin [GND]


Start Visuino, and Select the Arduino UNO Board Type

select-board-uno.jpg
Visuino-Select-Board-UNO.jpg

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 on Picture 2

In Visuino Add & Connect Components

2024-10-24_15-28-51.jpg
2024-10-24_15-30-53.jpg
2024-10-24_15-31-09.jpg
linear-servo.png
  1. Add "Ramp To Analog Value" component (This component is not necessary, but it ads a smooth start of the servo, so it is recommended, you can adjust the values in the properties window)
  2. Add "Servo" component


  1. Connect Arduino analog pin [0] to "RampToValue1" pin [In]
  2. Connect "RampToValue1" pin [Out] to "Servo1" pin [In]
  3. Connect "Servo1" pin [Out] to Arduino digital pin [2]

Generate, Compile, and Upload the Arduino Code

Visuino-Compile-UNO.jpg

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.

Play

If you power the Arduino module and change the potentiometer tha servo motor will change its position.

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