Simple Home Automation Using RemoteMe and Arduino

In the previous article, we learned how to connect and access devices over the internet. Check it out here, if you haven’t already. In this tutorial, we will see how to extend on that knowledge and make a simple home automation system.
So without any further ado let’s get started.

Video Tutorial Simple Home Automation Using RemoteMe:

What is RemoteMe?

What is remoteme

RemoteMe is a web application which is used to communicate with devices like Arduino, NodeMCU, Raspberry Pi, etc. With the RemoteMe application, you can host your websites to control your devices in the RemoteMe cloud. Only you and the users who have the generated key have access to those websites. You can have as many pages as you want and totally free.
You can also use the built-in code generation wizard to make the code, so you don’t have to write all code from scratch.

Using RemoteMe you can connect your projects to the internet. You will just need an account on RemoteMe to use its features.

What Is Arduino Remote Lite?

Arduino Remote Lite is an android application which can be used to remotely control your projects via Bluetooth or WiFi. It can also be connected to RemoteMe server to control Relays and other such devices. 
You can download this app from playstore. Here is the link.


Setting Up The IDE:

First things first, We have to set up the IDE and install all the required libraries.

  1. In order to be able to program the ESP board using Arduino IDE, your IDE needs some modification. Here I have provided a link to another article where I have shared the information on how to do that here.
  2. Once the ESP environment is ready next step is adding the libraries required for RemoteMe connection.
  • Open IDE and goto >> Sketch >> Include Library >> Manage Libraries. A pop will show up where you have to search the required libraries and install them one by one. 
    Libraries are :- 
    * RemoteMe.h
    * Remotemeutils.h
    * RemoteMeSocketConnector.h
    * RemoteMeDirectWebSocketConnector.h
    * ESP8266WiFi.h
    * ESP8266WiFiMulti.h

Once these libraries are installed the IDE is ready to work with

Variables & Generating Code:

First head over to goto “Applications” and signup if you haven’t already.

Next, install the Arduino Remote Lite apk and Sign in using the RemoteMe account. once that is done, get back to RemoteMe website to create variables. 
Follow the following steps carefully:-

  • Goto ‘Variables’, here you will notice a list of variables created automatically by the ‘Android Remote Lite‘ app. We will be using these variables to control the relays.
  • Now above ‘Variables’, there is another option named ‘Devices‘ click on it and a new page will load where you can create devices.
  • Click on ‘New Devices‘ option on the top right corner, a drop-down list will appear. Select the last option ‘New Network Device’. Now give the device a name like ‘Relay’ or ‘Automation’ anything you want. Also, give the device a unique ID so the device is recognized and differentiated from other devices.
  • After the above step, a new device will appear. Now we have to generate a code. For that notice, the burger menu (Represented by 3 horizontal lines) click on that. Select ‘Code Generating Wizard’, you will see a pop-up window with a list of all the variables generated by the App.
  • Scroll down to find the list of relays. As here I am using a 4ch relay, I will select the first 4 relay variables, If you are using 8 / 16 ch relays. select the numbers you require and click on ‘Next
  • In next step enter your WiFi name and password and click on ‘Next‘.
  • Next, you have an option to enable ‘Enable Direct Connection‘ if you enable this option. the App will connect to the device directly without internet if the Smartphone is in the range of the WiFi.
  • Next, enable the Debug option and hit next. Now you can download the code and move on to edit it.


Just add the following in the downloaded code:

int Relay1 = D0;
int Relay2 = D1;
int Relay3 = D2;
int Relay4 = D3; 

So on you can add more if you want.

void onRELAY_01Change(boolean b)
    Serial.printf("onRELAY_01Change : b : %d\n", b);
    if(b == 1) 
        digitalWrite(Relay1, HIGH);
    else if(b == 0)
       digitalWrite(Relay1, LOW);

Above the functions in the code are edited for operating relays. In a similar way, you can edit all the functions for the number of relays you are using.

pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);

The above code is to be added in setup to set the pins as output.
That’s all the code that needs to be edited, The whole code is provided below just add your WiFi name and password, your device ID, and a token which can be found in ‘Token‘ below ‘Variables‘.

Download the code: arduino.ino

With that been done, the code is ready to be uploaded to the ESP board.


  • First Place the ESP8266 on Breadboard, connect the GND pin to the -ve rails on both sides.
Simple Home Automation Using ESP8266
  • Now connect some male to female jumpers to the relay board. Refer to the picture for the connections.
Simple Home Automation Using RemoteMe connection of relays
  • Connect a 9v battery clip to the breadboard. It will power both the Relays and the Logic circuit of the relay board.
  • Now connect the wires of the Appliance you want to control, the AC appliance will have 2 wires. You have to cut the live wire and connect one end to the center terminal of the relay and another end to the normally open terminal.
Using RemoteMe operate relays

CAUTION: Alternating Current is very dangerous and accidental shock could be fatal. Work with AC appliances only if you are 100% sure of what you are dealing with. I shall not be responsible if you caused any harm to yourself or anyone else.

With that the connections are ready now move on to test the build, First power it up with the 9V battery. If you want to power the ESP board with the battery as well, Just connect the Vin pin of ESP board to the +ve rail of the breadboard. Then you don’t need to connect the USB cable.

Open the Arduino Remote Lite app, Head over to the 3rd option “Relay Control” from here you can control the Relays with the switches.

Hope this post was informative and helpful.

If you have any doubts, leave it in the comment section.

5 1 vote
Article Rating