Arduino and Remote XY – A Quick Primer

This post is an introduction to RemoteXY (http://remotexy.com/en). Remote XY lets you create graphical interfaces for smartphones to control boards like Arduino from anywhere!

How does it work? Just 4 simple steps are needed to complete your project:

  • Create graphical interface
  • Download source code
  • Connect communication module
  • Install mobile app for controlling

Interested? Let us get started…

First of all, gather the following hardware components to continue:

  • Arduino Uno Board
  • HC-05 Bluetooth Module

Next, prepare the hardware setup as in the below diagram:

Now, download and install the latest version of the RemoteXY Library from this page https://remotexy.com/en/library/

The RemoteXY library helps you to remote control a microcontroller device from your smartphone or tablet. The library implements the communication between Arduino and Android smartphone or tablet. The library supports all available communication options.

If you don’t know how to install the library, then go to https://remotexy.com/en/help/how-install-library/

Note that this library works in conjunction with a mobile app that you can download from the link http://remotexy.com/en/download/

While on the subject, here is the list of hardware I used for my quick play:

  • Microcontroller Board: Arduino Uno R3 (IDE 1.8.13 / Windows 10 x64 OS)
  • Bluetooth Module: HC-o5 Compatible Bluetooth Module
  • Smartphone: Nokia 5.3 (Android 10 OS)

If everything is okay, then you can create your own graphical interface by getting into this page https://remotexy.com/en/editor/. Signup is required!

As usual, start your learning with a “Hello World” LED experiment. What about controlling the onboard LED (D13) of Arduino Uno remotely by touching a button on the screen of your smartphone?

Ready for the game? Great! Now you can use the editor interface to draw your graphical interface. Below you can see my interface design.

Once the interface design is ready, you must specify for which platform you want to get it – simply select Arduino UNO. Now you get the source code for your microcontroller

On the download page of the source code, you can see the program (code/sketch) for the Arduino microcontroller. The code implements a graphical management interface that was created in the editor. Since your button is connected to the onboard pin 13 LED in the code (function main) you do not need to alter anything in the code for your first test. Further Details at https://remotexy.com/en/examples/firstproject/

Download the zip file of the source code, unzip it, open the code in the Arduino IDE, compile and upload it to your Arduino hardware setup. Then, power your hardware setup up, connect your smartphone with it through the RemoteXY app, and finally touch the button to see what is happening. Then try something different with your own loop code for D13 LED!

Once you run the application (after enabling Bluetooth connectivity), it automatically starts searching for devices, and all devices found will be listed. Usually you can see your setup as “HC-05”. The default password for HC-05 Bluetooth module is 1234 or 0000. This is my Bluetooth Arduino assembly!

And, this is a snippet of the code (Arduino Sketch) used by me – just for your reference.

[code]

/*

Remote XY Hello World LED

T.K.Hareendran/01.2021

*/

#define REMOTEXY_MODE__SOFTSERIAL

#include <SoftwareSerial.h>

#include <RemoteXY.h>

#define REMOTEXY_SERIAL_RX 2

#define REMOTEXY_SERIAL_TX 3

#define REMOTEXY_SERIAL_SPEED 9600

#pragma pack(push, 1)

uint8_t RemoteXY_CONF[] =

{ 255, 1, 0, 0, 0, 15, 0, 10, 24, 0,

1, 8, 28, 9, 45, 45, 1, 31, 76, 69,

68, 0

};

struct {

uint8_t button_1;

uint8_t connect_flag;

} RemoteXY;

#pragma pack(pop)

#define PIN_BUTTON_1 13

void setup()

{

RemoteXY_Init ();

RemoteXY_Init ();

pinMode (PIN_BUTTON_1, OUTPUT);

}

void loop()

{

RemoteXY_Handler ();

digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1 == 0) ? LOW : HIGH);

// ADD YOUR OWN LOOP CODE HERE. DO NOT CALL delay() !

}

[/code]

As mentioned, I used an HC-05 “compatible” Bluetooth module for my quick RemoteXY + Arduino Uno experiments.

It is an easy to use module similar to the obsolete HC-05 version that works in master or slave configuration. According to auto translated Chinese datasheets, all signal pins on the module are 3V-6V tolerant, so no logic level shifting is required.

Closing Remarks

I apologize for the rawness of this post. I have not figured out what project is needed to complement this primer so I decided to try a new concept and see what happened. The next step is to build something useful with RemoteXY and a microcontroller.

I put together some hint usefuls related to RemoteXY try outs. Hope this helps you.

  • IOS devices do not support HC-05, HC-06, and compatible modules. You can use the Bluetooth module BLE HM-10 (https://www.electronicproducts.com/hands-on-review-hm-10-ble-module-and-its-mysterious-clones/)
  • Always use the latest version of the RemoteXY library. Otherwise, there will be errors during compiling.
  • As far as I know, you can add up to 5 elements in RemoteXY for control purposes. For more elements you will need to pay for the app
  • If there is no connection you might get an error message: “The connection is established, but the device does not respond: Time out error: no response”. This means that either the request commands do not reach the controller, or the controller responses are not returned to the smartphone

Good luck with your RemoteXY experiments! Looking forward to seeing how things progress!

BONUS 🎉

Copy-paste the below code and upload it to your Arduino Uno. Then you can switch a common LED wired to D9 of your hardware setup (Arduino Uno + HC-05 Module) ON and OFF thru the slide switch provided by RemoteXY app in your smartphone. Note that the LED needs a 220Ω series resistor to limit its operating current.

[code]

/*

Remote XY Simple Slide Switch & LED

T.K.Hareendran/01.2021

*/

#define REMOTEXY_MODE__SOFTSERIAL

#include <SoftwareSerial.h>

#include <RemoteXY.h>

#define REMOTEXY_SERIAL_RX 2

#define REMOTEXY_SERIAL_TX 3

#define REMOTEXY_SERIAL_SPEED 9600


#pragma pack(push, 1)

uint8_t RemoteXY_CONF[] =

{ 255, 1, 0, 0, 0, 20, 0, 10, 21, 0,

2, 1, 40, 25, 22, 11, 1, 25, 31, 31,

79, 78, 0, 79, 70, 70, 0

};

struct {

uint8_t switch_1;

uint8_t connect_flag;

} RemoteXY;

#pragma pack(pop)

#define PIN_SWITCH_1 9

void setup()

{

RemoteXY_Init ();

pinMode (PIN_SWITCH_1, OUTPUT);

}
void loop()

{

RemoteXY_Handler ();

digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1 == 0) ? LOW : HIGH);

if (RemoteXY.switch_1 == 1) {

digitalWrite(PIN_SWITCH_1, HIGH);

}

}

[/code]



Leave a Comment