Skip to main content

Building a Hill Fire Detection IoT with LoRa Part 1: Introduction

Slide10_77f62639bbe4725194ad58ec084b6b31f9893a5f.jpg

Background

In 2018, California wildfire burnt a large area and destroyed lots of houses. A great number of people became homeless. The campfire caused hundreds of injured and claimed nearly a hundred lives. Although the fire was put out, the society was damaged seriously. A large amount of money was spent to rebuild the society. The city of Paradise may take years to recover. “It is the deadliest in state history”, according to BBC news. Different approaches are adopted to prevent large hill fires from occurring. Nowadays, approaches mainly rely on reports of country park patrolman or citizens. However, there are a lot of limitations in effectiveness using this approach. So, IoT sensors can play a crucial role in detecting hill fires. That’s where the idea comes from.

The IoT system aims to provide a 24/7 on-site hill fire monitoring and detecting service. It reduces cost and time of human resources and can save lives and reduce the loss of properties if a fire is detected in an early stage and immediate actions are taken. In order to detect fire, IoT sensors are needed to be distributed around the hill. The area of the hill is large, it is far away from urban area network coverage. It is a challenge for the communication between sensors and receivers to exchange data. So, LoRa, short for Long-Range, is a suitable wireless communication technology to achieve long-range communication.

 

What is LoRa? Why use LoRa?

“LoRa (short for long range) is a spread spectrum modulation technique derived from chirp spread spectrum (CSS) technology” by Semtech. It is a wireless modulation technology with low power consumption and effective long-range capability. It can achieve a range up to 15 km while consuming very little power (100 mW constant RF output @3.3V, based on Semtech SX1276), and it is designed specifically for M2M and IoT network. LoRa transceivers operate in 860-1000 MHz range. There are a large of range of LoRa development kits available in RS. The article below also mentions some LoRa kits. And of course, you may find what you want and like on the RS website.

To further explore the modulation technology of LoRa, extra information can be found at RF Communication and the Internet of Things - Part 3.

Because of the great ability of LoRa, it is suitable for remote devices to communicate. Also, remote devices can benefit from the low power consumption of LoRa, so they can be powered by a battery and can last for a few years without battery replacement.

 

Hardware

Sensor node

  1. LoRa shield, I-NUCLEO-LRWAN1 (143-8573)
  2. Flame sensor (136-0709)
  3. STM32F103 MCU chip (040-2279) or you may use a STM32 Nucleo board (802-9416)
  4. DS18B20 Temperature Sensor (040-3620)
  5. MQ-2 Gas Sensor, two sensors use to detect different exhaust gases

sensor_node_41fe62ea99a2eb3f1b73215f9c9d3169e08728d0.png

It is a self-designed circuit board. Most of the on-board components and sensors can be found on the RS website. The design file of the above circuit board is attached at the end of the article.

lora_shield_df0a5191733863636394bcfaa328e4d3391d5bbc.jpg

(143-8573) RS Components

The LoRa shield in blue, I-NUCLEO-LRWAN1 (143-8573) , is the most important component in the sensor node, which acts as a data telemetry board. It forwards sensor data to the gateway through LoRa. Several sensors, like accelerometer, magnetometer, relative humidity, temperature, and pressure sensors are embedded on board for convenient use. Also, its headers are Arduino Shield v3 compatible. It is a handy tool for developers to build prototypes related to LoRa.

 

Gateway

  1. STMicroelectronics Discovery LoRa Development Kit B-L072Z-LRWAN1 (134-5557)
  2. Raspberry Pi 3 Model B+ (137-3331)

gateway1_3a297384b9682e2863c4bb5fee468713bc3403e7.png

STMicroelectronics Discovery LoRa Development Kit and Raspberry Pi 3B+ are used to build a LoRa gateway. To keep things simple, the gateway and sensor node use LoRa, instead of LoRaWAN, as a channel or conduit for information where gateways provide a transparent bridge sending and receiving messages between sensor nodes and the Internet.

lora_discovery_board_b572177fd31a00af72723b2ca19ec3ceb7fe4542.jpg

(134-5557) RS Components

STMicroelectronics Discovery LoRa Development Kit B-L072Z-LRWAN1 (134-5557) is a powerful microcontroller board. A low-power 32 MHz Cortex-M0+ microcontroller STM32L072CZY6 is embedded to control SX1276 LoRa transceiver. It makes this board not only a data telemetry board but also a full-function development board for dealing with I/O tasks and dealing with different communication protocols and interfaces like UART, SPI or I2C etc. Also, combined with six on-board LEDs, push-buttons and the Arduino compatible connector, these handy features make it a good product for prototyping.

 

Toolchain & Software

Several tools and software code are needed to set up first.


  1. I-CUBE-LRWAN, a project code for LoRa shield and discovery board. It can be downloaded from the STMicroelectronics website. Our project code is edited based on this project code. You may take a look at the original one first.
    NOTE
    Be careful with the LoRa shield I-NUCLEO-LRWAN1 (143-8573) , the actual pinout of its embedded chip is different from the pin definition in I-CUBE-LRWAN project code. https://www.st.com/en/embedded-software/i-cube-lrwan.html

  2. ThingsBoard, an online dashboard to display the sensor data. https://thingsboard.io/

  3. Telegram App, an instant messaging platform used to receive messages from the gateway.

To play with the Telegram Bot, pay much attention to “Token” of HTTP API and “chat_id”. Please find the tutorial at Creating a Bot using the Telegram Bot API.

 

Attachment of Design Files

The attachments in GitHub are the design files used in this project.

https://github.com/workworkwork-create/Building-a-Hill-Fire-Detection-IoT-with-LoRa


  1. PCB Circuit design file (1) pdf version (2) pcb file

  2. Sensor node – Folder contains (1) a modified version of I-CUBE-LRWAN for USI I-NUCLEO-LRWAN1 LoRa shield and (2) project code for on-board STM32F103 MCU

  3. Gateway – Folder contains (1) a modified version of I-CUBE-LRWAN for LoRa Discovery Board B-L072Z-LRWAN1 and (2) a Python program for Raspberry Pi

 

Next

In part 2, we will talk about the details of the system. The system architecture, functionalities, block diagrams and logic diagrams of sensor node and gateway, online dashboard and alarm alert in Telegram will be mentioned. Also, a video will show how the system works and how amazing the performance of LoRa is.

 

My articles

1. Building a Hill Fire Detection IoT with LoRa 

Part 1: Introduction

Part 2: Details of the system

2. Connecting XinaBox IoT with Zerynth to Cloud

Part 1: Introduction and Simple Example

Part 2: Uploading Data to OKdo Cloud and Visualising Data

Part 3: Control via Cloud

3. XinaBox Weather Station with ubidots Cloud

4. IoT Seminar by DesignSpark at CityU

 

A student studying electronic and information technology and keen to learn new skills.
DesignSpark Electrical Logolinkedin