How to Control Linear Actuator Using a Capacitive Touch Button and Arduino

by RonFrtek in Circuits > Arduino

171 Views, 1 Favorites, 0 Comments

How to Control Linear Actuator Using a Capacitive Touch Button and Arduino

Actuator touch

In this Project we will learn how easy it is to control a Linear Actuator with Arduino using a Capacitive touch button and Visuino.

Watch the Video!

What You Will Need

linear-actuator.jpg
l298n.jpg
capacitive-touch-button2.jpg
VisuinoAdvrtisemenESPNowESP32C3-1.jpg
power-supply.png
F5OFEUQJJ4ZYFKY.LARGE.jpg
  • Arduino UNO (Or any other Arduino)
  • Linear Actuator
  • LN298N DC Motor Driver
  • Capacitive Touch button
  • Jumper wires
  • Power Supply
  • Visuino program: Download Visuino


Brought by PCBWay

2022-08-26_13-41-18.jpg

Thank you PCBWay for supporting this tutorial and helping users learn more about electronics.

What I like about the PCBWay is that you can get 10 boards for approximately $5 which is really cost effective for professional made boards, not to mention how much time you save!

Go check them out here. They also offer a lot of other stuff in case you might need it like assembly3D printingCNC machining and a lot more.

The Circuit

2023-01-25_11-11-39.jpg
  • Connect Power supply (batteries) pin (gnd) to motor driver controler pin (gnd)
  • Connect Power supply (batteries) pin (+) to motor driver controler pin (+)
  • Connect Power supply (batteries) pin (+) to Arduino pin (VIN)
  • Connect GND from Arduino to motor driver controler pin (gnd)
  • Connect digital pin(6) from Arduino to motor driver pin (IN1)
  • Connect digital pin(8) from Arduino to motor driver pin (IN2)
  • Connect Linear Actuator to the motor driver as you can see on the schematic
  • Connect Capacitive Touch button pin (SIG) to Arduino digital pin (2)
  • Connect Capacitive Touch button pin (VCC) to Arduino pin (5V)
  • Connect Capacitive Touch button 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 & Set Components

2023-01-25_0-59-20.jpg
2023-01-25_1-00-31.jpg
2023-01-25_1-01-21.jpg
2023-01-25_1-02-26.jpg
2023-01-25_1-03-31.jpg
  • Add "Debounce Button" component
  • Add "Toggle(T) Flip-Flop" component
  • Add "Speed and Direction To Speed" component
  • Add "L298N" component


  • Select "SpeedAndDirectionToSpeed1" and in the properties window set "Initial Speed" to 1

In Visuino Connect Components

2023-01-25_1-05-58.jpg
actuator-touch.png
  • Connect Arduino digital pin [2] to "Button1" pin [In]
  • Connect "Button1" pin [Out] to "TFlipFlop1" pin [Clock]
  • Connect "TFlipFlop1" pin [Out] to "SpeedAndDirectionToSpeed1" pin [Reversed]
  • Connect "SpeedAndDirectionToSpeed1" pin [Out] to "DualMotorDriver1" > Motors [0] Pin [In]
  • Connect ""DualMotorDriver1" > Motors [0] Pin [Direction]" to Arduino digital pin[8]
  • Connect ""DualMotorDriver1" > Motors [0] Pin [Speed]" to Arduino digital pin Analog PWM[6]

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 press the Touch button the Linear Actuator will start to move in one direction and if you press the Touch button again it will reverse.

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