Virtual Classes are Now Live! Sign Up

Home Automation using Arduino and WiFi

We sometimes use affiliate links in our content. This won't cost you anything, but it helps us to offset the costs of paying our writing team. You can support us directly on BuyMeACoffee. Thank you!

Home automation is a trending topic these days so I wanted to share with you a new project. We are going to control AC appliances over the internet using an Android phone from anywhere around the world. I used an ESP8266 development board as the main controller.

Here  we will be using RemoteMe services. If you have no experience with RemoteMe, Check out “Control Devices using NodeMCU” and “Weather station” tutorials to get a general idea.

CAUTION: Alternating Current is very dangerous and accidental shock could be fatal. Only work with AC appliances if you are 100% sure you know what you are dealing with. We shall not be held responsible if you cause any harm to yourself or anyone else.

With that said, let’s get started.

What is RemoteMe?

I decided to start with a simple introduction to RemoteMe for those who do not know what it is and what you can do with it.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn
RemoteMe is a web application that is used to communicate with devices like Arduino, NodeMCU, Raspberry Pi, etc. With the RemoteMe application, you can host a website 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 it’s totally free! RemoteMe also has a built-in code wizard, so you don’t have to write all of the Arduino code from scratch. All you need is an account on RemoteMe to use its features.

What is Arduino Remote LITE ?

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Arduino Remote Lite is 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 the Playstore. Here is the link.

Smart Home Automation Project Components

Hardware

  1. ESP8266 dev board (You can use an Arduino with an ESP01 module)
  2. Relay board (I have used a 4 ch relay, you can even use 8 ch or 16 ch relays)
  3. Breadboard (For prototyping, you can make it permanent on PCB if you want)
  4. Male to Female jumper wires
  5. 9v battery (To power the relay)

Software Components

  1. Arduino IDE. (To upload the code)
  2. RemoteMe account.
  3. Arduino Remote Lite app

Set Up the Arduino IDE

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

In order to be able to program the ESP board, you need to configure the Arduino IDE.

Once the ESP environment is ready next step is adding the libraries required for RemoteMe connection. Open the Arduino 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.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Libraries you’ll need to install are as follows:
* RemoteMe.h
* Remotemeutils.h
* RemoteMeSocketConnector.h
* RemoteMeDirectWebSocketConnector.h
* ESP8266WiFi.h
* ESP8266WiFiMulti.h

Once these libraries are installed, the IDE is ready to work with RemoteMe.org.

Configure RemoteMe

First head over to RemoteMe.org, and signup if you haven’t already.

Now install the Arduino Remote Lite apk, and sign in using the RemoteMe account. Once that is done, go back to RemoteMe website to create variables.

Follow the following steps carefully:

After logging in 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.

Weather Station using NodeMCU Tutorial
  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

 

Now above ‘Variables‘ there is another option named ‘Devices‘ click on it and a new page will load where you can create devices.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

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‘ or anything you want. Also, give the device a unique ID so the device is recognized and differentiated from other devices.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Generating Arduino Code

After the above step, a new device will appear. Now we have to generate the Arduino code. Click the burger menu (Represented by 3 horizontal lines). Then, select ‘Code Generating Wizard.‘ You will see a popup window with a list of all the variables generated by the App.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Scroll down to find the list of relays. As here I am using a 4 ch 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

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

In the next step enter your WiFi name and password and click on ‘Next‘.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

You also have an option to enable ‘Enable Direct Connection.‘ If you enable this option, the App will connect to the device directly without the internet if the Smartphone is in the range of the WiFi.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn
In the next step, enable the Debug option, and hit next. Now you can download the code to your computer. We’ll need to edit the code to set the I/O pins.
  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Modify the Home Automation Arduino Code

If you’ve already used RemoteMe, this part should look familiar. Make modifications as needed for your project. Or, you can download our modifications.

Wire up the Electronics

Now that the software is ready, we can wire up the circuit board.

Here is a circuit diagram:

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

First, place the ESP8266 board on Breadboard, and connect the GND pin to the -ve rails on both sides.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Now connect some male to female jumpers to the relay board. Refer to the pictures below for the connections.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Next, attach a 9v battery clip to the breadboard. It will power both the Relays and the Logic circuit of the relay board.

Then, connect the wires of the Appliance you want to control. The AC appliance will have 2 wires. First, cut the live wire and connect one end to the center terminal of the relay and another end to the normally open terminal.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Now, we can move on to test the build. First power up with 9v battery. If you want to power the ESP board with the battery as well, just connect the Vin pin of ESP board to +ve rail of the breadboard. Then you don’t need to connect the USB cable.

  • Facebook
  • Twitter
  • Pinterest
  • Buffer
  • reddit
  • LinkedIn

Open the Arduino Remote Lite app, Head over to the 3rd option “Relay Control” from here you can control the Relays with the switches. Finally, when you trigger the relay from RemoteMe, the lamp should turn on and off.

Hope this post was informative and helpful. If you have any questions, please drop a comment below!

Would you like to learn how to build robots? Join our new Robotics eCourse. For more tutorials like these, consider sending us a Coffee.

You May Also Like

Have a question? Need Help?

Thanks for dropping by! Comments are no longer moderated daily.
Before posting your comment, please consider buying me a coffee. If you need immediate support, you can schedule an appointment. Providing customized information for your individual scenario takes a lot of my time. I’m happy to help, but I can no longer provide individualized advice pro bono.
Thank you for understanding.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Free Learn Robotics Swag

Patch/Sticker with every LR Kit

Work with an Engineer

Live Chat with an Instructor

365 Day Course Access

1 year access to every course

100% Secure Checkout

PayPal / MasterCard / Visa

Become a Learn Robotics Insider

Sign up and receive product announcements and discounts!

 

Success! Check your email for a surprise!

Pin It on Pinterest