-
Notifications
You must be signed in to change notification settings - Fork 12
/
README
148 lines (94 loc) · 4.06 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
--------------------------------------------------------------------
This software is distributed under creative commons license
http://creativecommons.org/licenses/by-nc-nd/2.0/it/deed.en_US
Author: Mattia Lipreri - [email protected]
--------------------------------------------------------------------
I created this project and my target is improve the comfort of my home.
Taking a look around I noticed that home automation solution proposed by
the big market player are too much expensive for me and, above all, I
should create new wires connections between light, plug, etc.. and the
control box.
My idea is use what we already have without spend lot of money to buy a
owner solution, so I started with arduino, my android mobile phone, some
relays and my home.
I have a nice home, 2 bad rooms, kitchen with living room and it was very
nice tka e the control of the lights, gate and door with my mobile phone.
Let's start to play.
I used an Arduino 2009 with ethernet shield and the game is very easy, I
send some http message to arduino, he moves some relays and give me back
a JSON response. Not so hard, but the hard business is interfacing with
the electrical wiring of home, with some patience I found what I need and
I linked those wires at the relays.
Go deeper.
Let's analyze a bit what my mobile send to arduino, the actors in this
scenario are:
AS = Arduino Station (arduino 2009/Mega + ethernet shield with relays
linked to arduin digital out)
M = Master (android app)
Sync Mobile - Arduino
You have to configure the ip of your arduino on the app, in this way when
you perform a sync the mobile will send to arduino this:
http://arduinoip/?m=hello
and arduini will reply with this json message:
{"ip" : "arduinoip", "devices" : [" + "{ "type" : "gate", "name" :
"cancellino ingresso", "out" : "5"}, {"type" : "door", "name" : "porta
ingresso", "out" : "4"}, {"type" : "light", "name" : "luce soggiorno",
"out" : "6"}, {"type" : "light", "name" : "luce cucina", "out" : "7"},
{"type" : "temperature", "name" : "camera da letto", "out" : "0"},
{"type" : "temperature", "name" : "camera bimbi", "out" : "9"}, {"type" :
"wattmeter", "name" : "consumo energetico casa", "out" : "10"}]}
so we know what sensor/realys are linked to arduino and what they are
used for.
Take a closer look at this message:
ip is the arduino ip
out is the arduino pin where the relay/sensor is linked
name a human identifier
type object type
Right now there are the following type available:
plug
light
door
gate
temperature
humidity
wattmeter
The type temperature, humidity, wattmeter can't be controlled because
they are sensons, the app has a background job that retrieve this value
and store into a database, in the future we could make graph or use this
data for statistical consideration.
Now the app is in sync with arduino!
Put something on/off
We just have to call to turn something on:
http://arduinoip/?out=1&status=1
status can be 1(on) or 0(off)
out point at the arduino pin
our arduino will give back this JSON massage if the transaction succeed:
{"out": "4", "status" , "1"}
What can we do with the andriod app:
- sync the app with arduino
- turn something on/off
- create custom action (turn light on and then open the gate)
Items used:
1 Arduino 2009
1 Ethernet shield
1 Relay with driver
1 power pack
1 electrical stuff
1 Pannello di plexiglas
Total in euro: 70
What I control:
- living light
- home gate
- front door
- check living room temperature
What I like to do in the future:
- integrate my irrigation system
- trigger an action at a specified time (need to work on android app)
- link another arduino and handle it with the app
- when the software will work fine give the code at the community
Sorry for my english, I'm not a native speaker.
--------------------------------------------------------------------
This software is distributed under creative commons license
http://creativecommons.org/licenses/by-nc-nd/2.0/it/deed.en_US
Author: Mattia Lipreri - [email protected]
--------------------------------------------------------------------