Introduction
- In this article, I will explain about connecting the Flame Sensor with Android app.
- When the flame is detected, it will send the message to the app.
Parts Of Lists
- Arduino Mega 2560
- Flame Sensor
- Android App
- Bluetooth
- Hook Up Wires
- Bread Board
Flame Sensor
Figure 1 - Flame Sensor
- It is used to detect and respond to the presence of flame (or) fire.
- The detected flame depends on the installation.
- We will also include sounding an alarm.
Connection
Step 1
Connection from the Sensor to the Board.
Sensor | Board |
Vcc | 5v |
Gnd | Gnd |
A0 | A1 |
Step 2
Connection from the Bluetooth to the Board.
Bluetooth | Board |
Vcc | 5v |
Gnd | Gnd |
TX | Rx |
RX | Tx |
Programming
- const int AOUTpin = A0;
- const int ledPin = 13;
- int limit;
- int value;
- void setup()
- {
- Serial.begin(9600);
-
-
-
- }
- void loop()
- {
- value = analogRead(AOUTpin);
- limit = digitalRead(DOUTpin);
- Serial.print("Fire value: ");
- Serial.println(value);
- Serial.print("Level: ");
- Serial.print(limit);
- delay(100);
- if (limit == HIGH)
- {
- Serial.println("fire dected");
- }
- else
- {
- Serial.println("Fire not dected");
- }
- }
Explanation
- We have to connect the Android app in the mobile from the Playstore
- When the fire is detected, it can be used to send the message to the app
- When the fire is detected, it will send the message: "Fire Detected."