Control 2 servo with Potentiometer/ XOD
What Will I Learn?
Today in this instructable we will learn hows the Visual Programming Language For Microcontroller works. In this tutorial we will learn how to program the Arduino using blocks (nodes). We will control the servo motors with potentiometers. We will use the XOD visual programming language for this. It is an ideal tutorial for beginners. so leats start.
Requirements
- 2 10k potentiometers
- 2 S90 servo motors
- Arduino board
- Breadboard
- Jumper wires
Difficulty
- Basic
Tutorial Contents
We are going to use this basic components of arduino, the popular servo motor and potentiometer, we will be using the potentiometer to control the movement of the servo by 180` the ervo motor has everything built-in a motor, a feedback circuit, and most important, a motor driver. It just needs one VCC power line, one GND ground, and one control pin, when rotating the potentiometer wheel we are changing the voltage applied position to the servo, so lets start the the process by following the circuit diagram.
The potentiometer has 3 sets of leg the both sides of the leg is the GND and the VCC the center leg will be connected to specified pin on arduino analog outputs. the servo has three sets of wire in different color the brown/black wire is the GND and the red will be the VCC, the remaining wire orange will be connected to specified digital pin out on the arduino.
The GND pin on the arduino will be connected to the negative horizontal rail on the breadboard and the 5V will be put on the possitve rail.
- SERVO1 - PIN 7
- SERVO2 - PIN 10
- SERVO1 - A1
- SERVO2 - A2
SOFTWARE
We will going to use visual programming using XOD application, here is a brief info about the software, on installing XOD you use the XOD integrated development environment (IDE for short), which comes in two flavors: browser-based and desktop version but to upload the the sketch dorectly to the uno its better to download the software. It works on Windows, macOS, and Linux. Find a distribution package for your system on https://xod.io/downloads/
I have downloaded the IDE its already on my pc, lets start working on the code, once you have open the software there a lot of guide there on how its work, so i m going start a new project on how to control servo using pot, lets start to build a visual object name pot and servo just search the name POTfor potentiometer and SERVO for servo motor on the search bar. double click the node table for the search to appear or simply go to common hardware on the right side toggle.
Click on the node SERVO then you can see the flag sign just put the name of the SERVO its optional, the PORT this where the servo connected to the pin on arduino so on servo 1 is connected to 7 on arduino, so put 7 on the PORT and and pin 10 to servo 2. set the port of the potentiometer the port of pot1 will be on the analog pin 1 on the arduino and the pot 2 will be on the analog 2.
Connect VAL of the potentiometer POT to VAL of the Servo node. click on the upper right tab and click on the tab: DEPLOY the UPLOAD TO ARDUINO.
Select the board and the port where the usb arduino is plugged in, select the arduino board type then click UPLOAD.
Wait until its successfully UPLOADED
If you have question about the XOD you can check this out: XOD Official -- https://xod.io/
XOD Community -- https://forum.xod.io/, thank you for mert arduino and tech for this awesome stuff! thank you for passing by.
You can also check my previous posts:
LED Matrix red 8x8 Tutorial
How to connect nokia 5110 LCD to arduino
How to adjust LED brightness using potentiometer/ visual programming XOD
How to make 12 LED chaser without shift
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @pakganern I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x