The past year (2020-21) has been one of the global crises on many fronts, from the far-reaching impacts of the COVID-19 pandemic to wildfire1 outbreaks of an unprecedented scale and duration. In Australia, bushfires in 2019-2020 were one of the worst bushfire seasons in history. In the United States, the West Coast wildfires reached record highs in 2020. In the Amazonian and Siberian regions, wildfires in 2020 were the worst experienced in a decade. In early 2021, Nepal experienced one of the country’s worst wildfire seasons in almost a decade. Infants, young children, women who are pregnant, and older adults are more susceptible to health impacts from smoke and ash, which are important air pollutants. Smoke and ash from wildfires can greatly impact those with pre-existing respiratory diseases or heart disease. Firefighters and emergency response workers are also greatly impacted by injuries, burns, and smoke inhalation. Wildfires have direct economic costs such as asset losses and firefighting costs. They have major short-term and long-term social implications, which include increased fatality, destruction of homes and infrastructures, and negative impacts on the physical and mental health of people. Catastrophic wildfires kill, injure, and displace wildlife and destroy their habitat. These fires pollute the air and water, change the local climate, and increase global warming. The change in global fire patterns can change the habitat of some species, causing declines in their population, and pushing them towards becoming endangered. Some of the dense forests lost to fire are old-growth forests, which can be hundreds of years old, losing them has irreversible impacts on biodiversity, climate, and the natural ecosystem as a whole.
I met with Mr. Santosh Shukla who is a Sub-Divisional Officer in the forest department in the state of MP in India and from him, I came to know One of the biggest problems is the lack of real-time monitoring of local atmospheric data because satellite monitoring can sometimes take hours to detect wildfires, and when it comes to controlling and suppression, time is everything, the more time it rages on for, the more expensive and monstrous it gets. 1 minute you need 1 cup of water, 2 minutes—100 liters, 10 minutes—1,000 liters. Areas destroyed by these fires are large and produce more carbon monoxide than the overall automobile traffic. Monitoring of the potential risk areas and early detection of fire can significantly shorten the reaction time and also reduce the potential damage as well as the cost of fire fighting for fire departments that are already cash-strapped.
What it does
Forrus detects fire in two ways:
First, each gateway houses a Raspberry Pi Zero, a Camera, a Smoke sensor, an Arduino that manages the communication between the nodes, and a cellular modem that connects raspberry pi to the internet. The camera takes pictures at regular intervals and uses a tflite model trained on AWS EC2 DL1, to make on-device classification, and detects if there is a fire or not, if there is, then an Alarm notification is sent through AWS SNS where the phone number/email ID of forest authorities are a subscriber to the topic, the notification also includes a link to view the location on the map.
Second, it detects the smoke through the smoke sensors deployed on every node, and each node sends real-time data to the gateway, which sends the alarm notification via AWS SNS. The nodes communicate with the gateway via long-range 2.4ghz nrf24 transceivers connected in tree topology to the gateway. Around 5,000 nodes can be connected to a single gateway.
Both the gateway and the sensor nodes consume very little power, hence they can run continuously on solar power with a small battery pack.
How we built it
In the graph schema, there are three vertices, Gateway, Node, and Data. Schema is intentionally kept simple so it is easy to customize and scale while being fast for the real-time application. There are also child nodes, connected with their parent, so the edge from "Node" goes to itself, pointing at the other child nodes' id. The web app is designed for cross-compatibility across platforms, and nothing needs to be installed.
The model is trained on AWS EC2 Dl1 studio using the "Fire" dataset and then saved in a 'saved_model' format which is then converted to 'tflite' format for running inference on the edge on Raspberry Pi zero. For testing purposes, two models were trained for image size 256x256, one with Sequential and the other being trained using transfer learning with Xception. Please check out the notebook from this link -
Gateway The gateway houses a Raspberry Pi connected to a camera via a CSI port. Pi runs a python script that does the following:
1. Take a new photograph and store it.
2. Start a tflite interpreter, resize the image to 256x256, do the classification, and then return the result.
3. If a fire is detected in the image, use AWS SNS to notify the forest authorities.
4. Connect to Arduino via UART communication at a 115200 baud rate and listen to the serial communication.
5. Parse the serial data to extract the longitudes, latitudes(DeviceID for each device is their lat and long coordinates), for each node, and the sensor data.
6. If any node has detected smoke, or if the temperature is above a certain threshold notify the forest authorities via AWS SNS.
7. Repeat the cycle after a certain delay.
The microcontroller manages the entire communication with the NRF24 to the nodes. rf24network library is used for setting up the communication in tree topology, which has the capability to connect over 5,000 nodes.
Node Node has a Smoke, Temperature, and Humidity sensor that is connected to the microcontroller. NRF24 is used to transmit the data to the gateway.
Raspberry Pi Zero:(10 USD)
At the heart of the Raspberry Pi Zero, W is a 1GHz BCM2835 single-core processor with 512MB RAM. with added wireless LAN and Bluetooth, the Raspberry Pi Zero W is ideal for making embedded Internet of Things (IoT) projects. The Pi Zero W has been designed to be as flexible and compact as possible with mini connectors and an unpopulated 40-pin GPIO.
This 5 Megapixel Raspberry Pi Camera Module is a custom-designed add-on for Raspberry Pi. It attaches to Raspberry Pi by way of one of the two small sockets on the board's upper surface. This interface uses the dedicated CSI interface, therefore it is designed especially for interfacing to cameras. The CSI bus is capable of extremely high data rates, and it exclusively carries pixel data.
Arduino Nano: (2.5 USD)
It is powered by a microcontroller of the AVR family, ATMEGA328, it has a few analog pins and an SPI communication for reading the sensors and communicating with the NRF24 module.
The Nordic nRF24 is a family of silicon integrated radio transceivers operating in the 2.4GHz band, it is a very low price and provides enough range and bandwidth for the nodes to transmit the data to the gateway. It uses SPI(Serial Peripheral Interface to connect to the Arduino)
Smoke Sensor (MQ-02) (2 USD)
This sensor is attached to Analog pin 0 of the Arduino. MQ2 is one of the commonly used gas sensors in the MQ sensor series. It is a Metal Oxide Semiconductor (MOS) type Gas Sensor also known as Chemiresistors as the detection is based upon a change of resistance of the sensing material when the Gas comes in contact with the material. Using a simple voltage divider network, concentrations of the gas can be detected.
MQ2 Gas sensor works on 5V DC and draws around 800mW. It can detect LPG, Smoke, Alcohol, Propane, Hydrogen, Methane, and Carbon Monoxide concentrations anywhere from 200 to 10000ppm.
When tin dioxide (semiconductor particles) is heated in air at high temperatures, oxygen is adsorbed on the surface. In clean air, donor electrons in tin dioxide are attracted toward oxygen which is adsorbed on the surface of the sensing material. This prevents electric current flow.
In the presence of reducing gases, the surface density of adsorbed oxygen decreases as it reacts with the reducing gases. Electrons are then released into the tin dioxide, allowing current to flow freely through the sensor.
Temperature and Humidity sensor (DHT11): (1 USD)
DHT11 Temperature & Humidity Sensor features a temperature & humidity sensor complex with a calibrated digital signal output. By using the exclusive digital-signal-acquisition technique and temperature & humidity sensing technology ensure high reliability and excellent long-term stability. This sensor includes a resistive-type humidity measurement component and an NTC temperature measurement component, and connects to a high-performance 8-bit microcontroller, offering excellent quality, fast response, anti-interference ability and cost-effectiveness.
Cellular Modem: (13 USD)
GSM/WCDMA/LTE are the most widespread band, many different service providers around the world cover pretty much the entire globe, we might, however, might have to use repeaters or towers so to provide The cellular modem is just an example of providing TCP/IP access to the Raspberry PI, it can be replaced with any kind of customized module/network architecture or whatever network is available and works in the locality.
3D Printed enclosures.
These were custom designed and printed, and during mass production, the price of small injection-molded enclosures will be a few cents.
Hardware connections schematic:
Challenges we ran into
Because the project expands multiple domains(Hardware, Software, ML&AI, etc.) there were numerous tiny obstacles. But to make it simpler modular approach was followed, in which, the different tech-stacks were developed and tested individually before the final integration. The biggest challenge was to complete the project within the deadline while working alone and handling the university exams, assignments, and other stuff.
Accomplishments that we're proud of
To contribute to helping the forests, atmosphere and animals is really motivating and satisfying in hope that upcoming generations in the next few hundred years will have the opportunity of experiencing the real forests, nature, and biodiversity.
What we learned
While making this project I learned, how easy it is to bring an impactful idea to life once you have an understanding of how to leverage graph databases to solve real-world problems
What's next for Forrus
The most important thing, for now, is to do some actual field tests in the forest and determine the limitations of the range of the networks and power consumption. The next step would be to design a weatherproof enclosure.