Control Servo Motor Using Atom Matrix Esp32 & Visuino

Photo of Ron

Made by Ron / Automotive / Drones / Robotics / IoT

About the project

In this tutorial we will use Servo Motor and ATOM Matrix ESP32, and Visuino to control servo motor degree position. Watch the video!

Project info

Difficulty: Easy

Platforms: ArduinoVisuinoM5Stack

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Jumper wires (generic) Jumper wires (generic) x 1
M5Stack ATOM Matrix ESP32 Development Kit M5Stack ATOM Matrix ESP32 Development Kit x 1
SG90 Micro-servo motor SG90 Micro-servo motor x 1

Software apps and online services

Visuino Visuino
Arduino IDE Arduino IDE

Story

Step 1: What You Will Need

1 / 3

Step 2: The Circuit

  • Connect Servo pin [VCC] to Atom Matrix pin [5V]
  • Connect Servo pin [GND] to Atom Matrix pin [GND]
  • Connect Servo pin [Signal] to Atom Matrix pin [G25]

Step 3: Start Visuino, and Select the Atom Matrix Board Type

1 / 2

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 "Atom Matrix" as shown on Picture 2

Step 4: In Visuino Add Components

1 / 3

  • Add "Counter" component
  • Add "Integer To Analog" component
  • Add "Servo" component

Step 5: In Visuino Set Components

1 / 3

  • Select "Counter1" and in the properties window set "Max">"Value" to 10
  • Select "IntegerToAnalog1" and in the properties window set "Scale" to 0.1

Step 6: In Visuino Connect Components

1 / 2

  • Connect "M5 Stack ATOM Matrix" > "Button" pin [Out] to "Counter1" pin [In]
  • Connect "Counter1" pin [Out] to "IntegerToAnalog1"pin [In]
  • Connect "IntegerToAnalog1" pin [Out] to "Servo1" pin [In]
  • Connect "Servo1" pin [Out] to "M5 Stack ATOM Matrix" pin [GPIO 25]

Step 7: 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 ATOM Matrix module and press the Atom button the servo motor will start to rotate.

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

Schematics, diagrams and documents

Visuino File

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...