Professional Documents
Culture Documents
Disruptive Technologies-II
21ECH103
CO1 Establish connectivity of IoT modules with cloud for sensor Remember
data collection and management.
CO2 Design an appcessory with Bluetooth/Wi-Fi connectivity using Understand
standard mobile application development tools.
CO3 Create robot prototypes enabled with sensors and actuators Apply
for restricted movement in different environments.
2
AGENDA
Design a Cloud based weather monitoring system using IoT platform
and relevant sensors.
• #include <Adafruit_BMP280.h>
• #include <UbidotsESPMQTT.h>
MQTT library for connecting to Ubidots using MQTT protocol and an ESP32 board.
MQTT(Message Queuing Telemetry Transport) is a standard messaging protocol for the Internet of
Things(IOT). It is ideal for connecting remote devices with a small code footprint and minimal network
bandwidth.
• #define BMP_SDA 21 //Serial data pin
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.
A service set identifier (SSID) is a sequence of characters that uniquely names a wireless local area network. An
SSID is sometimes referred to as a "network name." This name allows stations to connect to the desired network
when multiple independent networks operate in the same physical area.
SSIDs are a sequence of alphanumeric characters (letters or numbers), are case sensitive and can have a maximum
length of 32 characters.
• #define WIFIPASS "……….." // Your Wifi Pass
• Adafruit_BMP280 bmp280;
Creating on object BMP for Adafruit_BMP280. An object file is created to access special functions.
• Ubidots client(TOKEN);
• Serial.println(" Initializing Ubidots Connection...");
• client.setDebug(true); // Pass a true or false bool
value to activate debug messages
• Serial.println("Done");
• Serial.println("DONE");
}
•void loop() {//Repeat a section of code
• float temp = bmp280.readTemperature(); // Acquiring data from BMP280
• float pressure = bmp280.readPressure();
• float altitude = bmp280.readAltitude();
• float water_boiling_point = bmp280.waterBoilingPoint(pressure);
• Serial.print("Temperature: "); // Printing data in serial port
• Serial.print(temp);
• Serial.println(" °C");
• Serial.print("Pressure: ");
• Serial.print(pressure);
• Serial.println(" Pa");
• Serial.print("Altitude: ");
• Serial.print(altitude);
• Serial.println(" m");
• Serial.print("Water Boiling Point: ");
• Serial.print(water_boiling_point);
• Serial.println(" F");
• if (!client.connected()) { // Establising connection with Ubidots
• client.reconnect();
• }
• For class client of Arduino, connected() is a function that tells Whether or not the client is connected. Note that a client is considered connected if the connection has
been closed but there is still unread data. Use syntax client.connected(). It Returns true if the client is connected, false if not. Reconnect function is used to reconnect
in case of disconnect. (every 5 seconds)
• // Publising data of both variable to Ubidots
• Add a variable with a value, context and timestamp to be sent to a certain data source, once you use.
• // add() you can publish your variable using the ubidotsPublish() method.
• 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.ubidotsPublish("weather-monitoring-system");
• // ubidotsPublish(char *deviceLabel);
• client.loop();
• // Infinite loop for MQTT connection, insert it at the end of your routine
• delay(5000);
Viva Voice Questions
• What are the most commonly used sensors in IOT?
• How did you measure the voltage using sensors?
• What is the purpose of Airflow sensors?
19
Summary
• 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.
20
References
• https://www.bosch-sensortec.com/products/environmental-sensors/
pressure-sensors/bmp280/
• https://cdn-shop.adafruit.com/datasheets/BST-BMP280-DS001-11.pdf
• https://www.thethingsindustries.com/docs/integrations/cloud-integra
tions/ubidots/
• https://iot-fpms.fandom.com/wiki/Ubidots
• https://www.youtube.com/watch?v=YTQdTAXkq8Y
21
THANK YOU
For queries
Email:anuj.e10160@cumail.in
22