0% found this document useful (0 votes)
84 views14 pages

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

1. The document describes an experiment conducted by a student to design a cloud-based weather monitoring system using IoT platforms and sensors. 2. The system uses Ubidots, a BMP280 temperature and pressure sensor, and an ESP32 microcontroller to collect sensor data and publish it to the Ubidots cloud platform. 3. The student's code connects the sensors to collect temperature and pressure readings, connects to WiFi, and publishes the sensor data to their Ubidots account where the real-time data is accessible from any internet connection.

Uploaded by

Akanksha Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views14 pages

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

1. The document describes an experiment conducted by a student to design a cloud-based weather monitoring system using IoT platforms and sensors. 2. The system uses Ubidots, a BMP280 temperature and pressure sensor, and an ESP32 microcontroller to collect sensor data and publish it to the Ubidots cloud platform. 3. The student's code connects the sensors to collect temperature and pressure readings, connects to WiFi, and publishes the sensor data to their Ubidots account where the real-time data is accessible from any internet connection.

Uploaded by

Akanksha Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

University Institute of Engineering

Department of Computer Science & Engineering

EXPERIMENT: 1.2

Student Name: Akanksha kumari UID: 21BCS7478


Branch: BE-CSE Section/Group: 21BCS-402(B)
Semester: 2ND SEMESTER Date of Performance: 1.03.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:

/*21BCS7478

* 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-le5KYGDnQDp42IUA0A0JJA8U" // Your Ubidots TOKEN

#define WIFISSID "411" // Your SSID

#define WIFIPASS "1234567899" // 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
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
University Institute of Engineering
Department of Computer Science & Engineering

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):

Not any.
University Institute of Engineering
Department of Computer Science & Engineering

Learning outcomes (What I have learnt):

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

You might also like