Categories
Uncategorized

IoT based Data Monitor and Alert System

Data Monitor Project Picture

A quick and easy system to monitor the Temperature, Humidity, Air Quality, LPG, Carbon Monoxide, Smoke and detect Fire in the surrounding environment.

Things used in this project

Hardware components

  1. Bolt WiFi Module
  2. ESP8266 development board
  3. DHT-22 Sensor
  4. MQ-135 Sensor
  5. MQ-2 Sensor
  6. Flame/Fire Sensor
  7. 20×4 LCD with I2C module
  8. 7 Red LEDS
  9. 150 Ohm Resistors – 7
  10. Active Buzzer Module
  11. CD4051 Single 8-channel Multiplexer/Demultiplexer IC
  12. 74HC595 8-bit Serial to Parallel Shift Register IC
  13. Breadboard
  14. Jumper Wires

Software, Apps and online services

  1. Arduino IDE
  2. Telegram Messaging App
  3. Web Browser
  4. Bolt IoT Cloud

Hardware setup

Step 1) Connect the DHT-22 Temperature and Humidity Sensor with the NodeMCU ESP8266 and Bolt IoT Module as per the following:

  1. Vcc (DHT-22) is connected to 3.3 V (Bolt IoT Module)
  2. Gnd (DHT-22) is connected to Gnd (Bolt IoT Module)
  3. Data (DHT-22) is connected to D5 (NodeMCU ESP8266)

Step 2) Connect the MQ-135 Air Quality Sensor with the NodeMCU ESP8266 and Bolt IoT Module as per the following:

  1. Vcc (MQ-135) is connected to 3.3 V (Bolt IoT Module)
  2. Gnd (MQ-135) is connected to Gnd (Bolt IoT Module)
  3. A0 (MQ-135) is connected to Channel 1 (CD4051 IC)
CD4051 Multiplexer: Datasheet, Circuit, Pinout [Video&FAQ]

Step 3) Connect the MQ-2 LPG, Carbon Monoxide and Smoke Sensor with the NodeMCU ESP8266 and Bolt IoT Module as per the following:

  1. Vcc (MQ-2) is connected to 3.3 V (Bolt IoT Module)
  2. Gnd (MQ-2) is connected to Gnd (Bolt IoT Module)
  3. A0 (MQ-2) is connected to Channel 0 (CD4051 IC)

Step 4) Connect the Fire Sensor with the NodeMCU ESP8266 and Bolt IoT Module as per the following:

  1. Vcc (Fire sensor) is connected to 3.3 V (Bolt IoT Module)
  2. Gnd (Fire sensor) is connected to Gnd (Bolt IoT Module)
  3. D0 (Fire sensor) is connected to D0 (NodeMCU ESP8266)

Step 5) Connect each 7 LEDs to 150 Ohm Resistor which are then connected QA, QB, QC, QD, QE, QF, QG of SN74HC595 IC.

Step 6) Connect the 20×4 LCD with I2C module with the NodeMCU ESP8266 and Bolt IoT Module as per the following:

  1. Vcc (I2C Module) is connected to 5 V (Bolt IoT Module)
  2. Gnd (I2C Module) is connected to Gnd (Bolt IoT Module)
  3. SCL (I2C Module) is connected to D1 (NodeMCU ESP8266)
  4. SDA (I2C Module) is connected to D2 (NodeMCU ESP8266)

Step 7) Connect the SN74HC595 IC with the NodeMCU ESP8266 and Bolt IoT Module as per the following:

  1. Vcc (SN74HC595 IC) is connected to 3.3 V (Bolt IoT Module)
  2. SRCLR’ (SN74HC595 IC) is connected to 3.3 V (Bolt IoT Module)
  3. Gnd (SN74HC595 IC) is connected to Gnd (Bolt IoT Module)
  4. OE’ (SN74HC595 IC) is connected to Gnd (Bolt IoT Module)
  5. SER (SN74HC595 IC) is connected to D6 (NodeMCU ESP8266)
  6. RCLK (SN74HC595 IC) is connected to D7 (NodeMCU ESP8266)
  7. SRCLK (SN74HC595 IC) is connected to D8 (NodeMCU ESP8266)

Step 8) Connect the Buzzer with the NodeMCU ESP8266 and Bolt IoT Module as per the following:

  1. Vcc (Buzzer) is connected to 3.3 V (Bolt IoT Module)
  2. Gnd (Buzzer) is connected to Gnd (Bolt IoT Module)
  3. I/O (Buzzer) is connected to D3 (NodeMCU ESP8266)

Step 9) Connect the CD4051 IC with the NodeMCU ESP8266 and Bolt IoT Module as per the following:

  1. Vdd (CD4051 IC) is connected to 3.3 V (Bolt IoT Module)
  2. Gnd, Input B, Input C, Inhibit, Vss, Vee (CD4051 IC) is connected to Gnd (Bolt IoT Module)
  3. Common in/out (CD4051 IC) is connected to A0 (NodeMCU ESP8266)
  4. Input A (CD4051 IC) is connected to D4 (NodeMCU ESP8266)

Step 10) Bolt IoT Module with NodeMCU ESP8266 as per the following:

  1. 5V (Bolt IoT Module) is connected to 5 V (LCD I2C Module)
  2. 3.3V(Bolt IoT Module) is connected to 3.3V (NodeMCU ESP8266)
  3. Gnd (Bolt IoT Module) is connected to Gnd (NodeMCU ESP8266)
  4. RX (Bolt IoT Module) is connected to TX (NodeMCU ESP8266)
  5. TX (Bolt IoT Module) is connected to RX (NodeMCU ESP8266)
Circuit Diagram

Software Programming

Step 1: Installing ESP8266 Board in Arduino IDE (Windows, Mac OS X, Linux)

The ESP8266 community created an add-on for the Arduino IDE that allows you to program the ESP8266 using the Arduino IDE and its programming language.

Make sure that the latest version of the Arduino IDE installed in your computer. Or install the latest Arduino IDE software from www.arduino.cc/en/Main/Software

Install ESP8266 Add-on in Arduino IDE

To install the ESP8266 board in Arduino IDE, follow these next instructions:

Step 1) In your Arduino IDE, go to FilePreferences

Step 2) Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into the “Additional Boards Manager URLs” field as shown in the figure below. Then, click the “OK” button.

Note: if you already have the ESP32 boards URL, you can separate the URLs with a comma as follows: https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json

Step 3) Open the Boards Manager. Go to Tools > Board > Boards Manager…

Step 4) Search for ESP8266 and press install button for the “ESP8266 by ESP8266 Community” :

Step 5) That’s it. It should be installed after a few seconds.

Uploading the Sketch to the ESP-12E

If you’re using an ESP-12E NodeMCU Kit, uploading the sketch is very simple, since it has built-in programmer. Plug your board to your computer. Make sure you have the right board selected:

You also need to select the Port:

Before uploading the code, add the following libraries:

  1. boltiot-arduino-helper – https://github.com/Inventrom/boltiot-arduino-helper
  2. DHT-sensor-library – https://github.com/adafruit/DHT-sensor-library.git
  3. LiquidCrystal library – https://github.com/arduino-libraries/LiquidCrystal
  4. MQ135 – https://github.com/Phoenix1747/MQ135.git
  5. MQ-2 sensor library – https://github.com/labay11/MQ-2-sensor-library.git
  6. Fastbot – https://github.com/GyverLibs/FastBot.git
  7. ESPAsyncTCP – https://github.com/me-no-dev/ESPAsyncTCP.git
  8. ESPAsyncWebServer – https://github.com/me-no-dev/ESPAsyncWebServer.git
Get the code

Get the code from the Github Repository of this project. Download a.zip file.

Step 2: Creating a Telegram Bot:

  1. Search for the BotFather in the search menu.
  2. After opening the BotFather enter the command /start to create the bot.
  3. To create a new bot, enter the command /newbot and give a suitable name to the bot.
  4. Secondly, we need to give the username to the bot created it should be ending with the bot e.g. usernamebot
  5. Now an API Key will get generated store that API Key as it has to be used in the coding.

Step 3 Create a new product on the Bolt Cloud.

Create an Account on the Bolt Cloud and linked the Bolt WiFi module to the Cloud account.

  1. Ensure to select the ‘Input Devices’ and ‘UART’ option.
create_product

2. Configure the product:

3. Remember to name the code, and set it as “.js” file. Get the code from the Github Repository of this project. Once done save and exit the product configuration view.

4. Link the Bolt device to your new product. Once the device is linked, remember to click on the Deploy Configurations button.

5. View your device: The Cloud polls the device for data every 5 minutes. I had Bolt IoT Cloud Pro. So, cloud polled the device for data every 30 seconds.

Github Repository Link: https://github.com/Sreejakb/IoT-based-Data-Monitor-and-Alert-System.git

Video link of explanation and demonstration: https://youtu.be/ghqOxM6Xmek

Screenshots of the Project

I

Conclusion

After doing all of the steps, you will have a system that monitor the Temperature, Humidity, Air Quality, LPG, Carbon Monoxide, Smoke and detect Fire in the surrounding environment. It can send alert to Telegram based on the limit set in the telegram app using telegram bot. Telegram app can also be used to monitor the values and download the CSV File from the Bolt IoT Cloud using the date and time entered by the user. The data can be monitored and visualized on the Bolt IoT Cloud Platform. Web Server can also be used to monitor and change the threshold values of the parameters.

Categories
Uncategorized

Get The Reminder. Save The Day.

Let’s assume that you are a daily commuter and you start your journey from your home every morning. So one fine day as you reached half way it started raining. For a commuter it’s a really difficult situation if his/her attire gets disturbed because of rain. So in order to solve this problem an alert system is created with the help of BOLT IOT.

A person would argue that whats new in this project like we do have weather apps in our phone for checking daily forecast. Answer to this question lies in the working of the project. It first fetches weather data from weather api and validates various parameters to see if there are any signs of rain within the day. If it seems like raining it will notify the user with a text message sent to his phone as well as a buzzer connected to the main door will start buzzing.

A commuter’s life is all about reaching the work place on time and in such time constraining situation it’s obvious that the person won’t always check the weather on his own. In such cases this project saves the day because of its feature of running automatically scheduled at a commuter’s office going time.

Things used in this project:

1. Hardware Components:

  1. Bolt IOT WIFI Module.
  2. Buzzer.
  3. Male/Female Jumper Wires (Everything included in Bolt IOT Kit).

2. Software Components:

  1. Bolt IOT Android Application.
  2. Bolt IOT Cloud.
  3. Tested successfully on Mac OSX but the project is platform independent and can be executed on multiple platforms such as Windows, Ubuntu and Digital Ocean.
  4. Libraries:
    1. Bolt IOT python Library.
    2. Requests Library.
    3. Twilio Library.
    4. Openweathermap Library.
    5. Apsscheduler Library.

Hardware Setup:

1. Hardware connections –

a) Take your bolt wifi module and make a connection from small pin of buzzer to GND of bolt module with the use of male female connecting wire.

b) Take another wire and connect longer pin of buzzer to A0 of bolt module

c) Give power supply with the help of usb cable.

2. Schematics –

Software Configuration And Programming:

Bolt IOT Cloud Configuration:

  1. The process starts by first getting registered at Bolt Cloud.

2. Now go to Products tab in sidebar and click on add product to create a product.

3. As soon as you will click the add product button, build product window will pop up. Enter product name and upload icon image as per your choice. Beside that select other options as shown in the image below.

4. After product build is completed your product will be available in products tab. Select it and then select configure product as shown in the image below.

5. Here you just need to specify the design because the coding part will be carried out using bolt python library which will be later taken care of. So as you can see in the below image, you need to select a digital pin which we have selected as pin 0 for one end of buzzer and the another end is connected to the ground. As soon as the pin is selected it needs to be assigned a variable name of your choice. Beside this you can also select the data collection rate ranging from 5 minutes to 24 hours. As soon as you are done with configurations you can save it by selecting save option from top right.

6. Now our product is ready to be linked with the bolt device.

7. As soon as you click the button showed in the above pic an alert will be displayed which will prompt you to select a device.

With clicking done your product is ready being linked to a device. Now we will head towards coding part.

Programming:

https://github.com/nandupadhyay101/Rain-Alert-Using-Bolt-IOT

Final Working:

Conclusion:

Here I have used this project for rain alerts only but many other aspects of weather api can be used to create different projects.