Smart Home With Arduino

Published on March 2017 | Categories: Documents | Downloads: 57 | Comments: 0 | Views: 225
of 16
Download PDF   Embed   Report

Comments

Content

Food

Living

Outside

Play

Technology

Workshop

Smart home with arduino
by Nikus on October 6, 2014

Table of Contents
Smart home with arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Intro: Smart home with arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2

Step 1: Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2

Step 2: Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

Step 3: Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

Step 4: How it works? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

Step 5: Appliaction for android. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

Step 6: Application configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

Step 7: Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Step 8: Port forwarding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Step 9: NO IP (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Step 10: Test it! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Step 11: EDIT: android app source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

http://www.instructables.com/id/Smart-home-with-arduino/

Author:Nikus

arduino poland
Hi. My name is Nikodem. I live in Poland, I'm 15 years old. I like to program and invent new things. In the future, I want to start a company that inventing new
things.

Intro: Smart home with arduino
Hello.
I will show you how to build your own smart home. It shows the temperature both inside and outside, if the window is open or closed, shows when it rains and make
alarm when the PIR sensor senses move. I made the application on the android to display all the data (you can also watch it on browser). You can see temperature in
your home and other information from all over the world! Application is translated to english and polish. I built it because I wanted to make my own smart home and
control it. If you want, you can make your own smart home, all you need is parts (listed below) and a lot of desire. So let's get started.
Explanation of acronyms for beginner:
GND - ground
VCC - power
PIR - move sensor

Step 1: Parts
All the parts cost me $90
-arduino
-ethernet module ENC28J60
-thermometer DS18B20 x2
-microphone module
-rain sensor
-PIR sensor
-reed switch
-relay
-resistor 4,7k ?
-twisted-pair cable
-ethernet cable
-tools (soldering, screwdriver)

http://www.instructables.com/id/Smart-home-with-arduino/

Image Notes
1. rain sensor
2. relay
3. ENC28J60
4. DS18B20 thermometer
5. resistor 4,7 k
6. microphone module
7. reed switch
8. PIR sensor
9. breadboard
10. Arduino
11. DS18B20 thermometer

Step 2: Connection
Above I added picture from fritzing with connection. If you have a problem with it leave a comment.

http://www.instructables.com/id/Smart-home-with-arduino/

Step 3: Program
First you need to do is download, extract and import this library to arduino IDE. You can upload this program to your arduino. In the comment is an explanation of the
code.

File Downloads

smart_home.ino (5 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'smart_home.ino']

libraries.rar (21 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'libraries.rar']

Step 4: How it works?
When you click refresh in your app or in browser Arduino sends data to smartphone/browser. Application gets source code from each page ( /tempin, /tempout, /rain,
/window, /alarm) and displays it on your phone.

Step 5: Appliaction for android.
To instal app on your android phone you need to make this (you can see it on the picture above):
1. the firs first step is download smartHome.apk file
2.Send apk file to your phone
3.Open file manager and locate smarthHome.apk file
4.Click on it and click install (if you have enabled the option to install applications outside the google play you need to turn it on)
5.You have finished the installation, you can enable the application

Application is translated to english and polish. In browser you can turn on and off light but in app not because I can't do that, sorry.

http://www.instructables.com/id/Smart-home-with-arduino/

Image Notes
1. settings

http://www.instructables.com/id/Smart-home-with-arduino/

Image Notes
1. click file manager

http://www.instructables.com/id/Smart-home-with-arduino/

Image Notes
1. click smartHome.apk

Image Notes
1. click package installer

Image Notes
1. and click install

File Downloads

smartHome.apk (374 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'smartHome.apk']

Step 6: Application configuration
I'll explain how the application works. It's shows all data from your home. You can click on settings icon to edit your IP address and turn on or off alarm. When you turn on
alarm, app get data from PIR sensor in service and if it's detected move in your home it's make a notification. App retrieves the data from the motion sensor every minute.
In IP field you must enter your IP address. You can check it here.

http://www.instructables.com/id/Smart-home-with-arduino/

http://www.instructables.com/id/Smart-home-with-arduino/

http://www.instructables.com/id/Smart-home-with-arduino/

http://www.instructables.com/id/Smart-home-with-arduino/

Step 7: Browser
Type in your browser your ip / all. There you can see all the data and turn on and off light.
You can use this instead of the application on android.

http://www.instructables.com/id/Smart-home-with-arduino/

Step 8: Port forwarding
You need to open port on your router. Open your router configuration and set arduino ip and open port 80. You can see it on image above.

Image Notes
1. click on port forwarding
2. click on advanced
3. and set this
4. click save

Step 9: NO IP (optional)
You can set up an account at no ip but this is not necessary. In the picture above you can see how to configure it.

Image Notes
1. enter your ip
2. Choose hostname

Step 10: Test it!
If you want to see the data on your computer you can do this by typing into your browser yourip / all (e.g. 12.345.678.901/all) or use android application.
Remember to leave a comment and click favourite if you like my project :)

Step 11: EDIT: android app source code
Because many people asked me about android source code I add it below.

File Downloads

smartHome.rar (1 MB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'smartHome.rar']

http://www.instructables.com/id/Smart-home-with-arduino/

Related Instructables

Arduino Based
Send SMS from Automated
Arduino over
Lighting Control
the Internet
by rmagtibay
using ENC28J60
and Thingspeak
by lucasxavier11

Cheap and Easy
Arduino Wi-Fi
Hack (Photos) by
ddoss

Webserver for
home
appliances
control by Milen

How to use
Arduino to turn
on a lamp
remotely,
directly from
your
iPhone/Android
by jackbell16

Add Ethernet to
any Arduino
project for less
than 10$ by
hansc44

Advertisements

Comments
41 comments Add Comment

pshrn says:

Jan 6, 2015. 3:41 AM REPLY

for how much maximum distance from the mobile will this circuit work ?

Nikus says:

Jan 6, 2015. 6:01 AM REPLY

You can read data from all over the world (if you have internet)

VimalP says:

Dec 24, 2014. 8:02 AM REPLY

hi nikus , its vimal pandey from nepal. I am a BE computer student.I`m stucked...
I`m using arduino uno compatible (quite bigger) ethernet shield with sd slot too.
can u plz guide me to use that shield with this project???

ahmedsaad.zizou says:

Dec 22, 2014. 8:25 AM REPLY

We are in the process done an excellent project and thank you and hope to stay in touch with us
Thank you thank you thank you thank you Nikus

pshrn says:

Dec 15, 2014. 8:59 PM REPLY

hey
can i use arduino uno instead of arduino leonardo?

Nikus says:
Yes, you can use uno but you need to download library enc28j60.zip from

http://www.instructables.com/id/Smart-home-with-arduino/

Dec 16, 2014. 6:37 AM REPLY

here and connect it like on image below.

Max_valentine says:

Nov 26, 2014. 10:26 AM REPLY
Thanks for sharing . Its a Great Project !!!
I have been long looking for something like this .
The part where the sensor sends the data and is received and interpreted by the smart phone is commendable . I am planning to build the same .
As of now i have been sending data to Arduino using BC-05 Bluetooth module and it worked fine. Connecting to Local LAN would be my next step :)

iam_maker_leo says:

Nov 20, 2014. 12:16 AM REPLY

wow.... actually it can be a nice smart home....
AND... how about use Wiznet's ethernet shield instead ENC28J60...
Hahaha just kiding.... (I am working for Wiznet...)

Sasando_Rote says:

Nov 17, 2014. 12:36 PM REPLY

mantap neh...

aymen.mhili says:

Nov 16, 2014. 11:11 AM REPLY

I can design the data on smartphone long distance????

aymen.mhili says:

Nov 16, 2014. 10:41 AM REPLY

how to control Arduino board long-distance

thanos.boutros says:

Nov 14, 2014. 11:39 AM REPLY
Hello, very good job! I have a problem how can I run the app code. I am doing the import the programm with eclipce but I have two errors!
error1:The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project.
error2:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class filesSettings.java/smartHome/src/com/example/smarthome
Please you can help me?

zx lee says:

Nov 10, 2014. 3:56 PM REPLY
hi, first of all, great job on your project. I would like to ask, since your ethernet has an IP address depending on your network. does this count as a local area
network. or is it possible to access your IP address out of your local network. thanks

DOA_Brain says:

Nov 10, 2014. 11:43 PM REPLY

to access the arduino from the Internet you need to enable port forwarding in you router. like the instructions mentions.

rbright says:

Nov 11, 2014. 5:02 PM REPLY
I'm having a lot of Port Forwarding problems with a NetComm router/modem so can you advise the specific model of router you have used.

DOA_Brain says:

Nov 13, 2014. 2:20 AM REPLY
most current router/modems support port forwarding but in some ISP block ports as well so check with your ISP first before getting a new
router/modem

http://www.instructables.com/id/Smart-home-with-arduino/

Nikus says:

Nov 12, 2014. 5:14 AM REPLY

I use D-Link DIR-615.

zx lee says:

Nov 11, 2014. 2:02 AM REPLY

Thanks for the info.

Nikus says:

Nov 11, 2014. 7:21 AM REPLY

Hi!
First of all, thank you. DOA_Brain is right you need to open ports on your router.

uzziah0 says:

Nov 11, 2014. 8:57 AM REPLY
This is great. I've seen some but always seem to have problems with the ability to see status or do anything from phone or web. This is great, and not too
much in one go; I'm thinking of starting with what you have, and using other Instructibles to add to it. The other Instructibles use an Arduino Uno. You use the
Leonardo.
Can you explain why you picked that one, and will the program you include run on an Uno (this will be my first Arduino)

Nikus says:

Nov 12, 2014. 5:47 AM REPLY

First of all thanks!
I used Leonardo becouse I have it. Yes, you can use uno but you need to download library enc28j60.zip from here and connect it like on image below.
good luck!

geekOmat says:

Nov 11, 2014. 11:55 PM REPLY

Love it, voted for, thanks!

Nikus says:

Nov 12, 2014. 5:16 AM REPLY

Thanks for your vote :-)

Build_it_Bob says:

Nov 11, 2014. 4:33 PM REPLY

Very nice Nikus , I enjoyed your Instructable very much. Very nice fritzing sketch too!
Build_it_Bob

Nikus says:

Nov 12, 2014. 5:14 AM REPLY

Thanks :)

andreyeurope says:
Hi. I would be really grateful if you will show us and explain the android code.

http://www.instructables.com/id/Smart-home-with-arduino/

Nov 11, 2014. 11:56 AM REPLY

Nikus says:

Nov 11, 2014. 12:32 PM REPLY

I added it in last step :)

andreyeurope says:

Nov 11, 2014. 10:34 PM REPLY

Thanks. That helps me developing new applications and understanding better Android code.

infomaniac50 says:

Nov 11, 2014. 6:55 PM REPLY
I downloaded the source and cleaned up the code a bit. The source code for it is at https://github.com/infomaniac50/smartHome-Android. The two main
things were spelling for the refresh button and a unicode escape character for the degree symbol. I got the unicode escape from here.
http://www.fileformat.info/info/unicode/char/b0/index.htm. Very nice project. I don't have the parts for the Arduino side, thermometers, reed switch, etc, but I'll
have to go fetch some and try it out. Almost everything was sourced from Amazon too, which by the way is awesome.

gmbandeira says:

Nov 11, 2014. 11:44 AM REPLY
Pretty nice project! I hope I can do this in the next months. What about tThe Android source code, you wouldn't give us, would you?

Nikus says:

Nov 11, 2014. 12:32 PM REPLY

Thank you, I added it in last step :)

gmbandeira says:

Nov 11, 2014. 2:00 PM REPLY

Thanks a lot! :D

markche says:

Nov 1, 2014. 2:37 PM REPLY
I'm doing something very similar, but am very new to java. Do you have your Android code posted somewhere? I would like to see how it's done and modify
it a bit to fit my needs.

Nikus says:

Nov 11, 2014. 12:34 PM REPLY

I added it in the last step :)

koney says:

Nov 11, 2014. 1:25 AM REPLY

same here :-)

Ghild.Zero says:

Nov 11, 2014. 6:01 AM REPLY

please make Instructables how to make Android Software

Nikus says:

Nov 11, 2014. 7:46 AM REPLY
I know too little about Java. In internet you find a lots of tutorials about making android app. Here is link with good explanation all thing:
http://developer.android.com/training/index.html

69fordf100 says:

Nov 11, 2014. 5:58 AM REPLY
I'm in the process of making this also. What did you do with your relays? You only mentioned then in the parts and design drawing.

Nikus says:

Nov 11, 2014. 7:25 AM REPLY

Relays control light. When you claps or click on button in browser light change.

seamster says:

Oct 30, 2014. 2:07 PM REPLY

Well done! Thanks for sharing your smart home ideas!

Nikus says:
Thank you :-)

http://www.instructables.com/id/Smart-home-with-arduino/

Oct 31, 2014. 7:23 AM REPLY

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close