top of page

Sending Mobile Notification Alert for Fire using Raspberry Pi and Blynk - IoT

Updated: Feb 13


Flame/Fire sensor
Flame/Fire sensor

Interfacing the hardware devices to our mobile and #portable devices is one of the most essential things today, even in our daily lives. Be it a small notification for our car being serviced and ready or a fire alert at home. This process of interfacing and receiving notifications can be a simple task to be easily carried out or a necessity. This basically tells us how #IoT has added to ease and monitor our day to day activities and avoid hazards.


Many such systems have been developed, like water level monitors in overhead tanks at homes, parking lot sensors in apartments to keep track of the vehicles coming in and out, and finally to the Home automation system itself. This article is going to give an idea of interfacing with a fire sensor and receive notifications to the mobile phone through the #Blynk App.


Hardware List


The following image shows all the components required for building the circuit.


Components of the circuit
Components of the circuit

  1. Raspberry Pi

Raspberry Pi chip
Raspberry Pi chip

Unlike #Arduino, Raspberry Pi works with its own Operating System, Linux. So, Raspberry Pi can be called a single-board computer. It does not have any peripherals like a keyboard, mouse, etc. but works when connected to a system.


Features of Raspberry Pi:

In this project, the Raspberry Pi Model B/B+ can be used, which have a 1.2GHz/1.4GHz processor. It has inbuilt WiFi and #Bluetooth capabilities.


Buy the Raspberry Pi chip from here.


2. Flame sensor


Flame Sensor
Flame Sensor

The flame sensor has 4 pins namely A0, D0, GND, and Vcc. The A0 pin is the analog output pin for which an ADC (Analog-to-Digital Converter) needs to be used to get the desired output. The D0 pin is the Digital Output pin which directly gives the output in terms of 0 and 1.


The GND pin will be connected to the Ground pin of any other device that we will interface with. Vcc is the pin through which power in terms of Voltage will be provided to the #sensor to function accordingly. The sensor operates from 3.3V to 5V DC.


Buy Flame Sensor from here.


3. USB Cable


USB Cable
USB Cable

USB Cable is considered an Industry Standard for establishing connections between peripherals and #computers to transfer data between them.


Buy a USB cable from here.


4. Jumper Wires


Jumper Wires
Jumper Wires

Jumper wires establish a connection between the Raspberry Pi and the flame sensor. Both Male and Female wire configurations are required.


Buy Jumper Wires from here.


5. MicroSD card

MicroSD loaded with Raspbian OS
MicroSD loaded with Raspbian OS

The MicroSD card used here needs to be loaded with Raspbian OS which is a zip file containing the code needed to run the #program on Raspberry Pi and allows interfacing between the hardware and software.


Buy a MicroSD Card from here.

Software Requirement

  1. Blynk App


Blynk App
Blynk App

It is an application installed in Andriod and iOS devices that allow interfacing hardware devices in real-time. It is an IoT platform that has free cloud storage. Blynk app allows creating a project dashboard, widgets, graphs, etc.


2. Raspberry Pi Imager


Raspberry Pi Imager (Logo)
Raspberry Pi Imager (Logo)

The software is used to allow the interfacing of the hardware devices and #software applications. This software needs to be downloaded into the system for the Raspberry Pi Chip to be recognizable.


3. Python IDLE IDE


Python IDLE IDE (Logo)
Python IDLE IDE (Logo)

The main software application is a #Python IDE for this device to work. The code is written in the notepad and saved with .py extension so that it becomes a python code file and can be interfaced with the device.


Circuit Diagram


Circuit Connections
Circuit Connections

The circuit connections for this device is simple. As stated above, the flame sensor has 4 pins amongst which we will be making use of three of them. They are the D0 (Digital Output), GND (Ground), and Vcc ( Voltage/Power Supply) pins.


The GND pin of the flame sensor is connected to the GND pin of the Raspberry Pi. The Vcc pin of the flame sensor is connected to the power supply pin of the chip. Finally, let's consider any one of the channel pins in Raspberry Pi to connect the D0 pin of the flame sensor. In our case, channel 4 is chosen.


The Raspberry Pi chip is then connected to the computer through the USB cable where the software is interfaced with the hardware device.


Download the code from here



Working:


The following images show how the circuit looks when connected and assembled.

Connected, Unpowered circuit
Connected, Unpowered circuit

Once the circuit connections are completed and the code is written in the IDE, connect the hardware device to the computer and interface the code to the hardware.


Python code file
Python code file

The code is written in a notepad file and saved as a python file which creates the type of document required for the code execution.


Terminal window
Terminal window

After the file with the code is saved under the given extension, the SSH (Secure Socket Shell) #Terminal is opened.


Terminal Output
Terminal Output

The saved file name is entered and is then opened in the terminal. The output of which is shown above.


The Hardware Powered up
The Hardware Powered up

By the time the terminal with the file and code is opened, the Blynk app must be opened and must be configured. That is the Notification must be enabled and the widget option must be chosen. The steps for which are shown in the project video given below.


The device in action
The device in action

The explanation of the circuit building, code, and the work with the terminal is explained clearly in the video.


Video By - Sai Parimal

Flame sensor interfacing is one of the basic components of the home automation system. The scope of this project is huge and this is a basic circuit. The knowledge about building this circuit is essential for designing other big automation systems.


 

See also:

623 views2 comments

Related Posts

See All
bottom of page