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:-
Open Fusion 360.
Create new project and save it.
create new assembly components.
Note: Each part of the project shall be new assembly components so you can use Fusion 360 functions as show- hidden & Join parts together ect...Create sketch so you can start draw the part dimensions.
Create extrude of the part after finish sketch with 3mm as plywood dimensions.
Repeat the Up steps with the project 4 sides (Left - Right - Font - Back ) based on the project dimensions.
Create the base side after finish all project sides by create sketch with the dimensions.
Create project from tools and select the sides slots so it will draw as it is on the base side to make sure it will fit the slot space in the base.
Create extrude of the part after finish sketch with 3mm as plywood dimensions.
Create the top side the same as you create the base side by use project tool.
Download the project components from website https://grabcad.com/
Import the project components into FUSION 360 such as ( Arduino uno board, mini bread board, Green & Red led, ON-OFF switch, Buzzer, LCD screen and Gas sensor MQ6)
Add each part of the project components in the Fusion 360 work space.
Do join to add Arduino board inside the project box.
Select the left side of the project and open it as sketch so you can use project tool to create open slot of the Arduino data & power, then do extrude to cut the space to the part to fit it inside then do join of the part into the cut space.
Select the front side of the project and open it as sketch so you can use project tool to create open slot of the LCD screen & Green and Red Leds, then do extrude to cut the space to the part to fit it inside then do join of the part into the cut space.
Select the Right side of the project and open it as sketch so you can use project tool to create open slot of the ON-OFF switch, then do extrude to cut the space to the part to fit it inside then do join of the part into the cut space.
Select the Top side of the project and open it as sketch so you can use project tool to create open slot of the Gas sensor, then do extrude to cut the space to the part to fit it inside then do join of the part into the cut space.
Change the Project sides appearance to wood so you can imagine it after final cutting on laser cut machine.
Save each side of the project as DXF file by using Fuion 360 " Save DXF for Laser cutting" this tool help to save the project for laser cutting with the main drawing lines to avoid any wrong line mistakes for cutting process.
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:-
Open RDwork on the computer linked with the laser machine.
Select open file from the File in menu bar.
Identify the cutting power 50% and speed 30mm/s.
Identify the scan power 15% speed 250mm/s.
Do simulation to stand on the cutting process.
Click on the download to download file into the laser machine.
Write file name without space on the displayed window.
Select file on the machine.
Put plywood sheet on the laser machine and make it fixed by using tape.
Move the Laser cutting pen to the top right of the plywood sheet.
Select origin point to identify the cutting start point.
Press on the origin button on the laser machine to identify it.
Press on frame button on the laser machine to figure out the cutting space on the sheet.
Everything is ok, so press on enter button to start the cutting process. Enjoy watchine it :)
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:-
Arduino UNO board.
Mini breadboard.
Gas sensor MQ6.
ON - OFF Switch.
Buzzer 10mm.
Green Led 5mm.
Red Led 5mm.
LCD Screen.
Relay.
Fan 5V.
Resistors 220 Ohm * 2.
Wires Male to Male.
Wires Male to Female
Power supply 9V.
The Project action as following:-
A- when sensor detect gas :
Red Led turn on.
Green led turn off.
Display message on LCD screen with "Gas Level"
Buzzer play sound.
Fan Turn on.
B- when sensor not detect gas :
Green Led turn on.
Red Led turn off.
Display message on LCD screen " No Gas Leakage".
Buzzer stop sound.
Fan Turn off .
The function of each components.
Arduino UNO board is the brain of controlling.
Leds to do Visual alert.
Buzzer to do hearing alert.
LCD screen to show the gas level as situation is.
Fan to clean the air in area from gas.
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:-
ON - OFF switch to power the circuits. then
When Gas sensor detect gas in the air, send signal to the Arduino board with the Gas reading level. then
Arduino UNO do calculation based on the programming code. then
When Gas level is high send signal to Green led to turn off, Red led to turn on, display message on the screen, Buzzer play sound and Fan turn on. then
When Gas level be under risk level send signal to Green led to turn on, Red led to turn off, display message on the screen, Buzzer stop sound and Fan turn off.
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
Put the led pins in the breadboard.
Put resistor 220ohm in the line of ground pin so they are connected together.
Put the positive led pin in the positive line in the breadboard.
connect positive line to 5v pin in Arduino & Ground line to GND pin in Arduino.
Integrate the project’s modules together as below:-
B- Buzzer
Put the Ground pin in Ground hole in the breadboard.
Put the positive + pin in the Arduino digital pin no. 4.
Integrate the project’s modules together as below:-
C- MQ6 Gas Sensor
Put the Ground pin in Ground - hole in the breadboard.
Put the Positive pin in Positive + hole in the breadboard.
Put the AO pin in the Arduino analog pin no. A1.
Integrate the project’s modules together as below:-
D- Relay
Put the Ground pin in Ground - hole in the breadboard.
Put the Positive 5v pin in Positive + hole in the breadboard.
Put the NO pin in the Arduino digital pin no. 12.
Integrate the project’s modules together as below:-
E- Fan
Put the Ground pin in NO hole in the Relay.
Put the Positive pin in Positive + hole in the barrel jack adapter female.
Connect the Ground in the barrel jack adapter female to the CMM or general hole in the Relay.
Integrate the project’s modules together as below:-
E- LCD I2C
Put the Ground pin in Ground - hole in the breadboard.
Put the Positive 5v pin in Positive + hole in the breadboard.
Connect the Analog 4 & 5 to the Analog pin 4 & 5 or last 2 pins in digital pins as picture below.
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.
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:-