Home automation is becoming more and more popular, attracting people to buy it. There are many ideas that can be implemented on the web, which have never been seen before. Show your friends on your smartphone: You can switch the lights in the apartment a few kilometres away from the apartment, and you can control the door through a camera. cool!
Step 1: Material
Smart home automation with android+ Ethernet Internet + Arduino
- Smartphones (Android 2.3 system)
- Line Ethernet + Router (I'm using Tp-link (tl-wr740n)
- Arduino Mega2560 or Arduino Uno + W5100 Board (Ethernet)
- Led IP (optional)
Step 2:app invertor (a fully online-developed Android programming environment) (APP via network control Arduino)
First, you need to create an app Android, and then I use an app Invertor 2 link:
http://ai2.appinventor.mit.edu/
Reference: Https://www.youtube.com/watch?v=rwsKzyEpgoE
(Tutorial: Appethernet-app inventor 2/channel:android e Arduino)
If you need to change to English, download. AIA into my project (because I'm using Portuguese)
Http://www.mediafire.com/download/pbcepmryegczdpb/SmartHouseApp.aia (Project. AIA)
In the andoid environment, download and install the app:
http://www.mediafire.com/download/v2yk79xk91eaw57/SmartHouseApp.apk
Step 3: Download the routine to Arduino Mega--code link download
You need to change:
byte ip[] = {192, 168, 0, 00}; IP the Arduino
Ethernetserver server (80); Port acess
Attention:
01-You need IDE 1.0.5 version-code cannot work under IDE 1.0.6 due to Irremote library
02-page will automatically refresh every 4 seconds if you need to change: client.println (' < ' MET A http-equiv= ' Refresh ' content= ' 4; Url=http://seudominio.no-ip.org/ >");
03-In the "Smarthomeapp" application, you need to change to a url=http://seudominio.no-ip.org/'
04-Change your LED IR code to turn on/off your TV or stereo
Lindo Download Sketch Arduino INO
Http://www.mediafire.com/view/v2y3ztk5uhex2ij/APP_ETHERNET_INVENTOR_WAKE.ino
How to create a http://seudominio.no-ip.org/
Access Link: https://www.youtube.com/watch?v=1FWGt5gnnYs orhttps://www.youtube.com/watch?v=zpvvoedjsww
Step 4: Understand the code and key features
The method "Get" is used to send a variable to Arfduino, and you can see the following code:
if (c = = ' \ n ') {
if (Readstring.indexof ("lampada1") > 0) {
Digitalwrite (Lampada1,!digitalread (LAMPADA1)); }
---------send the page a variable "lampada1"
Then the Arduino reads the entire page and then returns the "Get" release, and you can see the following code:
Botao lampada1
if (Digitalread (lampada1)) {statusled = "Ligada";}
else {statusled = "Desligada";} client.println ("
Lampada 1-"+statusled+"
");
---------in this piece can see ' +statusled+ ', it returns to the relay this on or off page
//-------------------------------------------------------------------------
Translated from: Instructables
Realization of Intelligent Home automation (Android+ethernet Internet+arduino)