You are on page 1of 3

Project title:

Smoke control alarm

Design Document

By:
Eman mohamed Tawfik ID:4121006
Sandra Samaan ID:4121037
Eman Nagy ID:4121026
Mahmoud Atef ID:4121067
Mostafa Hossam Eldin ID:4121042
Function that we uses in our project code:
 First we will declare global the variables we needs.
 Then declare the pins' variables 3 digital pins for the alarm or the
buzzer, the button and the led and 1 analog pin for the smoke
sensor.
1) Void setup () {
Setup the digital pins that we will use to the alarm, the led and the button.
}
2) Void loop () {
Call the defined functions which are:

 Smoke Value calculation By the MQ-2 Smoke Sensor --- >


CalculateSmokeValue();
 Open the alarm (make the alarm (buzzer) make sound) when the
value is exceed a specific value ---> OpenAlarm(SmokeValue);
 Open the led when the value is exceed a specific value and make it
blinking --> OpenLed(SmokeValue);
 Close the alarm when the button is pressed--->
CloseAlarm(buttonState);
}
3) int CalculateSmokeValue () {
Smoke sensor calculation: calculate and return the smoke value.
}

4) Void OpenAlarm(SmokeValue) {

Open the alarm (make the alarm (buzzer) make sound) when the smoke
value exceeds a specific value.}

5) Void OpenLed(SmokeValue) {

Open the led when the value is exceed a specific value and make it
blinking. }
6) Void CloseAlarm(buttonState) {
Close the alarm when the button is pressed.
}

Flow chart :

You might also like