Trybotics Logo

Android (remotexy) UI to Control Servo Motor Using Arduino and Bluetooth

DESCRIPTION

In this Instructable i will give you quick step to make Android User Interface using Remotexy Interface Maker to control Servo Motor connected to Arduino Mega via Bluetooth.

This video show how the UI will controlling servo motor speed and position.

Description:

This is how its working:

When we touch/use UI on Android, Android app will send signal to arduino via bluetooth connection, then processed signal will sent to (driver) servo. Encoder sensor will then send feedback signal to arduino, and the signal (position) will sent via bluetooth to displayed on Android UI.

Description:

Assuming that you already have a working Servo Motor connected to Arduino, i will skip this part because our focus is to create UI to controlling servo from Android.

In this project i am using Vexta brushless dc motor connected to a gear to moving an arm mechanism.

For Arduino i am using Arduino Mega.

Description:

This is very important step, make sure your encoder sensor installed and can read value correctly.

Test it before continue to next step. This reading value will displayed on UI and become our reference for servo position.

The value will range from 0-1024 (analog), and since 1 fully rotation is 360 degrees, we need to do some math, and its different depend on encoder sensor and servo motor itself.

In my project, analog value from 100-900 represent 0-360 degree rotation.

Description:

Next is to install Bluetooth modul to Arduino Mega.

Use diagram above to reference only, since maybe your Arduino will have different layout and pin.

Description:

Open remotexy.com, create account, and start new project.

Select bluetooth as connection type, and start coding using examples from example pages.

You can start to drag and drop elements from Elements side menu, like slider, panel, button, etc.

In my project i am split the UI into left and right area. Left area will controlling lets say servo1, and right area will controlling servo2. Then in each area, i am using this Elements:

  • TEXT STRING for displaying encoder sensor value (analog) in range 100 to 900.
  • SLIDER (for speed) with TEXT STRING on top of it. I modified Text string so it will displaying the SPEED slider's value in range 0 to 100%.
  • SLIDER (for position) with TEXT STRING on top of it. I also modified this Text string so it will displaying the POSITION slider's value 0 to 100%. AND i also add a "LINEAR DIVISION LEVEL" as an indicator and modified it so it will represent encoder sensor value in range 0 to 100%.
  • Some LABEL for text labeling (of course...)

*this step will get updated next time with my source code, appologize for that.

UPDATE: i am sorry i cant share my source code for UI since its related to the National Research Company where i did the project. But i update the picture so you can see my actual UI when i designing it on remotexy editor.

Description:

Upload finished code, include lib, to Arduino Mega via USB, using Arduino IDE software.

Note that its necessary to disconnect bluetooth Tx and Rx wire to uploading code via USB.

There is other ways doing it without disconnect the wire, but this method works for me.

Description:

Final step wiil be installing remotexy app from Google Play. You can find it by search "remotexy" on Google Play.

After that, open the app, search for your HC-05 Bluetooth, Pairing with it, and your user interface (that have been uploaded to Arduino) will shown up.

If everything setting correctly, you can start controlling servo motor from this user interface.

This video show testing the UI for controlling servo's speed and position.


YOU MIGHT ALSO LIKE