Developed 11+ projects using CSS properties like Flexbox, Grid, and JavaScript manipulations.
Developed numerous projects during my master's degree lab sessions.
Component | Arduino Pin |
---|---|
Flame Sensor | A0 (Analog) |
Smoke Sensor | A1 (Analog) |
Buzzer | Pin 8 (Digital) |
LED | Pin 9 (Digital) |
GND | GND |
VCC | 5V |
void setup(){
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop(){
int flameValue = analogRead(A0);
int smokeValue = analogRead(A1);
Serial.print("Flame: ");
Serial.print(flameValue);
Serial.print(" | Smoke: ");
Serial.println(smokeValue);
if (flameValue < 200 || smokeValue > 300){
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
Serial.println("🔥 Fire Detected! 🔥");
} else {
digitalWrite(8, LOW);
digitalWrite(9, LOW);
}
delay(500);
}
pip install pyserial
import serial
import time
arduino = serial.Serial('COM3', 9600, timeout=1)
time.sleep(2)
while True:
try:
data = arduino.readline().decode().strip()
if data:
print("Received:", data)
if "Fire Detected" in data:
print("🔥 WARNING: Fire Detected! 🔥")
except KeyboardInterrupt:
print("Exiting...")
arduino.close()
break
Use a lighter or candle (at a safe distance). If detected, the buzzer and LED should turn on.
Blow smoke near the MQ-2/MQ-135 sensor. If detected, the buzzer and LED should turn on.