Smart Home Monitoring With Nordic Thingy:91 & Edge Impulse

About the project

The temperature and humidity have to be monitored continuously and the level of air quality and heat levels are used as an interrupt to prevent accidents using Nordic Thingy:91 & Edge Impulse.

Project info

Items used in this project

Hardware components

Sensor Tool W nRF52840 & nRF9160 Sensor Tool W nRF52840 & nRF9160 x 1
USB Li-Ion Power Bank with 2 x 5V Outputs @ 2.1A - 5000mAh USB Li-Ion Power Bank with 2 x 5V Outputs @ 2.1A - 5000mAh x 1

Software apps and online services

Edge Impulse Studio Edge Impulse Studio
Nordic Semiconductor nRF Connect SDK Nordic Semiconductor nRF Connect SDK

Story


Why Did We Build This? & The Solution

Inhouse air quality monitoring is an essential device in today's world. The Temperature, humidity, pressure, and ambient light have to be monitored continuously and the level of air quality and heat levels are used as an interrupt to prevent accidents. These sensor data are collected and processed to generate ML models using edge impulses. In addition to this, the power consumption of some devices is logged. Water heating is controlled using the data from the temperature sensor, helping the user to sleep worry-free.


Hardware

  • Nordic Thingy:91
  • micro USB cable
  • 1S Li-ion Power bank

Software

  • Nordic Semiconductor nRF Connect SDK
  • Edge Impulse Studio

Basic Hardware Components


The Nordic Thingy:91 is a prototyping platform for cellular IoT projects based around the nRF9160 SiP.
It also features an nRF52840 SoC for short-range technologies when building hybrid PoCs. The cellular support is LTE-M and NB-IoT. It also has GNSS support. Short-range support exists for Bluetooth low energy, Bluetooth mesh, 802.15.4-based protocols, and NFC. Thingy:91 has a broad selection of sensors for building your PoC. Thingy:91 connects to Nordic’s cloud system for test and evaluation, nRF Cloud.

Key features

  • Battery-operated prototyping platform for the nRF9160 SiP
  • Certifications: FCC (USA), CE (EUR)
  • nRF52840 board controller 
  • LTE-M/NB-IoT/GNSS, Bluetooth LE and NFC antennas
  • User-programmable button and RGB LEDs
  • Environmental sensor for temperature, humidity, air quality, and air pressure, plus a color and light sensor
  • Low-power accelerometer and high-g accelerometer
  • 4 x N-MOS transistors for external DC motors or LEDs
  • Rechargeable Li-Po battery with 1350 mAh capacity

Connections

We used the soracom IoT sim for this project for cellular IoT using LTE-M. The Soracom Global SIM provides cellular data connectivity and SMS functionality on 2G, 3G, 4G LTE, and Cat M1 networks in over 120 countries around the world, fully managed right from your browser on the Soracom User Console (also included as part of the starter kit)


  • Register and activate the SIM on soracom.io/start
  • APN Settings: Set your device APN to
  1. soracom.io

An approach to this project

The block diagram of the project is shown below.  With the temperature data from Thingy:91, an ML model is generated using Edge Impulse. With the inference output, the MQTT/IFTTT is triggered to send the alert to the user.

Setting up Edge Impulse

Install the dependencies

To set this device up in Edge Impulse on a windows machine, you will need to install the following software:

1. nRF Connect for Desktop v3.7.1 

2. Edge Impulse CLI.


Update the Firmware

  • Connect the micro-USB cable to connect the development board to your computer. Then, set the power switch to 'on'.
  • Download the latest Edge Impulse firmware
  • Update the firmware using nRF Connect for Desktop 


If the device is not detected, try reinstalling the USB drivers from this link

Once the firmware is updated, it's time to connect the development board to Edge Impulse. From a command prompt or terminal, run:

  1. edge-impulse-daemon

Your device is now connected to Edge Impulse. To verify this, go to click your Edge Impulse project 


Now go to Data acquisition and click on connect using WebUSB under Record New Data. Make sure that the device is connected to the PC. 

Now start sampling data using a sample length long enough. In the end, you have the raw data samples that we will use to detect anomalies using Thingy:91 and machine learning:



Next, let us create the machine learning model that will be deployed to  the Nordic Thingy:91 to detect anomalies:


Now try to blow on the sensor and you will notice that the machine learning model will detect the anomaly. Once the anomaly is detected, the data is sent to the server which in return sends an alert to the mail.



This can be used to identify the sudden change in the temperature.  If there is any issue in receiving the email check the following: 

  • Since the SIM card is on a subscription basis, check the available balance on soracom.io
  • Try to increase the dataset by augmenting a few more data samples. 

-------------------------------------------------------------------------------------------------------

If you face any issues in building this project, please ask me. Please do suggest new projects that you want me to do next.

Share this video if you like.

Happy to have you subscribed: https://www.youtube.com/c/rahulkhanna24june?sub_confirmation=1

Thanks for reading!

Schematics, diagrams and documents

Nordic Thingy 91

Code

Github Repo

Credits

Photo of the lonely programmer

the lonely programmer

Passionate Techie ! Robotics | Electronics | Programming Hey Geek! If you are in search of electronics projects, Arduino based projects or any Micro-controller based projects, this channel is for you. In this channel, we build electronics projects using the impressive and low-cost boards that are available today. If you are a maker or if you want to learn how to make your own Arduino projects and other interesting Robots, do subscribe the channel to be a part of this community. We develop our own hardware and software projects and will try to build something new. Don’t worry if you don’t know how to program. I'll share the algorithm if you face any difficulties.

   

Leave your feedback...