Introduction: Smart Home Automation With Android + Ethernet Internet + Arduino

Home automation becomes more and more popular, affordable and fascinates people. Internet offers such possibilities as never before. Impress your friends showing on Smartphone that you can switch on/off lamp in your apartment miles away and simultaneously see it through a webcam, opening doors. Very cool!

// --------------------------------------------------------

Step 1: Materials

Smart Home Automation with Android + Ethernet Internet + Arduino

01 - Smartphone with Android 2.3+

01 - Wire Ethernet + Router (My Model is TP-Link (TL-WR740N)

01 - Arduino Mega 2560 ou Arduino Uno + Shield W5100 (Ethernet)

01 - Led IR (Optional)

// --------------------------------------------------------

Step 2: App Inventor (application That Control the Arduino Via the Internet)

First you need create an app android, in this case I use an app inventor 2 link:


(Tutorial: AppEthernet - App inventor 2 / Channel: Android e Arduino)

Download .aia to my project, if you need change this application to English, because I created in Portuguese (Project .aia)

Download App to install in Android:


Step 3: Sketch to Arduino Mega - Code Link Download

Download link in the end code:

You need change:

byte ip[] = { 192, 168, 0, 00 }; // IP the arduino

EthernetServer server(80); // Port acess


01 - You need a version IDE 1.0.5 - the code does not work in IDE 1.0.6 because of IRremote library

02 - Every 4 seconds the page automatically updates, if you need change: client.println('<'MET A HTTP-EQUIV='refresh' CONTENT='4; URL='>");

03 - In application "SmartHomeAPP" you need change to a URL='

04 - Change the LED IR code to turn on or turn off your TV or Stereo

Lindo Download Sketch Arduino INO

How can you creating a

Acess the link: or


Step 4: Understanding the Code and Main Features

The methods "Get" send the variable for arduino, you can see in the piece of code:

if (c == '\n') {

if (readString.indexOf("lampada1") > 0) {

digitalWrite(lampada1,!digitalRead(lampada1)); }

//--------- send the page a variable "lampada1"

then the Arduino reads the full page and returns a method "Get" you can see in the piece of code:

//botao lampada1
if(digitalRead(lampada1)){ statusLed = "Ligada"; }

else { statusLed = "Desligada"; } client.println("

Lampada 1 - "+statusLed+"


//--------- in this piece you can see "+statusLed+", it returns to the relay this on or off on page



CassioU made it!(author)2017-04-11

excellent project congratulations, here functioning everything perfectly, only has a problem, after a time on circuit it stops/congeals, already I made of everything I changed the source, Internet and nothing, it helps me

RubineR made it!(author)2017-03-29


i need your guide on my project cause im doing bluetooth and arduino to control home applicance...plz respond as sson as possible

JimT114 made it!(author)2017-03-05

Nice job AlanV2.

Please someone re upload or send me .aia file because the link not work anymore....

ecmperalta made it!(author)2017-03-21

you got the link? someone could help please?

JimT114 made it!(author)2017-03-25

OK i got the .aia file. Thanks.

Ranjee+OmarA made it!(author)2016-12-21

Sir, can you switch on/off your appliances even if the android application is connected to a different internet connection?

samyxyz made it!(author)2016-11-14

hi .am doing a house automation project an your project inspires me a lot .while reading i cannot understand the first part of the connection between smartphone android and the arduino how it works.

as am not a premium user i cannot download your pdf .could you send me it on my personal e-mail :


Aijeleths made it!(author)2016-11-19

Hello there, I too with my team working with the same project. We can't avoid to have confusion with the connection especially with the code if there are some lines of functions that we need to be dealt with according to the address of the router. If you had the pdf my friend, It would be a great help for us to complete the project. Here is my email: Hoping for your response, Thank You

jjimenez21 made it!(author)2016-11-04

excelen proyect

ChanaC made it!(author)2016-10-18

can i be able to control appliances when i am connected to a different network?

ShaubhamS made it!(author)2016-10-02

sir kindly provide me codeing

Mark+AndyS made it!(author)2016-08-09

sir how can i connect the android phone to control the automation?

Mark+AndyS made it!(author)2016-08-09

sir how can i connect the android phone to control the automation?

Mark+AndyS made it!(author)2016-08-09

sir how can i connect the android phone to control the automation?

TarekM2 made it!(author)2016-07-17


Screenshot - 01_07_2016 , 04_41_08 م.png
ChetanK23 made it!(author)2016-02-11

Sir How can i call my ip address from other remote place . for eg. From mobile or from other city. because whenver i am going on my ip address from mobile to access it It couldn't get opened after reloading page also. Please help me sir. Thank u .

AlanV2 made it!(author)2016-06-29

Hi ChetanK23.. you need use this site

Watch this video

masterwixx made it!(author)2015-12-25

hello; great project.

how i can repeat ir commands from my air conditioner? and use on the app?

thank you

AlanV2 made it!(author)2015-12-26


williamn31 made it!(author)2015-12-27

thank , you. but how i can record and repeat the codes from my air conditioner ?

AlanV2 made it!(author)2016-06-29

You can use examples of the IRremote library.. Watch this video

AlanV2 made it!(author)2015-12-27


In this video you can see how to make what you need

You need the Ir receiver..
change to Pin11 or change the code for PIn2, (Picture)


avieira+giavera made it!(author)2015-12-26

Hello Thanks

In this video you can see how to make what you need

You need the Ir receiver..
change to Pin11 or change the code for PIn2, (Picture)


sny2ksa made it!(author)2016-06-28

Dear AlanV2,

Please have a look on the attached image. I try a lot but got same error.

i use the IDE 1.5 , 1.05 . 1.5.3.

Can you guide me how to solve the issue

AlanV2 made it!(author)2016-06-29

Hi Snyksa..

You can fix, just remove "#include "
and everything related

This code run just in arduino sketch 1.0.5 with IRremote library inside the directory...

I have helped
Alan Vieira

RohitC22 made it!(author)2016-02-02

Well Iv been trying to replicate your project for my own
house, but I want to know how it will work if I connect it to my home
router and then assign it an IP from there?
So, instead of connecting to the Internet Ill use it as a LAN device.

Also I want to host the webpage onto my own PC i.e localhost, can you tell me how that will work?

I would be really grateful if you can also provide me the HTML code, INO, circuit diags to connect to the breadboard for the same.

AlanV2 made it!(author)2016-02-03

Hi, Good morning Rohit

Well, if you need connect to ip local, change the arduino code fragment

byte ip[] = { 192, 168, 1, 99 }; // IP the arduino

EthernetServer server(80); // Port acess

client.println('<'MET A HTTP-EQUIV='refresh' CONTENT='4; URL=http://192, 168, 1, 99/'>");

First you need look in your IP / PC the group 192.168."1".99

if you are not with 1.. change to the number you have on your computer

You also need to change in "SmartHomeAPP"

Don't forget in app you need the "/" at the end

With these changes will work

williamn31 made it!(author)2015-12-20

work also with arduino uno ?


AlanV2 made it!(author)2015-12-21

Yes.. It works

LuisL17 made it!(author)2015-08-23

hola muy buen aporte...pero yo tengo un problema con mi host name ..mi no -ip... me podrias ayudar a editar el codigo para solo utilizarlo con una ip local ejemplo porque abro la app (apk) y me sale error de conexion .. eso es por el dominio..como cambio el codigo solo para red local.

avieira+giavera made it!(author)2015-12-07

You need change in app your URL...

gprilla made it!(author)2015-11-24

03 - In application "SmartHomeAPP" you need change to a URL=' Where do i go and change the url in app inventor? any help appreciated

avieira+giavera made it!(author)2015-12-07

You need change your URL like that

Example: if you edit your code in this way:

byte ip[] = { 192, 168, 1, 99 }; // IP the arduino

EthernetServer server(80); // Port acess

You URL will look like this:


RaywardB made it!(author)2015-09-08

sir, can you make english version for your code in arduino and for the App inventor code? i am beginner using this kind of devices. please help me. thanks..

Eric.Hyungki.Jung made it!(author)2015-02-15

Hi. I am engineer of WIZnet.

May i introduce your instructables to our Web site - WIZnet's Musuem ( ?

Thank you in advance.

salianvk made it!(author)2015-04-09

Hi Eric,

Is there any link to site where I can get libraries of WIZnet for Microcontrollers, especially MSP430 or Atmega series that I can use for my project based on Home Automation? If so, please forward to me.



Eric.Hyungki.Jung made it!(author)2015-04-14

Hi Vksalian.

We have W5500 chip Ethernet libraries for MSP430 at WIZnet Wiki.

(These lib for MSP430 Launchpad + WIZ550io module)

I think this code will be appropriate skelecton for your development.

Please visit our our wiki page.

AlanV2 made it!(author)2015-02-19

Yes.. when you're done... send the link to me.. ok?

Eric.Hyungki.Jung made it!(author)2015-03-08
Eric.Hyungki.Jung made it!(author)2015-03-04

Sure. I will leave a reply to you as your instructables is posted on the our museum site.

And, if you have any new project idea using WIZnet ethernet chips or modules, we can provide help (like free samples) to you. Please email me.

>> Eric Jung,

JordanL6 made it!(author)2015-03-18

Sensacional! esperando meu shield ethernet chegar para fazer!

splendid87 made it!(author)2015-03-02

I have verify the code but it show up error compiling!

Would you remedy me?

AlanV2 made it!(author)2015-03-03

Send me a PrintScreen of the error..

Do you have all the libraries? (try using Arduivo IDE version 1.5)

splendid87 made it!(author)2015-03-05

The image i have uploaded!

I was using Arduino IDE version 1.6

I newbie in Arduino! Where to get the libraries?

Thanks in advance!

AlanV2 made it!(author)2015-03-06

This error happens because you using Arduino IDE Version 1.6

The library the IRemote.h in Version 1.6 is not compatible

Try using the Arduino IDE Version 1.5

splendid87 made it!(author)2015-03-06

The problem is same as well.

even though i try 1.0.5 version

AlanV2 made it!(author)2015-03-06

Uninstall your arduino IDE remove all folders ..

then download version 1.0.5 again ..

then remove the code the part that relates to IRemote.h library

Mr+AbAk made it!(author)2015-01-15

Nice Ible and idea ...

About This Instructable




Bio: Skills: Programming Language: HTML, CSS, PHP (Basic), Javascript (Basic). - Software and Development Tools: AppIventor (Android), Arduino IDE, Dreamweaver CS4, Photoshop CS6, 3D Studio Max, AutoCAD ... More »
More by AlanV2:Smart Home Automation with Android + Ethernet Internet + Arduino
Add instructable to: