Professional Documents
Culture Documents
Experiment: 1.2
Student Name: UID:
Sanya Singh 22BCS14374
Nishtha 22BCS12937
Jasleen Kaur 22BCS11775
Navnidhi 22BCS15723
Ankita 22BCS14745
Design a Cloud based weather monitoring system using IoT platform and relevant sensors.
2. Tool Used:
b) #include <UbidotsESPMQTT.h>
MQTT library for connecting to Ubidots using MQTT protocol and an ESP32 board.
University Institute of Engineering
Department of Computer Science & Engineering
c) #define BMP_SDA 21
Serial data pin
d) #define BMP_SCL 22
Serial clock pin
e) #define TOKEN "…………………."
A Token is a unique key that authorizes your device to interact with Ubidots API. A
Device Token is a unique key that is linked to a single device within Ubidots data base,
with either one or both of the following permissions: Send data: Publish to, or make
POST requests to send data to the device.
h) Adafruit_BMP280 bmp280;
Creating on object BMP for Adafruit_BMP280. An object file is created to access special
functions.
Ubidots client(TOKEN);
Initialize the instance.
i)void setup()
The setup() function will only run once, after each powerup or reset of the Arduino
University Institute of Engineering
Department of Computer Science & Engineering
Board.
j) Serial.begin(9600);
This tells the Arduino to get ready to exchange messages with the Serial Monitor at a data
rate of 9600 bits per second.
k) Serial.println("Init... T2_Weather");
Prints data to the serial port
l) client.add("temp", temp);
client.add("pressure", pressure);
client.add("altitude", altitude);
client.add("wbp", water_boiling_point);
Insert your variable Labels and the value to be sent
4. Code:
#include <Adafruit_BMP280.h>
#include <UbidotsESPMQTT.h>
#define BMP_SDA 21
#define BMP_SCL 22
Adafruit_BMP280 bmp280;
Ubidots client(TOKEN);
University Institute of Engineering
Department of Computer Science & Engineering
Serial.print(topic);
Serial.print("] ");
Serial.print((char)payload[i]);
}
Serial.println();
void setup() {
Serial.begin(9600);
Serial.println("Init... T2_Weather");
Serial.println("Initializing BMP280");
if (!status) {
}
Serial.println("Done");
Serial.print(WIFISSID);
Serial.println(WIFIPASS);
client.wifiConnection(WIFISSID, WIFIPASS);
Serial.println("Done");
client.begin(callback);
Serial.println("Done");
Serial.println("DONE");
void loop() {
Serial.print("Temperature: ");
Serial.print(temp);
Serial.println(" °C");
Serial.print("Pressure: ");
Serial.print(pressure);
Serial.println(" Pa");
University Institute of Engineering
Department of Computer Science & Engineering
Serial.print("Altitude: ");
Serial.print(altitude);
Serial.println(" m");
Serial.print(water_boiling_point);
Serial.println(" F");
if (!client.connected()) {
client.reconnect();
}
client.add("temp", temp); // Insert your variable Labels and the value to be sent
client.add("pressure", pressure);
client.add("altitude", altitude); // Insert your variable Labels and the value to be sent
client.add("wbp", water_boiling_point);
client.loop();
delay(5000);
BMP280 is an absolute barometric pressure sensor especially designed for mobile
applications. The sensor module is housed in an extremely compact package. Its small
dimensions and its low power consumption allow for the implementation in battery
driven devices such as mobile phones, GPS modules or watches. Ubidots is a codeless
IoT Platform designed to empower us to prototype and scale IoT projects to production,
whilst improving and economizing the world around us with sensor data.
1. Learnt about connectivity of IoT modules with cloud for sensor data collection and management.
2. Learn about how to design an appcessory with Bluetooth/Wi-Fi connectivity using standard mobile application
development tools.
1. Worksheet completion 8
including writing learning
objectives/Outcomes. (To
be submitted at the end of
the day)
2. Viva voce 10
3. Conduct 12
Signature of Faculty (with Total Marks Obtained: 30
Date):