Annexe 2 : Code source Arduino des fonctions
  
  
//Vous pouvez changer la distance de detection dessous. if
(Distance<=10){ 
fftane(6,400,100); 
digitalWrite(BZ,HIGH); delay(5000); 
} 
else { 
noTone (6) ; 
digitalWrite(BZ,LOW); delay(200);}} 
void gaz() 
{ 
sensorValue = analagRead(MQ2pin); // read analog input pin 0 
Serial.print("Sensor Value: "); Serial.print(sensarValue); 
if(sensoiValue > 522) 
{ 
Serial.print(" ( Smoke detected!"}; digitalWrite(EZ,HIGH); 
delay(5000); 
} 
Serial.print("Sensor Value: "); Serial.print(sensoiValue); 
if(sensoiValue > 522) 
{ 
Serial.print(" 1 Smoke detected!"); digitalWrite (BZ, HIGH) ; 
delay(5000); 
} 
Serial.println(""); 
delay(2000); ff wait 2s for next reading 
} 
82 
Connexion au bluetooth 
83 
include Sof twareSerial . h> SoftwareSerial hcO6 ( , 3) f 
void setup() { 
//Initialize  Serial Monitor Serial.begin(96O@) 
Serial.println ("ENTER AT Commands="); //Initialize Bluetooth
Serial Port 
hoD6 .begin (%%DD) ; 
} 
void loop() { 
//Write data from HC@6 to Serial Monitor if
(hcO6.available00)4 
Serial .write (hc O6 . read () ) 
} 
//Write from Serial Monitor to HCO6 if (Serial . ava ilable 0 {
hcD 6 . wr ite (Serial . read ( ; 
} 
Annexe 3 : Programme des blocs de l'application
Android
  
initielrze global ~ b ~. crew empty fist 
SMS1  · !PhoneNumber  · 
Text  · IZMIESMS envnye
--Jy 
Le mo: de asse est incorrect 
Sound' 
set global essairestant  · b 
global essairestant  · 
Le mot de passe ne peut étre vide.
g 
callIMMMII _ShorrAlert 
notice 
s~ 1n 
show Warnings 
ci 
Mauvais I..in_ 
global essairestant  · BIN 1  
Le login ne pent eire 0 
Bouton EnvoyerSmS  · 
global coderecu  · 
random integer from 4000 to 
iniltalze global 
FIGURE 5.27 -- bloc de l'interface
s'authentifier 
  
Le login ne peut etre vide. 
Euttonauthentfication 
Liriar- 
Zane de_texteCnde  · . Text  · pet global
coderecu  · 1 
gras call mgmlip.Pby 
Gm lamp .Stïy&J rt 
in successful 
opal 1E1413 screen SereenPeare  
else call I.Shown1Jert 
Mauvais code veuillez reessayery 
Soundl 
seib I 
lobai essairestant  · 1.11111  
LabetESSAI RESTANT  · 
Text  · b I = global essairestant
 ·' 
Ktglobal essairestant  · I
= 10 
  
84 
FIGURE 5.28 -- bloc de l'interface s'authentifier
suite 
  
BoutoraIlumchambreP 
.Dfrck 
BoutonallumchambreP 
Allumer 
IBoutonallumchambreP  · AText '
I 
BoutorrallurnchambreP 
TextColor  · 
BluetoothClient1 
LED10 
Allumer 
BoutonallurncharnbreP 
LEDchambresup - 
ampauloff 
Picture - 
Prcture 
TextColor 
EcJairage 
-BackPressed 
PluetoothClient1 
Eteindre 
fiMPOULEALLUM - A Picture  ·
1 
111=111- 
BoutonallumchambreS  · r* 
  
o if F 
  
BluetoothClientl 
_SendText 
text 
IQ to 
TextColor 
Boutonallumchambre 
b 
Picture 
AMPOULEALLtJN1 -ILELcture ' 1 
LEDsecond 
Bluetooth lientl 
LED20 
SendText 
te 
BoutonallumchambreS 
TextColor 
BoutonallumchambreS 
Picture 
b 
K-ampouloff -
Picture  
LEDsecond 
Men ca~M 
sei 
set 
se# 
else cal 
EMI to GEM 
'to  · 
EoutonallumchambreS 
85 
FIGURE 5.29 -- bloc de l'interface
Eclairage 
  
  
86 
FIGURE 5.30 - bloc de l'interface Ventilation 
87 
 |