You are on page 1of 5

Experiment Title.

2
Student Name: Saksham Mehta UID: 22BCS14802
Branch: CSE – General Section/Group: 207-D
Semester: II Date of Performance: 22/02 /23
Subject Name:Disruptive Technologies -2 Subject Code : 22ECH-103

1. Aim: Design a cloud based weather monitoring system using IoT platform and relevant
sensors.

2 .Objective:

1. Pin Configuration Of ESP-32


2. Write Code To Link BMP280.
3. Making A Working Model Of weather monitoring system.

3. Tools used: Arduino, Ubidots, BMP-280, ESP-32..

Working Of ESP32 & BMP280

4. CODE :-

#include <Adafruit_BMP280.h>

#include <UbidotsESPMQTT.h>

#define BMP_SDA 21

#define BMP_SCL 22

#define TOKEN "BBFF-6AW90QhvG5TSmzomsrVqjPfOFHZCNO" // Your Ubidots TOKEN

#define WIFISSID "Redmi Note 10 Pro" // Your SSID

#define WIFIPASS "ad123456" // 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++) {

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");

void loop() {

// Acquiring data from BMP280

float temperature = bmp280.readTemperature();

float pressure = bmp280.readPressure();

Serial.print("Temperature: ");

Serial.print(temperature);

Serial.println(" °C");

Serial.print("Pressure: ");

Serial.print(pressure);

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"); // insert your device label here

client.loop();

delay(5000);

5.OutPut:

5. Result/Output/Writing Summary :
In this a Cloud based weather monitoring system, we write the code
for the program called wm and is uploaded the same to the circuit using
Arduino ide. Simultaneously, we made a device on UBIDOTS to store our
data. As a result we see the weather conditions like temperature pressure
altitude and water boiling point And successfully completed the
experiment.

Learning outcomes (What I have learnt):

i) Working of UBIDOTS and BMP280.

ii) Principal behind the cloud based weather monitoring Verify and upload code to circuit.

iii) The components of ESP32 and BMP208.

Evaluation Grid:

Sr. Parameters Marks Obtained Maximum


No. Marks
1. Worksheet completion including 10
writing learning
objectives/Outcomes.(To be
Submitted at the end of the day).
2. VIVA 8
3. Student Engagement in 12
Simulation/Demonstration/Performance
and Controls/Pre-Lab Questions.
Signature of Faculty (with Date): Total Marks
Obtained:

You might also like