Final Project Journal

Project Ideation

1- Tell us about the idea of your project. Why do you care about this? What were you inspired by? Include images and videos of similar projects

Make a gas leak detector to preserving lives from the threat of the silent killer (natural gas).
It increases safety and security levels inside your home, as soon as the natural gas leaks from the pipes connected to the cookers or heaters and replaces the oxygen in the air, the lung is filled with carbon monoxide gas (CO) instead of oxygen and is saturated with it. This leads to suffocation without warning, as the gas is odorless - especially at the beginning of the leak - which makes it leak into the respiratory system quietly until it ends in death. My inspiration came from the idea of detecting water leakage, which is placed next to the water pipes to send an alert that there is water leakage in a specific place, and then repair the pipes before the damage extends to more places, and also to preserve water from waste. It's suitable for homes, office buildings, factories, schools, hotels, warehouses, entertainment areas, trains, and more.

Project Construction

2- Explain the CAD process of your project. How did you use the software to design your project? (List the softwares/tools/materials...etc that you used)

I used Fusion 360 to create the design.

Software: RDWorksV6.
Machine : El Malky ML1390 CO2 Laser Cutter.
Material: Plywood sheet 0.3*30*50 cm.

The Process of  Design as fllow steps:-

Autodesk Fusion 360 (Personal - Not for Commercial Use) 2023-03-18 14-14-39.mp4

3- Explain the fabrication process of your project. How did you use the machine to fabricate your project? (List the softwares/tools/materials...etc that you used)

Fabricate the project by using below :-

Software : RDWorksV6.
Machine : El Malky ML1390 CO2 Laser Cutter.
Material : Plywood sheet 0.3*30*50 cm.

Fabrication process came as steps:-

Project Electronics & Power Management 

4- Describe your electronic circuit. What are the input and action components? What is the function of each? How do the components integrate together to form your smart system? (List the softwares/tools/components...etc that you used)

The project inputs as following:-

The Project action as following:-

A- when sensor detect gas :

B- when sensor not detect gas :

The function of each components.

I used Tinker cad  to draw the circuit by adding the components together and the Code as below picture and link

The components integrate together to form smart system as following:-

5- What is your power source? How did you select the suitable power source for your project? (List the softwares/tools/components...etc that you used)

Power source will be power supply 9-V to be suitable with Arduino UNO board, it will be very good to supply power to all components

Project Programming

6- Describe the code of your project. How did you program each function of the project?  

// C++ code

//

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

                                    // Identify the pin number for each output components.

int ledG = 8;                      // Identify the pin 8 for Green Led.

int ledR = 7;                      // Identify the pin 7 for Red Led.

int buzz = 4;                      // Identify the pin 4 for Buzzer.

int fan = 12;                      // Identify the pin 12 for Fan relay which will control ther fan.


float gas;                      // Identify the gas as floating data with decimal.


void setup() {

  lcd.init();                              // initialize the lcd 

  lcd.backlight();                         // Identify the backlight of the screen

  lcd.setCursor(0, 0);                // Identify the start place of display data on LCD screen as from cell 0 in row 0


  pinMode(ledR, OUTPUT);                       // Identify the Red Led as output to do action lighting.

  pinMode(ledG, OUTPUT);                       // Identify the Green Led as output to do action lighting.

  pinMode(buzz, OUTPUT);                       // Identify the buzzer as output to do action play sound.

  pinMode(fan, OUTPUT);                       // Identify the Fan as output to do action run.


  pinMode(A1, INPUT);                       // Identify the A1 for Gas sensor as Input to receive data.


  Serial.begin(9600);                       // Identify the serial data to display reading of data as serial monitor.

}


void loop() {

  float gas = (analogRead(A1));            // Identify word gas as reading from gas sensor data.

  Serial.print("Gas Leak= ");            // print "Gas leak = " as word on the serial monitor.

  Serial.print(gas);                     // print gas value data after word "Gas leak = " in the serial monitor.

  Serial.println();  // print all above data on the serial monitor to see the gas sensor reading data on the PC screen.


  if (analogRead(A1) >= 1000) {               // Logical condition mean when gas value is bigger than 1000 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, HIGH);               // Turn on the buzzer sound

    digitalWrite(fan, HIGH);               // Turn on the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led


    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 10");            // Display "Gas Level . 10 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.


    tone(4, 1000, 100);                     // Tune of the buzzer.

  } else if (analogRead(A1) >= 900 && analogRead(A1) < 1000) {
// Logical condition when gas value is bigger than 900 and less than 1000 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, HIGH);               // Turn on the buzzer sound

    digitalWrite(fan, HIGH);               // Turn on the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led


    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 09");            // Display "Gas Level . 09 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.


    tone(4, 1000, 100);                     // Tune of the buzzer.

  } else if (analogRead(A1) >= 800 && analogRead(A1) < 900) { 
// Logical condition when gas value is bigger than 800 and less than 900 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, HIGH);               // Turn on the buzzer sound

    digitalWrite(fan, HIGH);               // Turn on the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led


    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 08");            // Display "Gas Level . 08 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.


    tone(4, 1000, 100);                     // Tune of the buzzer.

  } else if (analogRead(A1) >= 700 && analogRead(A1) < 800) {
// Logical condition when gas value is bigger than 700 and less than 800 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, HIGH);               // Turn on the buzzer sound

    digitalWrite(fan, HIGH);               // Turn on the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led

    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 07");            // Display "Gas Level . 07 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.


    tone(4, 1000, 100);                     // Tune of the buzzer.

  } else if (analogRead(A1) >= 600 && analogRead(A1) < 700) {
// Logical condition when gas value is bigger than 600 and less than 700 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, HIGH);               // Turn on the buzzer sound

    digitalWrite(fan, HIGH);               // Turn on the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led

    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 06");            // Display "Gas Level . 06 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.

    tone(4, 1000, 100);                     // Tune of the buzzer.

  } else if (analogRead(A1) >= 500 && analogRead(A1) < 600) {
// Logical condition when gas value is bigger than 500 and less than 6000 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, HIGH);               // Turn on the buzzer sound

    digitalWrite(fan, HIGH);               // Turn on the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led

    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 05");            // Display "Gas Level . 05 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.

    tone(4, 500, 100);                     // Tune of the buzzer.

  } else if (analogRead(A1) >= 400 && analogRead(A1) < 500) {
// Logical condition when gas value is bigger than 400 and less than 500 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, HIGH);               // Turn on the buzzer sound

    digitalWrite(fan, HIGH);               // Turn on the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led

    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 04");            // Display "Gas Level . 04 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.


    tone(4, 300, 100);                     // Tune of the buzzer.

  } else if (analogRead(A1) >= 300 && analogRead(A1) < 400) {  
// Logical condition when gas value is bigger than 300 and less than 400 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, HIGH);               // Turn on the buzzer sound

    digitalWrite(fan, LOW);               // Turn off the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led

    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 03");            // Display "Gas Level . 03 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.


    tone(4, 100, 100);                     // Tune of the buzzer.

  } else if (analogRead(A1) >= 200 && analogRead(A1) < 300) {  
// Logical condition when gas value is bigger than 200 and less than 300 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, LOW);               // Turn off the buzzer sound

    digitalWrite(fan, LOW);               // Turn off the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led

    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 02");            // Display "Gas Level . 02 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.


  } else if (analogRead(A1) >= 100 && analogRead(A1) < 200) {  
// Logical condition when gas value is bigger than 100 and less than 200 do as below

    digitalWrite(ledR, HIGH);               // Turn on the Red Led

    digitalWrite(buzz, LOW);               // Turn off the buzzer sound

    digitalWrite(fan, LOW);               // Turn off the Fan

    digitalWrite(ledG, LOW);               // Turn off the green Led

    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("GAS LEVEL . 01");            // Display "Gas Level . 01 " as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("Reading");                    // Display "Reading" as word on the  LCD screen.

    lcd.print(analogRead(A1));               // Display Gas value as data on the  LCD screen.

  } else {

    digitalWrite(ledR, LOW);               // Turn off the Red Led

    digitalWrite(fan, LOW);               // Turn off the Fan

    digitalWrite(buzz, LOW);               // Turn off the buzzer sound

    digitalWrite(ledG, HIGH);               // Turn on the Green Led

    lcd.setCursor(0, 0);                    // Identify the place of display data on LCD screen as from cell 0 in row 0

    lcd.print("NO GAS LEAKAGE");            // Display "NO GAS LEAKAGE" as word on the  LCD screen.

    lcd.setCursor(1, 1);                    // Identify the place of display data on LCD screen as from cell 1 in row 1

    lcd.print("You are safe");            // Display "You are safe" as word on the  LCD screen.

    

  }

}

Project Integration & Testing 

7- Demonstrate with text and visuals how did you integrate the project’s modules together? What are the testing results? (Include a Demo video separately, showing a proof of functionality)

Integrate the project’s modules together as below:-

A- Green & Red led's

Integrate the project’s modules together as below:-

B- Buzzer

Integrate the project’s modules together as below:-

C- MQ6 Gas Sensor

Integrate the project’s modules together as below:-

D- Relay

Integrate the project’s modules together as below:-

E- Fan

Integrate the project’s modules together as below:-

E- LCD I2C

The testing result came very well by running the Arduino code as video below:
When the Gas sensor detect Gas --> the red led turn on & Fan turn on & buzzer play sound & Gas level display on the LCD screen.

1.mp4
8.mp4
9.mp4

Sharing & Collaboration 

8- Did you ask for feedback? What are the ideas that others have contributed or suggested? What was someone else’s idea that you built upon? How did you help your peers? How did your peers help you?

My peers and instructors feedback came as awesome, they are really amazed the project result. Ahmed mokhtar suggested to use GSM to send message on mobile or smart watch. but unfortunately the GSM module is not available currently.

I helped my peer Fatma to use project tool on FUSION360 for her project.
My peers helped me by support to finish project quickly as i am hero of the team :D

Overcoming Challenges 

9- When you got stuck, what/who did you turn to? At what point did you have to pause to research or learn more before moving on? What are some mistakes, pitfalls, or challenges that others can avoid if they were doing this project?

I faced a challenge when i started to test the gas sensor during week 9, after i wrote the code and started to do testing, i found that serial monitor display the data as Q.Mark?????
I didn't understand why that happen, first of thought was there a problem with the gas sensor MQ6.

I  did review on the code step by step i discovered that i did mistake in the code which i put   Serial.begin(9600); inside the void loop() but the correct place is inside the void setup()

I did the change and Gas sensor data displayed normally.


Future Work

10- If you had more time, what is one thing you would change/ Do next in your project?

I would add Mobile GSM module to send message alert to device owner mobile in case there is a gas leakage.
As in below link:-

 Final Project Design Files