How to Control a 360 Continuous Servo Motor Using Arduino

by RonFrtek in Circuits > Arduino

411 Views, 2 Favorites, 0 Comments

How to Control a 360 Continuous Servo Motor Using Arduino

How to Control a 360 Continuous Servo Motor Using Arduino

In this tutorial we are going to learn how to control the speed and direction of a Continuous Rotation Servo using a potentiometer, button & Arduino.

Watch the video!

Also check outthis great Video on How Continuous Rotation Servo Works

What You Will Need

360 Continuous Rotation SERVO Motor.jpg
pctdetail.775-114.1.jpg
mini_push_button.1471344052-600x435.png
resistor-1k-ohm-14w-5.jpg
FZEK4WBK3XGYAP0.LARGE.jpg
VisuinoAdvrtisemenESPNowESP32C3-1.jpg
breadboard.png
jumper-wires.jpg
  • Arduino UNO (Or any other Arduino)
  • 360 Continuous Rotation SERVO Motor 
  • Potentiometer module
  • 1k ohm Resistor
  • Jumper wires
  • Breadboard
  • 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

2022-10-23_10-56-23.jpg
  • Connect Arduino pin [5V] to Driver Board pin [VCC]
  • Connect Arduino pin [GND] to Driver Board pin [GND]
  • Connect Arduino pin [5V] to breadboard positive pin [Red line]
  • Connect Arduino pin [GND] to breadboard negative pin [Black line]
  • Connect Arduino Digital pin [2] to the Resistor and button
  • Connect other side of the resistor to the breadboard pin [GND]
  • Connect Other pin of the button to the breadboard positive pin [5V]
  • Connect potentiometer pin [DTA] to arduino analog pin [A0]
  • Connect potentiometer pin [VCC] to the breadboard positive pin [5V]
  • Connect potentiometer pin [GND] to the breadboard pin [GND]
  • Connect Servo motor "Orange" (signal) pin to Arduino Digital pin[3]
  • Connect Servo motor "Red" pin to Arduino positive pin[5V]
  • Connect Servo motor "Brown" pin to Arduino negative pin[GND]



Start Visuino, and Select the Arduino UNO Board Type

FRWQB80K1RVKKV9.LARGE.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 Components

2022-10-20_17-59-08.jpg
2022-10-20_18-01-45.jpg
2022-10-20_18-02-12.jpg
2022-10-20_18-00-55.jpg
  • Add "Debounce Button" component
  • Add "Toggle(T) Flip-Flop" component
  • Add "Speed and Direction To Speed" component
  • Add "Servo" component

In Visuino Connect Components

2022-10-20_17-58-27.jpg
2022-10-20_17-58-51.jpg
  • Connect Arduino digital pin [2] to "Button1" pin[In]
  • Connect "Button1" pin[Out] to "TFlipFlop1" pin [Clock]
  • Connect "TFlipFlop1" pin [Out] to "SpeedAndDirectionToSpeed1" pin [Reverse]
  • Connect Arduino analog pin [0] to "SpeedAndDirectionToSpeed1" pin [Speed]

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 Uno module,the Servo motor is ready to spin.

By sliding potentiometer you can regulate the motor speed and change the direction by pushing the button. Congratulations! You have completed your Project. 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