Date: 29-06-2016
File: sketch_spiti_sensors_mqtt_led.ino
/* MQTT topic addressing
Arduinos nodes
12 xx xx x γραμματοκιβώτιο 192.168.1.90
13 xx xx x for garaz 192.168.1.89
14 xx xx x for garden 192.168.1.88
15 xx xx x house sensors 192.168.1.86
16 xx xx x house alarm 192.168.1.87
17 xx xx x for ηλεκτρικος πινακας 192.168.1.91
18 xx xx x medicine machine 192.168.1.92
19 xx xx x kitchen timer 192.168.1.93
20 xx xx x kitchen βραστήρας αυγών 192.168.1.94
21 xx xx x kitchen πλύσιμο φρούτων και λαχανικών 192.168.1.95
22 xx xx x kitchen φριτέζα 192.168.1.96
Rooms codes
xx 11 xx x= eisodos
xx 12 xx x= paidiko children room
xx 13 xx x= koyzina kitchen
xx 14 xx x= ypnodomatio bedroom
xx 15 xx x= saloni
xx 16 xx x= diadromos corridor
xx 17 xx x= mpanio bath
xx 18 xx x= patari
xx 19 xx x= garaz
xx 20 xx x= out door ejodos
xx 21 xx x= grafeio office
xx 22 xx x= kouti synagermou
device ID:
xx xx 11 x = light current sensor //δεν χρησιμοποιείται
xx xx 12 x = Light detector ceiling φωτοαντίσταση
xx xx 13 x = for rele ανοιγει ρολα φώτα
xx xx 14 x = pir radar
xx xx 15 x = sound
xx xx 16 x = Temperature_F and Humidity
xx xx 17 x = fire //δεν χρησιμοποιείται
xx xx 18 x = gas //δεν χρησιμοποιείται
xx xx 19 x = contact window shutter and doors //δεν χρησιμοποιείται
xx xx 20 x = diaroes
xx xx 21 x = tamper
xx xx 22 x = flame
xx xx 23 x = ultrasonic //δεν χρησιμοποιείται
xx xx 24 x = ir
xx xx 25 x = inputs switch //δεν χρησιμοποιείται
xx xx 26 x = reyma boiler //
xx xx 27 x = reyma kitchen //
xx xx 28 x = reyma general //
sensor ID:
xx xx xx 2= light current sensor //δεν χρησιμοποιείται
xx xx xx 3= light watt να ακυρωθει //δεν χρησιμοποιείται
xx xx 12 2= Light ceiling φωτοαντίσταση
xx xx 23 2= ultrasonic //δεν χρησιμοποιείται
xx xx 13 4= rele1 for lights
xx xx 13 5= rele2 ανοιγει ρολα
xx xx 13 6= rele3 for night light
xx xx 13 7= rele4 κλεινει ρολα
xx xx 14 2= pir radar
xx xx 15 2= sound
xx xx 16 2= Temperature_F
xx xx 16 3= Humidity
xx xx 17 2= fire //δεν χρησιμοποιείται
xx xx 18 2= gas //δεν χρησιμοποιείται
xx xx 19 2= contact παραθυρου window
xx xx 19 3= contact ρολων shutter
xx xx 19 4= doors
xx xx 20 2= diaroes
xx xx 20 3= diaroes plynthrio
xx xx 21 2= tamper synagermou //δεν χρησιμοποιείται
xx xx 21 3= tamper radar //δεν χρησιμοποιείται
xx xx 22 2= flame //δεν χρησιμοποιείται
xx xx 24 2= ir //δεν χρησιμοποιείται
xx xx 25 2= health alarm //δεν χρησιμοποιείται
xx xx 25 3= panic alarm //δεν χρησιμοποιείται
xx xx 25 4= silance alarm //δεν χρησιμοποιείται
xx xx 26 3= energy //boiler amber
xx xx 26 2= energy //boiler watt
xx xx 27 3= energy //kitchen amber
xx xx 27 2= energy //kitchen watt
xx xx 28 3= energy // general amber
xx xx 28 2= energy //general watt
Pins arduino mega2560
Analogika
A0 =
A1 =
A2 = current sensor sct013-000 θα ακυρωθει
A3 =
A4 = light sensor φωτοαντίσταση paidiko topic 15 12 12 2 pull-up
A5 = light sensor φωτοαντίσταση koyzina topic 15 13 12 2 pull-up
A6 = light sensor φωτοαντίσταση ypnodomatio topic 15 14 12 2 pull-up
A7 = light sensor φωτοαντίσταση saloni topic 15 15 12 2 pull-up
A8 = light sensor φωτοαντίσταση diadromos topic 15 16 12 2 pull-up
A9 = light sensor φωτοαντίσταση mpanio topic 15 17 12 2 pull-up
A10 = light sensor φωτοαντίσταση patari topic 15 18 12 2 pull-up
A13 = light sensor φωτοαντίσταση garaz topic 15 19 12 2 pull-up
A14 = light sensor φωτοαντίσταση outdoor topic 15 20 12 2 pull-up
A15 = radar outdoor pull-up topic 15 20 14 2 pull up
Ψηφιακά
# = water leak
# = IR sensor υπέρυθρες
# = sound
# = flame
# = gas
# = ultrasonic
0 =
1 = diarooh mpanio νιπτήρα pull-up topic 15 17 20 2
2 = ethernet led
3 = MQTT led
4 = SS sd card not use for others
5 = rele1 paidiko topic 2 13 4
6 = rele2 paidiko topic 2 13 5
7 = rele3 paidiko topic 2 13 6
8 = rele4 paidiko topic 2 13 7
9 = PIR κίνιση paidiko topic 15 12 14 2 pull-up
10 = SS for ethernet not use for others
11 = DHT11 θερμοκρασία υγρασία paidiko topic 15 12 16 2 topic 15 12 16 3 pull-up
12 = rele1 koyzina topic 3 13 4
13 = rele2 koyzina topic 3 13 5
14 = rele3 koyzina topic 3 13 6
15 = rele4 koyzina topic 3 13 7
16 = PIR κίνιση koyzina topic 15 13 14 2 pull-up
17 = DHT11 θερμοκρασία υγρασία koyzina topic 15 13 16 2 topic 15 13 16 3 pull-up
18 = rele1 bedroom topic 4 13 4
19 = rele2 bedroom topic 4 13 5
20 = rele3 bedroom topic 4 13 6
21 = rele4 bedroom topic 4 13 7
22 = PIR κίνιση bedroom topic 15 14 14 2 pull-up
23 = DHT11 θερμοκρασία υγρασία bedroom topic 15 14 16 2 topic 15 14 16 3 pull-up
24 = rele1 living topic 5 13 4
25 = rele2 living topic 5 13 5
26 = rele3 living topic 5 13 6
27 = rele4 living topic 5 13 7
28 = PIR κίνιση living topic 15 15 14 2 pull-up
29 = DHT11 θερμοκρασία υγρασία living topic 15 15 16 2 topic 15 14 16 3 pull-up
30 = rele1 corridor topic 6 13 4
31 = rele2 corridor topic 6 13 5
32 = rele3 corridor topic 6 13 6
33 = rele4 corridor topic 6 13 7
34 = PIR κίνιση corridor topic 15 16 14 2 pull-up
35 = DHT11 θερμοκρασία υγρασία coridor topic 15 16 16 2 topic 15 14 16 3 pull-up
36 = rele1 bath topic 7 13 4
37 = rele2 bath topic 7 13 5
38 = rele3 bath topic 7 13 6
39 = rele4 bath topic 7 13 7
40 = PIR κίνιση bath topic 15 17 14 2 pull-up
41 = DHT11 θερμοκρασία υγρασία bath topic 15 17 16 2 topic 15 14 16 3 pull-up
42 = diaroi patari topic 15 18 20 2 pull-up
43 = rele ilektrobana νερού πατάρι topic 15 18 13 4
44 = diaroi koyzina topic 15 13 20 2 pull-up
45 = rele ilektrobana νερού geniko-κουζινα topic 15 13 13 4
46 = rele ilektrobana νερού νιπτήρα bath topic 15 17 13 4
47 = diaroi plynthrio bath topic 15 17 20 3 pull-up
48 = sound παιδικο
49 = sound κουζινα
50 = MISO ETHRNET/RFID
51 = MOSI ETHERNET/RFID
52 = CLK ETHERNET/RFID
53 = not use για πάντα
Υλικά
24 Χ 10ΚΩ