loading

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: http://ai2.appinventor.mit.edu/

Reference: https://www.youtube.com/watch?v=rwsKzyEpgoE

(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

http://www.mediafire.com/download/pbcepmryegczdpb/SmartHouseApp.aia (Project .aia)

Download App to install in Android:

http://www.mediafire.com/download/v2yk79xk91eaw57/SmartHouseApp.apk

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

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

Obs:

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=http://seudominio.no-ip.org/'>");

03 - In application "SmartHomeAPP" you need change to a URL=http://seudominio.no-ip.org/'

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

Lindo Download Sketch Arduino INO

http://www.mediafire.com/view/v2y3ztk5uhex2ij/APP_ETHERNET_INVENTOR_WAKE.ino

How can you creating a http://seudominio.no-ip.org/

Acess the link: https://www.youtube.com/watch?v=1FWGt5gnnYs or https://www.youtube.com/watch?v=ZPvvoEDjSww

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

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

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

<p>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</p>
<p>hi,</p><p>i need your guide on my project cause im doing bluetooth and arduino to control home applicance...plz respond as sson as possible rubinerx68@gmail.com</p>
<p>Nice job AlanV2.</p><p>Please someone re upload or send me .aia file because the link not work anymore....</p>
<p>you got the link? someone could help please?</p>
<p>OK i got the .aia file. Thanks.</p>
<p>Sir, can you switch on/off your appliances even if the android application is connected to a different internet connection?</p>
<p>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.</p><p>as am not a premium user i cannot download your pdf .could you send me it on my personal e-mail : adilensamy@ymail.com.</p><p>thx.</p>
<p>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: shaharaijeleth@gmail.com Hoping for your response, Thank You</p>
<p>excelen proyect</p>
<p>can i be able to control appliances when i am connected to a different network?</p>
<p>sir kindly provide me codeing shaubhamsaini@gmail.com</p>
sir how can i connect the android phone to control the automation?<br>
sir how can i connect the android phone to control the automation?<br>
sir how can i connect the android phone to control the automation?<br>
<p>G.T</p>
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 .
<p>Hi ChetanK23.. you need use this site <a href="http://www.noip.com/" rel="nofollow">http://www.noip.com/</a></p><p>Watch this video</p><p>https://www.youtube.com/watch?v=LerqGqdhzhQ</p>
<p>hello; great project.</p><p>how i can repeat ir commands from my air conditioner? and use on the app?</p><p>thank you</p>
<p>..</p>
<p>thank , you. but how i can record and repeat the codes from my air conditioner ?</p>
<p>You can use examples of the IRremote library.. Watch this video</p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/3qRz4hQA11Y" width="500"></iframe></p>
<p>Hi</p><p>In this video you can see how to make what you need<br><br>https://www.youtube.com/watch?v=WzxIVK33bg4<br><br>You need the Ir receiver.. <br>change to Pin11 or change the code for PIn2, (Picture)<br><br>Enjoy</p>
Hello Thanks<br><br>In this video you can see how to make what you need<br><br>https://www.youtube.com/watch?v=WzxIVK33bg4<br><br>You need the Ir receiver.. <br>change to Pin11 or change the code for PIn2, (Picture)<br><br>Enjoy
<p>Dear AlanV2,</p><p>Please have a look on the attached image. I try a lot but got same error.</p><p>i use the IDE 1.5 , 1.05 . 1.5.3.</p><p>Can you guide me how to solve the issue<br><a href="https://www.instructables.com/member/AlanV2" rel="nofollow"> </a></p><p></p>
Hi Snyksa..<br><br>You can fix, just remove &quot;#include &quot;<br>and everything related<br><br>This code run just in arduino sketch 1.0.5 with IRremote library inside the directory...<br><br>I have helped<br>Alan Vieira
<p>Well Iv been trying to replicate your project for my own <br>house, but I want to know how it will work if I connect it to my home <br>router and then assign it an IP from there?<br>So, instead of connecting to the Internet Ill use it as a LAN device.<br> <br>Also I want to host the webpage onto my own PC i.e localhost, can you tell me how that will work? <br><br>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.</p>
<p>Hi, Good morning Rohit</p><p>Well, if you need connect to ip local, change the arduino code fragment </p><p>byte ip[] = { 192, 168, 1, 99 }; // IP the arduino</p><p>EthernetServer server(80); // Port acess</p><p>client.println('&lt;'MET A HTTP-EQUIV='refresh' CONTENT='4; URL=http://192, 168, 1, 99/'&gt;&quot;);</p><p>First you need look in your IP / PC the group 192.168.&quot;1&quot;.99</p><p>if you are not with 1.. change to the number you have on your computer</p><p>You also need to change in &quot;SmartHomeAPP&quot; </p><p>http://192.168.1.99/</p><p>Don't forget in app you need the &quot;/&quot; at the end</p><p>With these changes will work</p>
<p>work also with arduino uno ?</p><p>thanks</p>
<p>Yes.. It works</p>
<p>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 192.168.1.57.. porque abro la app (apk) y me sale error de conexion .. eso es por el dominio..como cambio el codigo solo para red local.</p>
<p>You need change in app your URL... </p>
<p>03 - In application &quot;SmartHomeAPP&quot; you need change to a URL=<a href="http://seudominio.no-ip.org/" rel="nofollow">http://seudominio.no-ip.org/</a>' Where do i go and change the url in app inventor? any help appreciated</p>
<p>You need change your URL like that</p><p>Example: if you edit your code in this way:</p><p>byte ip[] = { 192, 168, 1, 99 }; // IP the arduino</p><p>EthernetServer server(80); // Port acess</p><p>You URL will look like this:</p><p>URL=<a href="http://seudominio.no-ip.org/" rel="nofollow">http://192.168.1.99:80/</a></p>
<p>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..</p>
<p>Hi. I am engineer of WIZnet.</p><p>May i introduce your instructables to our Web site - WIZnet's Musuem (http://wiznetmuseum.com) ?</p><p>Thank you in advance.</p>
<p>Hi Eric,</p><p>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.</p><p>--</p><p>Vksalian</p>
<p>Hi Vksalian.</p><p>We have W5500 chip Ethernet libraries for MSP430 at WIZnet Wiki.</p><p>(These lib for MSP430 Launchpad + WIZ550io module)</p><p>I think this code will be appropriate skelecton for your development.</p><p>Please visit our our wiki page.</p><p><a href="http://wizwiki.net/wiki/doku.php?id=osh:ioshield-l:updatelib" rel="nofollow">http://wizwiki.net/wiki/doku.php?id=osh:ioshield-l...</a></p>
<p>Yes.. when you're done... send the link to me.. ok?</p>
<p>Posting done here.</p><p>Thanks.</p><p><a href="http://wiznetmuseum.com/portfolio-items/smart-home-automation-with-android-ethernet-arduino" rel="nofollow">http://wiznetmuseum.com/portfolio-items/smart-home...</a></p>
<p>Sure. I will leave a reply to you as your instructables is posted on the our museum site.</p><p>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.</p><p>&gt;&gt; Eric Jung, hkjung@wiznet.co.kr</p>
<p>Sensacional! esperando meu shield ethernet chegar para fazer!</p>
<p>I have verify the code but it show up error compiling!</p><p>Would you remedy me?</p>
<p>Send me a PrintScreen of the error..</p><p>Do you have all the libraries? (try using Arduivo IDE version 1.5)</p>
<p>The image i have uploaded!</p><p>I was using Arduino IDE version 1.6</p><p>I newbie in Arduino! Where to get the libraries?</p><p>Thanks in advance!</p>
<p>This error happens because you using Arduino IDE Version 1.6</p><p>The library the IRemote.h in Version 1.6 is not compatible</p><p>Try using the Arduino IDE Version 1.5 </p>
<p>The problem is same as well.</p><p>even though i try 1.0.5 version</p>
<p>Uninstall your arduino IDE remove all folders ..</p><p>then download version 1.0.5 again ..</p><p>then remove the code the part that relates to IRemote.h library</p>
Nice Ible and idea ...

About This Instructable

94,742views

199favorites

License:

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: