Air is a mixture of gases and it is essential to human life. Poor air quality can cause irritation, respiratory problems and could also affect the cardiovascular system. Prolonged exposure to poor air quality can cause serious health problems. Some gases have a faint smell, for example butane, while some have odor, for example, smoke. Other gases such as alcohol, carbon monoxide, ethanol, LPG, methane, are odorless and toxic when present in high concentrations. Humans are able to sense gases with odor but they are not able to sense the odorless toxic gases or their concentrations.
Along with this, people are worried about safety and security nowadays. People will usually think, what will happen to my home when I'm away? I am going to solve this problem by making a wearable which will monitor their safety as well as their house's.
Aim/ ObjectiveI am going to build an advanced safety and security band. In this band, you can get notifications if your home security is breached. This band will be enhanced by attaching a gas sensor so that if you enter a place contaminated with harmful gases, you will be alerted as soon as possible and you can stay away. Humans are able to sense gases with odor but they are not able to sense the odorless toxic gases or their concentrations. MQ-type gas sensor modules are capable of detecting different types of gases and their concentrations.
There are different types of MQ sensor modules to detect different gases so depending on the situation, we can choose the appropriate MQ-type sensor module.
The concentration of gases and the safety levels will be displayed in the wearable screen. Home security system could be connected to this wearable to let us know about the security level of our homes.
This is helpful as people won't require any other equipment to measure gas concentration. People can sense the air quality by themselves and feel safe at all times. Gas leaks could also be detected.
This wearable could be really useful for people who work underground as many people are affected by dangerous concentration of different gases underground and some cases are fatal.
Hardware components used in this project- Nordic Semiconductor nRF5340 DK
- nRF52840 Dongle
- Adafruit 2.8" TFT Touch Shield for Arduino w/Capacitive Touch
- Seeed Grove - Air quality sensor (MQ-135)
- Seeed Grove - PIR Motion sensor
- Nordic Semiconductor - nRF Connect SDK
- MIT App Inventor 2
I followed the instructions provided in this tutorial to set up the nRF Connect SDK.
- Install the Toolchain Manager app
- Install the latest SDK
- After the installation is complete, read the 'First steps to build' and open the IDE.
The nRF5340 DK board comes with the Blinky code installed on it for debugging purposes but I would like to demonstrate the steps to run the example Blinky project.
Let us check if the board works properly.
Connect the board to a power supply and you will see the LED light up on the board.
On the bottom right corner, you will see four push-buttons. Try pressing on each of the push-buttons to see how they function.
You can view the demonstration here:
Now let's try uploading the code to your nRF5340 DK board.
- Go to File and select OpennRFConnect SDK Project...
- Choose blinky as the project and nrf5430dk_nrf5340_cpuapp as the board.
- Choose your preferred Build directory
- Build the project hex file
- Connect the board to your laptop/ PC and connect it to the IDE
- Download the hex file to the board
Now, I will explain you how I did my project.
The nRF52840 dongle is used to extend the bluetooth range of the nRF5340 DK board. I have used this dongle to improve the sensitivity of my wearable.
I will be using the MQ-135 Air quality sensor and the PIR sensor for this project.
The MQ-135 Air quality sensor will be connected to the wearable whereas the PIR sensor will be connected to the NodeMCU.
We will create an app with MIT App Inventor which will connect to Bluetooth and control IoT devices simultaneously.
I have explained both applications in this project, so read on further.
Coding for the wearableWe will be making some changes to the blinky example project. I will be using the ADC and I2C peripherals for this project. I will also use the CMSIS-DSP library for fast Math functions.
- Open the nRF Connect SDK's sample directory and you will a directory named basic.
- Open the basic directory and you will find the blinky project.
- Create a new folder with the name you prefer and copy the blinky project into that.
Edit the prj.conf to add the configurations and make it compatible.
If your nRF Connect SDK is open, close it and open again.
Open the nRF Connect SDK Project.
Edit the code for using ADC and I2C, and now you are good to build the project.
Repeat the steps within the Running the example code
section to build this project.
The schematic can be found in the Schematic
section of this page. The Adafruit Touch shield can be simply placed onto the nRF5340 DK board. Make sure that you calibrate the MQ-135 gas sensor module before interfacing with the Nordic semiconductor nRF5340 DK development board.
For the home security system, we will be using the NodeMCU ESP8266 development board to create an IoT system.
The development board will be connected to a PIR motion sensor to sense human activity. You could also use this board with other appropriate sensors to enhance you home security.
You will need to use the Arduino IDE for this section. Make sure that the ESP8266 package is installed. Follow this tutorial if you are unsure about using NodeMCU with Arduino IDE.
The sample code can be found in the Code
section of this project.
The schematic can be found in the Schematic
section of this page.
I will be using the MIT App Inventor 2 to create my app for this project. The app will work with Bluetooth devices and control IoT systems as well.
Steps to create apps can be found here: http://iot.appinventor.mit.edu/#/students/intro
Improvements for this project- Extend the Bluetooth range for the wearable.
- Enhance home security system with more sensors.
- Add vibration motors to the wearable to produce haptic feedback via the wearable.
Comments