Code For Unit-1
Code For Unit-1
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
Adafruit_BMP280 bmp280;
Ubidots client(TOKEN);
Serial.println("Initializing BMP280");
boolean status = bmp280.begin(0x76);
if (!status) {
Serial.println("BMP280 Not connected!");
}
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");
#include <UbidotsESPMQTT.h>
#define RELAY 25
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.println("DONE");
}
void loop() {