Idea Labs
Idea Labs
1 2 3 4 5 6 7
Day 09:00 to 10:00 to 10:55 to 12:45 to 01:40 to 02:30 to 3:20 03:20 to
10:00 AM 10:55 AM 11:50 AM 1:40 PM 02:30 PM PM 04:10 PM
III
III II II
Mon EEE-B1
CSE-3A ECE-1A [Dr D Ravi Kiran] IT-1A
[Dr K Sireesha] [Dr TLN] [T kiran]
Outcomes:
-The Students are able to design smart projects using Arduino and Raspberry-pi boards.
-The students are able to design smart web applications and Mobile applications.
-The students are able to deploy ML/DL algorithms in smart applications.
-The student will acquire problem solving skills.
-Additionally the student are able to participate in,
• Smart India Hackathon.
• ISRO Robotic Challenge.
• App store contest.
• Other Hackathons and Project Expos.
II-1 List of Experiment
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
const int sensor=A0;
float tempc;
float tempf;
float vout;
void setup() {
lcd.begin(16,2);
lcd.clear();
pinMode(sensor,INPUT);
Serial.begin(9600);
}
void loop(){
vout=analogRead(sensor);
vout=(vout*500)/1023;
tempc=vout;
tempf=(vout*1.8)+32;
lcd.setCursor(0,0);
lcd.print("Temp_cel=");
lcd.print(tempc);
Serial.print("Temp_cel=");
Serial.println(tempc);
lcd.setCursor(0,1);
lcd.print("Temp_far=");
lcd.print(tempf);
Serial.print("Temp_far=");
Serial.println(tempf);
delay(10000);
}
Humidity Sensor (DHT11) Interface Arduino Uno
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 9); /*Serial communication between Arduino and Lm35 */
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(115200);
mySerial.println("Hello, world?");
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
Attention Commands:
>> AT %Attention command determining the presence of a DCE, i.e. the serial port adapter%
>> AT+RST %Reset%
>> AT+CWMODE=1 % WiFi Connectivity mode, 1-Station mode,2 Access point mode, 3-both%
>> AT+CWLAP % List of available AP’s%
>> AT+CWJAP=“User_Name”,”Password” %Connect to access point%
#include <SoftwareSerial.h>
#include <stdlib.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
const int sensor = A0;
float vout;
/* replace with your channel's thingspeak API key */
String apiKey = "AOUP0EEJD5VY0W6W";
/* connect 10 to TX of Serial USB
connect 8 to RX of serial USB*/
SoftwareSerial ser(10,9); // RX, TX
void setup()
{
pinMode(sensor,INPUT);
Serial.begin(9600);
ser.begin(9600);
ser.println("AT+RST");
lcd.begin(16,2);
lcd.clear();
}
void loop()
{
/* convert to temp:*/
/* temp value is in 0-1023 range*/
/* LM35 outputs 10mV/degree C. ie, 1 Volt => 100 degree C */
/* So Temp = (avg_val/1023)*5 Volts * 100 degrees/Volt*/
vout=analogRead(sensor);
vout=(vout*500)/1023;
lcd.setCursor(0,0);
lcd.print("Temp_cel=");
lcd.print(vout);
/*convert to string*/
char buf[16];
String strTemp = dtostrf(vout, 4, 1, buf);
Serial.print("Temp_cel=");
Serial.println(vout);
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += "184.106.153.149"; /*api.thingspeak.com*/
cmd += "\",80";
ser.println(cmd);
if(ser.find("Error"))
{
Serial.println("AT+CIPSTART error");
return;
}
String getStr = "GET /update?api_key=";
/* prepare GET string*/
getStr += apiKey;
getStr +="&field1=";
getStr += String(strTemp);
getStr += "\r\n\r\n";
/* send data length*/
cmd = "AT+CIPSEND=";
cmd += String(getStr.length());
ser.println(cmd);
if(ser.find(">"))
{
ser.print(getStr);
}
else
{
ser.println("AT+CIPCLOSE"); /* alert user*/
Serial.println("AT+CIPCLOSE");
}
delay(16000);
}
#include <SoftwareSerial.h>
#include <stdlib.h>
#include <dht.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
dht DHT;
#define DHT11_PIN 7
// LM35 analog input
const int sensor = A0;
float tempc;
// replace with your channel's thingspeak API
String apiKey = "AOUP0EEJD5VY0W6W";
// connect 9 to TX of Serial USB
// connect 10 to RX of serial USB
SoftwareSerial ser(10,9); // RX, TX
// this runs once
void setup()
{
pinMode(sensor,INPUT);
// enable debug serial
Serial.begin(115200);
// enable software serial
// black wifi module the baud rate is 115200
ser.begin(115200);
// reset ESP8266
ser.println("AT+RST");
lcd.begin(16,2);
lcd.clear();
}
// the loop
void loop()
{
// convert to temp:
tempc=analogRead(sensor);
tempc=(tempc*500)/1023;
// READ DATA from DHT11
int chk = DHT.read11(DHT11_PIN);
switch (chk)
{
case DHTLIB_OK:
lcd.setCursor(0,0);
lcd.print("Temp_cel=");
lcd.print(tempc); /*Prints data of LM35*/
Serial.print("Temp_cel=");
Serial.println(tempc);
lcd.setCursor(0,1);
lcd.print("Rel_Hum=");
lcd.print(DHT.humidity);
lcd.print("%"); /* Its prints value in PERCENTAGES */
Serial.print("Rel_Hum=");
Serial.print(DHT.humidity);
Serial.println("%"); /* Its prints value in PERCENTAGES */
break;
default:
Serial.println("Error in Humidity\t");
lcd.setCursor(0,0);
lcd.print("Temp_cel=");
lcd.print(tempc); /* PRINTS data of LM35 */
Serial.print("Temp_cel=");
Serial.println(tempc);
lcd.setCursor(0,1);
lcd.print(" Error in Hum ");
break;
}
// convert to string
char buf[16];
String strTemp = dtostrf(tempc, 4, 1, buf);
char buff[16];
String strHum = dtostrf(DHT.humidity,4,1,buff);
// Internet connection
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += "184.106.153.149"; // api.thingspeak.com
cmd += "\",80";
ser.println(cmd);
if(ser.find("Error"))
{
Serial.println("AT+CIPSTART error");
return;
}
String getStr = "GET /update?api_key="; /*prepare GET string*/
getStr += apiKey;
getStr +="&field1=";
getStr += String(strTemp);
getStr +="&field2=";
getStr +=String(strHum);
getStr += "\r\n\r\n"; /* send data length */
cmd = "AT+CIPSEND=";
cmd += String(getStr.length());
ser.println(cmd);
if(ser.find(">"))
{
ser.print(getStr);
}
else
{
ser.println("AT+CIPCLOSE"); /* alert user */
Serial.println("AT+CIPCLOSE");
}
delay(16000); /*thingspeak needs 16 sec delay between updates*/
}
Personal Cloud setup for IoT
o Create Database and Tables
create database [database_name];
show databases;
use [database_name];
show tables;
describe [table_name];
drop database [database_name];
drop table [table_name];
select * from [table_name];
create table [table_name] (cname1 VARCHAR(20), cname2
VARCHAR(3), cname3 VARCHAR(35), cname4 VARCHAR(3), cname5
VARCHAR(10));
insert into [table_name] (cname1, cname2, cname3,cname4, cname5)
values ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006');
1 PC (i5 processors) 12
2 PC (Dual Core) 2
3 Arduino Uno 16
4 Raspberry Pi 5
5 LCD’s 15
7 Ultrasonic Sensors 12
9 Web Cameras 5
10 SMD Soldering Kit 2
12 Jetson Nano 1