Experiment: University Institute of Engineering Department of Computer Science & Engineering

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

University Institute of Engineering

Department of Computer Science & Engineering

EXPERIMENT: 1.2

Student Name: Anurag Gourab Pal UID: 21BCS11046


Branch: BE-CSE Section/Group: 21BCS-504(A)
Semester: 2ND SEMESTER Date of Performance: 21-02-2022
Subject Name: Disruptive Technologies-2 Subject Code: 21ECH-103

1. Aim of the practical: Design a Cloud based weather monitoring system using IoT platform and
relevant sensors.

2. Tool Used: Ubidots, BMP280, ESP32.

3. Basic Concept/ Command Description:

• IoT software addresses its key areas of networking and action through platforms, embedded systems,
partner systems, and middleware.
• These individual and master applications are responsible for data collection, device integration, real-time
analytics, and application and process extension within the IoT network.
University Institute of Engineering
Department of Computer Science & Engineering

4. Code:
/*

* Board: DOIT ESP32 DEVKIT v1

* BMP280 - https://components101.com/sensors/gy-bmp280-module

* BMP280 Library - https://github.com/adafruit/Adafruit_BMP280_Library

* ArduinoSensor Library - https://github.com/adafruit/Adafruit_Sensor

* UBIDOTS MQTT Library - https://github.com/brendanvanbreda/ubidots-mqtt-esp * PubSubClient -

https://github.com/knolleary/pubsubclient

* CSB -> HIGH for configuring BMP280 to I2C communication mode.

*/

#include <Adafruit_BMP280.h> // for temp. sensor BMP280 IC

#include <UbidotsESPMQTT.h> // for ubidots

#define BMP_SDA 21 // Defining PIN 21 for variable BMP_SDA

#define BMP_SCL 22 // Defining PIN 22 for variable BMP_SCL

#define TOKEN "BBFF-EBM4IJjdvzxyv5XDGKFihSKzLS17yt" // Your Ubidots TOKEN

#define WIFISSID "your wifi" // Your SSID

#define WIFIPASS "your password" // Your Wifi Pass

Adafruit_BMP280 bmp280; Ubidots

client(TOKEN);

void callback(char* topic, byte* payload, unsigned int length) {

Serial.print("Message arrived [");

Serial.print(topic);

Serial.print("] ");

for (int i = 0; i < length; i++) {


University Institute of Engineering
Department of Computer Science & Engineering

Serial.print((char)payload[i]);

Serial.println();

void setup() {

Serial.begin(9600);

Serial.println("Init... T2_Weather");

Serial.println("Initializing BMP280");

boolean status = bmp280.begin(0x76); if (!

status) {

Serial.println("BMP280 Not connected!");

Serial.println("Done");

Serial.print("Connecting to SSID: ");

Serial.print(WIFISSID); Serial.print(",

Password: ");

Serial.println(WIFIPASS);

client.wifiConnection(WIFISSID, WIFIPASS);

Serial.println("Done");

Serial.println(" Initializing Ubidots Connection...");

client.ubidotsSetBroker("industrial.api.ubidots.com"); // Sets the broker properly for the business account

client.setDebug(true); // Pass a true or false bool value to activate debug messages

client.begin(callback); Serial.println("Done");

Serial.println("DONE");

}
University Institute of Engineering
Department of Computer Science & Engineering

void loop() {

// Acquiring data from BMP280

float temperature = bmp280.readTemperature(); float

pressure = bmp280.readPressure();

Serial.print("Temperature: ");

Serial.print(temperature); // variable

Serial.println(" °C");

Serial.print("Pressure: ");

Serial.print(pressure); // variable

Serial.println(" Pa");

// Establising connection with Ubidots if

(!client.connected()) { client.reconnect();

// Publising data of both variable to Ubidots

client.add("temperature-data", temperature); // Insert your variable Labels and the value to be sent

client.add("pressure-data", pressure);

client.ubidotsPublish("weather-monitoring-device"); // insert your device label here

client.loop(); delay(5000);

}
University Institute of Engineering
Department of Computer Science & Engineering

5. Observations, Simulation, Screen Shots and Discussions:


University Institute of Engineering
Department of Computer Science & Engineering
University Institute of Engineering
Department of Computer Science & Engineering
University Institute of Engineering
Department of Computer Science & Engineering
University Institute of Engineering
Department of Computer Science & Engineering

6. Result and Summary:


The system proposed above is an advanced solution for monitoring the weather conditions at a particular place
and make the information visible anywhere in the world. The technology behind this is Internet of Things (IoT),
which is an advanced and efficient solution for connecting the things to the internet and to connect the entire
world of things in a network. The data updated from the implemented system can be accessible in the internet
from anywhere in the world. In agriculture zone it will be very difficult to check and monitor the weather
parameter through wires and analog devices during some weather hazards. To overcome this problem here the
wireless sensors are used to check and monitor the weather parameters. The other idea is Vertical farming
system. It is implemented for cultivating different crops in small area.

7. Additional Creative Inputs (If Any):

Learning outcomes (What I have learnt):


University Institute of Engineering
Department of Computer Science & Engineering

Evaluation Grid (To be filled by Faculty):


Sr. No. Parameters Marks Obtained Maximum Marks
1. Worksheet completion including writing 10
learning objectives/Outcomes. (To be
submitted at the end of the day)
2. Post Lab Quiz Result. 5
3. Student Engagement in 5
Simulation/Demonstration/Performance and
Controls/Pre-Lab Questions.
Signature of Faculty (with Date): Total Marks Obtained: 20

PRE/POST LAB QUIZ EXPERIMENT 1.2

PRE LAB QUIZ :

Question 1

Which among the following IoT device require an operating system?


Answer : Raspberry pi
University Institute of Engineering
Department of Computer Science & Engineering

Question 2

Which among the following allows us to identify objects and extract information?
Answer: RFID

Question 3

Which of the following is an issue for the intermittent connectivity in IoT?


Answer: Resource Utilization
Desynchronizati
Data Loss
All of these

Question 4

The IoT nodes in a IoT network can have which of the following address?
Answer: Unique Local Address.

Question 5

A sensor converts a physical event to signal.


Answer: Electrical

POST LAB QUIZ


Question 1
A program written with the IDE for Arduino is called
Answer : Sketch
Question 2
Arduino IDE consists of which of the following function?
Answer : setup() and loop()
Question 3
Why interoperability is required in Internet of things? Answer :
Heterogenous wireless communication protocols Different
programming languages
Different control models
All of the above Question
4
The language used in Arduino cross platform IDE is

Answer : both c and c++


Question 5.
The function delay (xx) in Arduino programming counts the values of delay in: Answer :
Milliseconds

You might also like