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.
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.
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.
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.
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:
*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.
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.