The Roof Is on Fire?

This ad is not shown to multipass and full ticket holders
React Summit US
React Summit US 2025
November 18 - 21, 2025
New York, US & Online
The biggest React conference in the US
Learn More
In partnership with Focus Reactive
Upcoming event
React Summit US 2025
React Summit US 2025
November 18 - 21, 2025. New York, US & Online
Learn more
Bookmark
Rate this content

The devastating wildfires that ravaged Europe in 2023, burning an area the size of London, highlight the urgent need for improved fire detection and reporting systems at scale. 

In this talk, we will explore how JavaScript and widely available electronics can be combined to create a low-cost, cheap and effective wireless fire detection system. We will deploy this system in a wild forest in Greece and utilize AI models to predict where the next blaze could be sparked.

This talk has been presented at JSNation US 2024, check out the latest edition of this JavaScript Conference.

FAQ

The device is designed to monitor areas and alert authorities if a fire starts. It aims to provide an immediate response to wildfires by alerting and deploying aerial or ground units to avoid disasters.

The ESP32 is chosen because it's a low-cost, low-power controller with Bluetooth low energy and Wi-Fi capabilities, making it suitable for large-scale deployment in remote areas.

The device uses sensors such as a flame sensor and a gas sensor to detect infrared changes and various gases, which can indicate the presence of a fire.

Code for the microcontroller can be written in C, C++, Python, or JavaScript. The DeviceScript framework, a TypeScript-first framework, is used for development.

AI is used for failure forecasting to predict device failures and for environmental monitoring by analyzing sensor data to predict changes in humidity and temperature.

The device network can be expanded using a mesh network topology, allowing devices to communicate as a cluster and cover larger areas by spreading out.

JavaScript is event-driven, making it suitable for IoT applications which are often event-based. It also allows for code reuse across different devices and platforms.

The device is solar-powered and runs on batteries, allowing for deployment in remote areas without relying on external power sources.

The device can be extended with LoRa modules for long-range communication, and additional sensors or modules for various environmental monitoring and emergency communication needs.

Currently, predicting wildfires before they happen is challenging due to multiple unpredictable factors, but research is ongoing to develop models that may achieve this in the future.

Theodore Vorillas
Theodore Vorillas
18 min
21 Nov, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Hi there. I'm Teodor, a web developer building Proxima, an open source analytics platform. In June 2021, a wildfire burned down a huge area near my house in Athens. I had an idea to build a low-cost, open, and accessible device to monitor and alert authorities of fire outbreaks. JavaScript is event-driven and perfect for IoT applications. DeviceScript is a versatile framework for writing code targeting IoT development boards. We can expand device functionality by adding sensors for temperature, humidity, gas, and flames. We can establish a mesh network using Painless Mess for wider coverage. LoRa can be used for off-grid emergency setups. AI and ML techniques can be applied for failure forecasting and running inference on the device. The VALS BME 688 gas sensor can improve detection accuracy. USC team is working on a model to predict high wildfire danger areas. Innovation thrives at the intersection of ideas and technology.
Available in Español: ¿El Techo Está en Llamas?

1. Introduction to Fire Monitoring Device

Short description:

Hi there. I'm Teodor, a web developer building Proxima, an open source analytics platform. In June 2021, a wildfire burned down a huge area near my house in Athens. The main reason behind such a disaster is our lack of understanding of how fires work. I had an idea to build a low-cost, open, and accessible device to monitor and alert authorities of fire outbreaks. The first essential component for prototyping is a microcontroller like the ESP32. We can write code in C/C++ or high-level languages like Python or Node.js.

Hi there. I hope you're enjoying the conference so far. My name is Teodor. I'm a web developer building Proxima, an open source analytics platform. During my free time though, I also enjoy building stuff and experimenting a lot with different technologies. And through my talks, I really like telling stories.

Our story begins in June 2021, when a wildfire burned down a huge area close to my house in Athens. Since 2021, wildfires have burned down three times the area of New York City. And that's just for Greece. Incidentally, and the main reason behind such a disaster is that we cannot truly understand how fires are working. Although they're a natural phenomenon and part of some ecosystems, they are getting more and more out of control due to human activity and the climate change. They can spread really quickly. And once they hit a critical point, they are almost unstoppable. Also, their sources are unpredictable, from cigarettes to thunderstorms and farm chores. So immediate response is crucial, and alerting and deploying aerial or ground units is the only way to avoid disaster.

A few months ago, I had an idea to build a device that would be able to monitor an area and alert the authorities if there is a fire starting. In order to do so, we need to set up some ground rules for the first prototype. So our device should be low cost because we need to cover huge areas and we need lots of them. It should also be as open and accessible as possible so we can let people build and deploy them in the wild. When it comes to prototyping an IoT device, the first essential component you'll need is a microcontroller, the brain and heart of our system. You might be familiar with the term and some popular options out there like the Raspberry Pi or Arduino. Our choice is the ESP32, a low-cost, low-power controller that offers both Bluetooth low energy and Wi-Fi capabilities out of the box. Developing on low-end hardware requires obviously writing code using the device's core fundamentals. We can write code in C or C++ using the Arduino IDE or use high-level languages like Python or Node.js.

2. JavaScript for Microcontrollers

Short description:

We can use the same code for targeting different devices or platforms. JavaScript is event-driven and perfect for IoT applications. DeviceScript is a versatile framework for writing code targeting IoT development boards. It has built-in APIs, great VS Code support, and works with Platform.IO. Let me show you a simple hardware prototype. We have a prototype board and a tiny development board with pins for extending functionality. The code is simple, using identifiers for components and core APIs to initialize and respond to events. The controller understands voltage changes as digital signals.

There is a huge advantage because we can actually use the same code for targeting different devices or even platforms. We can run JavaScript, compile a code and run it on different devices, but there is actually more. Let's talk a little bit more about JavaScript. Using JavaScript for microcontrollers might sound a little bit tricky but totally worth it. By design it's event-driven and most of the IoT applications are event-based. The board itself is barebones but we can attach additional components so listening to button presses or sensor readings is actually event-based. JavaScript also has a huge registry of libraries that we can use to interact with the core APIs of the board or even mix and match technologies like pairing the board with a browser or mobile applications. And there are many great frameworks that make it even easier like Johnny-5, Scilor, Nesprino and so on.

Our choice though is DeviceScript, a really versatile framework developed by Microsoft. DeviceScript is a TypeScript-first framework that allows us to write code targeting different IoT development boards. It has great VS Code support and works along with Platform.IO, the go-to for embedded software development. It also supports simulation and debugging from VS Code to prototype and finally has lots of built-in APIs for sensors, additional components as well as communication protocols.

Now, if you have no experience with electronics, don't worry, we will cover just basics. So let me just show you what I have over here. So this is the hello world of hardware prototyping. It's a simple LED blinking on and off when a button is pressed. There is also a battery, a resistor and a few wires to connect them together. This is a prototype board that allows us to quickly put all the components together. And just to give you a perspective, this is also the development board. As you can see, it's extremely tiny. The board itself has a few pins on the right and the left that allows us to extend its functionality and attach additional components. It also has right here a USB connector to connect it to our development system and program directly and on the bottom it also has connections for battery and additional components as well. So we can take the hello world from the prototype board and move it to our development board. The code is fairly simple, just a few lines. The pins of the board are labeled with identifiers like T3 for the LED and T10 for the button. The labels have some sort of semantics, so D stands for Digital Input and Output pins. Using the start light bulb and start button core APIs from device script, we can initialize the components and subscribe to events like button presses. Once a button press is detected, we can turn the LED on. Although the previous example is a good start, it also shows us how more or less electronics work. The controller can only understand voltage changes as digital signals.

3. Expanding Device Functionality and Network

Short description:

A physical event is translated into a voltage change. We can add the AEST20 sensor to detect temperature and humidity. By attaching a gas and flame sensor, we can detect wildfires. The sensors are connected to the board's serial pins and checked every five seconds. To cover a larger area, we establish a mess network using Painless Mess. Gateways connect to the wider network and relay messages. Deployed devices are solar powered and can be deployed in remote areas.

A physical event like pressing a button or turning a knob is translated into a voltage change that the controller can understand and act upon. Based on that principle, we can also add additional components. So in our device I have decided to move on with the AEST20 sensor. That's a temperature and humidity sensor developed by Idafruit Industries. The device script has a built-in driver for it so we can initialize it and read the values. We can also use the schedule API to read the values every five seconds and log on.

The sensor works by measuring changes in the humidity and temperature of the air. In the same principle, we can start detecting wildfires by attaching a gas sensor and a flame sensor. So over here, like this component over here, is the flame sensor. It's a really simple component that can detect if there is a flame nearby by reading the infrared changes using the infrared changes using this black bulb over here. The gas sensor over here is a bit more complex. It's a metal oxide semiconductor that can detect a variety of gases like CO2, methane, propane, hydrogen, and so on. So we can modify the previous example from the humidity sensor and start reading the sensor values and detect if there is a fire. The sensors are connected to the serial pins of the board and the checks are done every five seconds. If there is an open flame or gas detected, we can raise an alert and basically that's more or less the core functionality of our device.

Now if we want to extend our setup to cover a larger area, obviously, we can do that by adding more devices. But there is a problem struggle here. If we want to cover a bigger area, we want to have the devices spread out and also we need to establish a communication pattern between the devices. Each device can cover a small area, around 20 meter radius based on the sensor. These limits are due to the actual nature of the sensors. If we want to monitor a forest or a park, for example, we can spread the device a little bit more and let them communicate with each other as a cluster. So in order to have a network of devices, we can establish a mess network. Each device can send, receive, or broadcast messages. For that purpose, we're using a massive topology and a library called Painless Mess. It's a plug and play, ultra robust solution, but also it's self-healing. If one device goes down, the network will automatically adjust and find the new path for the messages. At the edges of the network, we can add gateways that can connect to the wider network and also relay messages to the cloud, other device mess networks, or external services. So if there is an alert, we can actually trigger an alert to the outer network using Wi-Fi, Bluetooth, or plain old SMS messages.

Now, let's see how we can take our device from prototype up to production. All the deployed devices are solar powered, running on batteries and can be deployed in remote areas.

4. Deploying Clusters and Environmental Monitoring

Short description:

We can extend our prototype using LoRa for off-grid emergency setups. AlphaCell microcontrollers allow us to attach different modules like a LoRa module. AI and ML techniques can be used for failure forecasting and running inference on the device. VALS is developing the BME 688 gas sensor for more accurate detection. We can train our device to monitor the life cycle of the forest based on decomposition gases.

There is a custom board designed to fit the sensors and the internals are packed in a 3D printed case. Our first cluster is already operating in Athens and tested on the field since March 2024. But we're not done, since we're building on top of such versatile technologies, we can extend our prototype in many kind of interesting ways.

Our clusters are mostly designed for off-grid emergency setups, so we can extend the range using LoRa. LoRa is a low power wide area network technology that can cover distances up to 30 kilometers. The devices can also work as emergency communication channels for firefighters or other units deployed in the field. And this is the great thing about using AlphaCell microcontrollers, we can extend our capabilities with these by attaching different modules, in our example a LoRa module. If you're interested in the details about this off-grid setup, you should definitely check out the MSTAT project, a community-driven project about radio signals and communication with really cheap devices.

Moving on, we also need to be along with the cool kids and kind of use some sort of AI, right? Well, I have some really good news for you. AI has been widely used in industrial applications for a while now. Most factories or industrial plants are using failure forecasting to predict when a machine or device will fail. We can apply the same principle to predict when one of our devices in our clusters will start failing and replace them before they become a problem. For that purpose, we are using the Prophet library from Meta. Essentially, that part is crucial. If we have deployed clusters, we need to do regular maintenance, and since all the devices are exposed to harsh weather conditions, that can be a real problem with defecting devices out in the wild. Also, we can use TinyML to run some inference on the device itself. TinyML is a way to deploy TensorFlow Lite models microcontrollers. We can extend the boards by adding cameras or other sensors as well. Based on the metrics, we can tune our sensor readings and predict how humidity and temperature will change, for example, in the future, or even adjust the readings to improve the accuracy of our metrics. But that's not the most interesting part at all. VALS is developing a sensor called BME 688 that has true gas detection capabilities. Using that sensor, we can more accurately predict and detect wildfires.

As you can see in the video, it can detect different gases or even smells. Essentially, smells are just gases in thin air. The sensor is exposed to open air, and based on the readings, we can create tiny models identifying the type of the gas. In their demo, in the video, they're using the sensor to recognize espresso coffee by the smell. So, besides providing an alert mechanism for wildfires, we can train our device and monitor the life cycle of the forest based on the decomposition gases. We can monitor that. We can actually monitor that leaves are decaying or that bees are moving around and pollinating. That step is kind of so amazing because initially, besides having an alert system, we can actually use the device for environmental monitoring in order to have better growth of forests or better recovery on a recently burned area.

5. Detecting Wildfires and Embracing Innovation

Short description:

Can we detect wildfires before they happen? It's challenging due to multiple unpredictable factors. USC team is working on a model to predict high wildfire danger areas. Innovation thrives where ideas intersect, and technology solves real-world problems. Let's keep building and embrace the process.

And since we're talking about AI, here is the one million dollar question. Can we actually detect wildfires before they happen? Well, the answer is more or less yes and no. Although we have data in place like historical data, satellite images, and more, it's really hard to correlate them together. Wildfires are, as we said before, unpredictable and triggered by multiple factors that are hard to bring together. For example, we have to take in mind weather, the terrain, the changing humidity, along with the population base, the ventilation, traffic networks, and more.

But I think we're closely getting there because there are different teams. For example, there's the USC team from the university team from USC that they're working together to bring a model that it would be able to get fed with data and predict when an area is in high danger for a wildfire.

So if you have been following along, I hope you actually enjoyed the talk and picked up a few new insights. It's been quite a journey in the past few months exploring these concepts together, but the takeaway I'm about to share with you may be a bit different from what you expected. Beyond the technical details, there is something deeper that I hope resonates with you, an idea about what truly drives innovation and how we can each contribute to it in our own unique way. The main theme of this talk is not to brag about building something cool, but to show how technology can be used to solve real-world problems. When we bring together different perspectives, we push beyond the limits of what's known, creating solutions that are not only functional, but transformative as well.

So whether you are prototyping with a microcontroller, writing JavaScript for your daily job, developing software, designing the next breakthrough, remember that innovation thrives where ideas intersect, and you can actually embrace that process of going through all these new pieces of information, all these ideas, and getting strong back from the community. So next time someone's telling you that you cannot do this or that, they somehow might be absolutely wrong. We have moved along for so many years while building together, growing together, and learning from each other, and I think that's what makes us strong. The title for my talk is from a song that constantly asks, is the roof on fire? Is it on fire? And I think that once the roof is on fire, well sometimes it's better to let it burn. So guys, thanks a lot for your time and patience. I hope you have a great time with the conference. If you have any questions, you can find all the material from this talk as well, and the slides as well, on my website. So, until the next one, stay safe and keep building!

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
Watch video: Debugging JS
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.
A Framework for Managing Technical Debt
TechLead Conference 2023TechLead Conference 2023
35 min
A Framework for Managing Technical Debt
Top ContentPremium
Today's Talk discusses the importance of managing technical debt through refactoring practices, prioritization, and planning. Successful refactoring requires establishing guidelines, maintaining an inventory, and implementing a process. Celebrating success and ensuring resilience are key to building a strong refactoring culture. Visibility, support, and transparent communication are crucial for addressing technical debt effectively. The team's responsibilities, operating style, and availability should be transparent to product managers.
Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
This Talk discusses building a voice-activated AI assistant using web APIs and JavaScript. It covers using the Web Speech API for speech recognition and the speech synthesis API for text to speech. The speaker demonstrates how to communicate with the Open AI API and handle the response. The Talk also explores enabling speech recognition and addressing the user. The speaker concludes by mentioning the possibility of creating a product out of the project and using Tauri for native desktop-like experiences.
A Practical Guide for Migrating to Server Components
React Advanced 2023React Advanced 2023
28 min
A Practical Guide for Migrating to Server Components
Top Content
Watch video: A Practical Guide for Migrating to Server Components
React query version five is live and we'll be discussing the migration process to server components using Next.js and React Query. The process involves planning, preparing, and setting up server components, migrating pages, adding layouts, and moving components to the server. We'll also explore the benefits of server components such as reducing JavaScript shipping, enabling powerful caching, and leveraging the features of the app router. Additionally, we'll cover topics like handling authentication, rendering in server components, and the impact on server load and costs.
Power Fixing React Performance Woes
React Advanced 2023React Advanced 2023
22 min
Power Fixing React Performance Woes
Top Content
Watch video: Power Fixing React Performance Woes
This Talk discusses various strategies to improve React performance, including lazy loading iframes, analyzing and optimizing bundles, fixing barrel exports and tree shaking, removing dead code, and caching expensive computations. The speaker shares their experience in identifying and addressing performance issues in a real-world application. They also highlight the importance of regularly auditing webpack and bundle analyzers, using tools like Knip to find unused code, and contributing improvements to open source libraries.
Monolith to Micro-Frontends
React Advanced 2022React Advanced 2022
22 min
Monolith to Micro-Frontends
Top Content
Microfrontends are considered as a solution to the problems of exponential growth, code duplication, and unclear ownership in older applications. Transitioning from a monolith to microfrontends involves decoupling the system and exploring options like a modular monolith. Microfrontends enable independent deployments and runtime composition, but there is a discussion about the alternative of keeping an integrated application composed at runtime. Choosing a composition model and a router are crucial decisions in the technical plan. The Strangler pattern and the reverse Strangler pattern are used to gradually replace parts of the monolith with the new application.

Workshops on related topic

Building a Shopify App with React & Node
React Summit Remote Edition 2021React Summit Remote Edition 2021
87 min
Building a Shopify App with React & Node
Top Content
Workshop
Jennifer Gray
Hanna Chen
2 authors
Shopify merchants have a diverse set of needs, and developers have a unique opportunity to meet those needs building apps. Building an app can be tough work but Shopify has created a set of tools and resources to help you build out a seamless app experience as quickly as possible. Get hands on experience building an embedded Shopify app using the Shopify App CLI, Polaris and Shopify App Bridge.We’ll show you how to create an app that accesses information from a development store and can run in your local environment.
Build a chat room with Appwrite and React
JSNation 2022JSNation 2022
41 min
Build a chat room with Appwrite and React
Workshop
Wess Cope
Wess Cope
API's/Backends are difficult and we need websockets. You will be using VS Code as your editor, Parcel.js, Chakra-ui, React, React Icons, and Appwrite. By the end of this workshop, you will have the knowledge to build a real-time app using Appwrite and zero API development. Follow along and you'll have an awesome chat app to show off!
Hard GraphQL Problems at Shopify
GraphQL Galaxy 2021GraphQL Galaxy 2021
164 min
Hard GraphQL Problems at Shopify
Workshop
Rebecca Friedman
Jonathan Baker
Alex Ackerman
Théo Ben Hassen
 Greg MacWilliam
5 authors
At Shopify scale, we solve some pretty hard problems. In this workshop, five different speakers will outline some of the challenges we’ve faced, and how we’ve overcome them.

Table of contents:
1 - The infamous "N+1" problem: Jonathan Baker - Let's talk about what it is, why it is a problem, and how Shopify handles it at scale across several GraphQL APIs.
2 - Contextualizing GraphQL APIs: Alex Ackerman - How and why we decided to use directives. I’ll share what directives are, which directives are available out of the box, and how to create custom directives.
3 - Faster GraphQL queries for mobile clients: Theo Ben Hassen - As your mobile app grows, so will your GraphQL queries. In this talk, I will go over diverse strategies to make your queries faster and more effective.
4 - Building tomorrow’s product today: Greg MacWilliam - How Shopify adopts future features in today’s code.
5 - Managing large APIs effectively: Rebecca Friedman - We have thousands of developers at Shopify. Let’s take a look at how we’re ensuring the quality and consistency of our GraphQL APIs with so many contributors.
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
0 To Auth In An Hour For Your JavaScript App
JSNation 2023JSNation 2023
57 min
0 To Auth In An Hour For Your JavaScript App
WorkshopFree
Asaf Shen
Asaf Shen
Passwordless authentication may seem complex, but it is simple to add it to any app using the right tool.
We will enhance a full-stack JS application (Node.js backend + Vanilla JS frontend) to authenticate users with One Time Passwords (email) and OAuth, including:
- User authentication – Managing user interactions, returning session / refresh JWTs- Session management and validation – Storing the session securely for subsequent client requests, validating / refreshing sessions
At the end of the workshop, we will also touch on another approach to code authentication using frontend Descope Flows (drag-and-drop workflows), while keeping only session validation in the backend. With this, we will also show how easy it is to enable biometrics and other passwordless authentication methods.