0% found this document useful (0 votes)
18 views

Code For Unit-1

Uploaded by

neerukprkpt
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)
18 views

Code For Unit-1

Uploaded by

neerukprkpt
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/ 6

Subject:- Disruptive Technology

Unit-1
1. Introduction to open-source IoT Platform and basic interfacing Hands-on.
2. Design a Cloud based weather monitoring system using IoT platform and relevant
sensors.
3. Develop a smart phone application for smart home voice-assistant.

Unit-2
4. Understanding different AR effects along with exploration of AR tool interface and
capabilities.
5. Create an augmented reality layer using synthetic texture for smart phone applications.
6. Develop an AR layer for modulating objects in congruence with dynamic text.

Unit-3
7. Understanding robotics development platform environment to model, program and
simulate robots.
8. Design a two-wheel line following robot integrated with infrared sensors.
9. Design a collision avoidance robot in multi obstacle-based environment.
10. Develop an engineered solution to socially relevant problem(s) with technical report.

Unit-1
Exp 1. Introduction to open-source IoT Platform and basic interfacing Hands-on.
Answer:- Write Intro about IOT with its application
Code for LED Blinking experiment.
#define LED 2
void setup()
{
// Initializing Serial communication.
Serial.begin(9600);
Serial.println("Init... T1_Intro");
// initialize digital pin LED as an output.
pinMode(LED, OUTPUT);
}
// the loop function runs over and over again forever
void loop()
{
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
//Serial.println("HIGH");
delay(500); // wait for half a second
digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW
//Serial.println("LOW");
delay(500); // wait for half a second
}

Note:- On the left hand side page, paste printout of running code with UID and name written in
comment section.
---------------------------------------------------End of Experiment 1---------------------------------------------------

Exp 2. Design a Cloud based weather monitoring system using IoT platform and relevant
sensors.
Answer:-
Write Down about the libraries included and working of exp 2, after then write code.

#include <Adafruit_BMP280.h>
#include <UbidotsESPMQTT.h>
//Section and Group
//Name and UID
#define BMP_SDA 21
#define BMP_SCL 22

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


TOKEN
#define WIFISSID "Lab411" // Your SSID
#define WIFIPASS "123456780" // 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("things.ubidots.com");
//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 temp = bmp280.readTemperature();
float pressure = bmp280.readPressure();
float altitude = bmp280.readAltitude();
float water_boiling_point = bmp280.waterBoilingPoint(pressure);
Serial.print("Temperature: ");
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");

// Establising connection with Ubidots


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

// Publising data of both variable to Ubidots


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-2023"); // insert your device
label here
client.loop();
delay(5000);
}
Note:- On the left hand side page, paste printout of running code with UID and name written in
comment section. Another screenshot is of ubidots where devices will contain your name and UID
with output on them.

---------------------------------------------------End of Experiment 2---------------------------------------------------

Exp 3 Develop a smart phone application for smart home voice-assistant.


Answer:-

#include <UbidotsESPMQTT.h>
#define RELAY 25

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


TOKEN
#define WIFISSID "411" // Your SSID
#define WIFIPASS "12341234" // Your Wifi Pass

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();
Serial.print("Command: ");
bool command = *payload - 48;
Serial.println(command);
digitalWrite(RELAY, command);
}

void setup() {
Serial.begin(9600);
Serial.println("Init... Smart_Home");
pinMode(RELAY, OUTPUT);

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);
client.ubidotsSubscribe("smart-home-voice-assistant","bulb"); //Insert the Device
and Variable's Labels
Serial.println("Done");

Serial.println("DONE");
}
void loop() {

// Establising connection with Ubidots


if (!client.connected()) {
client.reconnect();
client.ubidotsSubscribe("smart-home-voice-assistant","bulb"); //Insert the Device
and Variable's Labels
}
client.loop();
delay(100);
}
Note:- On the left hand side page, paste printout of running code with UID and name written in
comment section. Another screenshot is of ubidots where devices will contain your name and UID
with output on them.

---------------------------------------------------End of Experiment 3---------------------------------------------------

You might also like