Control 2 servo with Potentiometer/ XOD

in #utopian-io6 years ago (edited)

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

20180124_120153.jpg

  • 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.

frit.png

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.

20180124_120533.jpg

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.

20180124_120908.jpg

  • 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/

xod.png

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.

addpot.png

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.

pin.png

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.

upload.png

Select the board and the port where the usb arduino is plugged in, select the arduino board type then click UPLOAD.

ups.png

Wait until its successfully UPLOADED

U5drfa5eEEhExpX8frytNo3mkfToqSx_1680x8400.png

20180124_123535.gif

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

Sort:  

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

  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.030
BTC 63595.77
ETH 3415.98
USDT 1.00
SBD 2.49