0% found this document useful (0 votes)
6 views23 pages

IOT - Final

The document is a practical lab manual for a Cloud Computing and Internet of Things course at Government Polytechnic College, Keelapalur. It includes a series of experiments related to cloud computing and IoT, detailing aims, required components, procedures, and code for each experiment. Key experiments include LED control, temperature sensor implementation, and cloud data monitoring using Raspberry Pi.

Uploaded by

chinnaa
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)
6 views23 pages

IOT - Final

The document is a practical lab manual for a Cloud Computing and Internet of Things course at Government Polytechnic College, Keelapalur. It includes a series of experiments related to cloud computing and IoT, detailing aims, required components, procedures, and code for each experiment. Key experiments include LED control, temperature sensor implementation, and cloud data monitoring using Raspberry Pi.

Uploaded by

chinnaa
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/ 23

131 - GOVERNMENT POLYTECHNIC COLLEGE

KEELAPALUR, ARIYALUR

N-SCHEME

4052550 – CLOUD COMPUTING AND INTERNET OF THINGS PRACTICAL

LAB MANUAL

R. CHINNAA M.E
LECTURER/CSE
INDEX

SL.
NO DATE NAME OF THE EXPERIMENT MARKS SIGN

PART A – CLOUD COMPUTING

1. IMPLEMENTATION OF SAAS USING WORD

2. IMPLEMENTATION OF SAAS USING EXCEL

3. IMPLEMENTING WEB SERVICES

4. INSTALLING GOOGLE APP ENGINE

5. INSTALLING VIRTUAL BOX

6. INSTALLING OPEN STACK

7. CASE STUDY

PART B – INTERNET OF THINGS

8. LED BLINK AND LED PATTERN

9. LED PATTERN WITH PUSH BUTTON

10. DISPLAYING HELLO WORLD

11. IMPLEMENTING SERVO MOTOR


CONTROL

12. IMPLEMENTATION OF LM35


TEMPERATURE SENSOR

13. IMPLEMENTATION OF IR SENSOR


WITH ANALOG INPUT

14. TEMPERATURE SENSOR MONITORING


WITH RASPBERRY PI
EX. NO: 8
LED BLINK AND LED PATTERN
Date:

AIM:
To implement LED Blink and LED Pattern with Arduino

SOFTWARE REQUIREMENT:

1. Arduino SDK

COMPONENTS REQUIRED:
1. Arduino Uno -1Nos
2. Breadboard -1Nos
3. 5mm Led: Red - 2Nos
4. Resistor 1k Ohm -1Nos
5. Jumper Wires - 4Nos

PROCEDURE:

1. Connect LED in the bread board. (For Ex: In led big needle is positive and small needle is negative)

2. Connect jumper wire from RED LED to 11rd pin in arduino uno kit and GREEN LED to 5th pin in
arduino uno kit.

3. Connect one end of resistor to red LED negative and other end to ground of arduino .

4. Connect one end of resistor to GREEN LED negative and other end to ground of arduino .

5. Connect UNO board to computer.

6. In computer open arduino software and type the code in the arduino software.

7. Click on tools->arduino board and tools->port->com port.

PANIMALAR POLYTECHNIC COLLEGE


CIRCUIT DIAGRAM:

CODE:
const int LED_red = 11;
const int LED_green =5;
void setup()
{
pinMode(LED_red, OUTPUT);
pinMode (LED_green,OUTPUT);
}
void loop()
{
digitalWrite (LED_red, HIGH);
digitalWrite (LED_green, LOW);
delay (1000);
digitalWrite (LED_red, LOW);
digitalWrite (LED_green, HIGH);
delay (1000);
}

RESULT:
Thus, the LED blink and LED pattern is implemented and executed successfully.
PANIMALAR POLYTECHNIC COLLEGE
EX. NO: 9
LED PATTERN WITH PUSH BUTTON
Date:

AIM:
To implement LED pattern with Push button control with Arduino.

SOFTWARE REQUIREMENT:

1. Arduino SDK

COMPONENTS REQUIRED:

1. Arduino Uno R3 -1 Nos


2. USB Cable A/B - 1 Nos
3. Push Button - 1 Nos
4. Resistors(10k ,470 ohm) - 1,7 Nos
5. 5mm LED -7 Nos
6. Breadboard -1 Nos
7. Connecting wires -1 Nos

PROCEDURE:

STEP # 1 ( Make Push Button Connections )

o Pin1 to 5V of Arduino.

o Resistor 10k B/w Pin2 of Push Button & Ground of Arduino

o Pin2 is also connected to D6 of Arduino


STEP # 2 ( Make LED Connections )

o Connect All -VE of LED To Ground to Arduino


STEP # 3 ( Make Resistors Connections )

o All Resistor’s to +VE of LED and then D7,D8,D9,D10,D11,D12,D13 of Arduino


STEP # 4 ( Upload Code )

PANIMALAR POLYTECHNIC COLLEGE


CIRCUIT DIAGRAM:

CODE:
int buttonPin = 8;
int buttonState = 0;
int p=0;

void setup()
{
for(int i=1; i<=6; i++)
pinMode(i,OUTPUT);
PANIMALAR POLYTECHNIC COLLEGE
pinMode(buttonPin, INPUT);
}

void loop()
{
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH)
{
p++;
delay(500);
}
if(p==1)
{
for(int i=1; i<=6; i++)
{
digitalWrite(i,HIGH);
delay(100);
digitalWrite(i,LOW);
delay(100);
}
}
if(p==2)
{
for(int i=1; i<=6; i++)
{
digitalWrite(i,HIGH);
delay(100);
}
for(int i=6; i>=1; i--)
{
digitalWrite(i,LOW);
delay(100);
}
}
}

RESULT:
Thus, LED pattern with push button control with Arduino is implemented and executed
successfully.
EX. NO: 10
DISPLAYING HELLO WORLD
Date:

AIM:

To display “Hello World” in LCD 16x2 display with Arduino.

SOFTWARE REQUIREMENT:

1. Arduino SDK

COMPONENTS REQUIRED:

1. Arduino Uno R3 -1Nos


2. USB Cable A/B -1 Nos
3. LCD disply -1 Nos
4. I2c module -1 Nos
5. Jumper cables(M to F) -4 Nos

PROCEDURE:

1. Connect LCD display to I2C module and solder it using the pins.

2. connect I2C module VCC to 5v in arduino

3. Connect I2C module ground pin to Arduino Ground

4. Connect SDA and SCL to A4 and A5 in arduino

5. Before running the code you must download two library files namely liquid crystal and wire

for running the LCD display using Arduino.

6. Then goto sketch -> include library->add zip library, import two library files which is

downloaded.

7. Goto Examples->liquid crystal->select hello world program.


8. Run the code.

PANIMALAR POLYTECHNIC COLLEGE


CIRCUIT DIAGRAM:

CODE

#include<Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(1,0);
lcd.print("Hello");
lcd.setCursor(1,1);
lcd.print("CSE Dept");
}
void loop()
{}

RESULT:
Thus, “Hello World” in LCD 16x2 display with Arduino is implemented and executed
successfully.
EX. NO: 11
TO IMPLEMENT SERVO MOTOR CONTROL
Date:

AIM:
To implement Servo motor control with Arduino.

SOFTWARE REQUIREMENT:

1. Arduino SDK

COMPONENTS REQUIRED:

1. Arduino Uno R3 - 1Nos


2. USB Cable A/B -1Nos
3. Servo motor -1 Nos
4. Breadboard -1Nos
5. Connecting wires -1Nos

PROCEDURE:
Servo motor wires:

1. Red color wire is always positive

2. black color is negative which is ground.

3. green color is the signal pin which we need to connect to the digital pin of the arduino

4. connect green color pin to 9th pin in arduino board.

5. import the servo library file into the arduino uno software;

6. Run the code, the servo motor will be shifting from 0 degree to 180 degree as given in the code.

PANIMALAR POLYTECHNIC COLLEGE


CIRCUIT DIAGRAM:

CODE
#include<Servo.h>
Servo s1;
void setup()
{
s1.attach(9);
}
void loop()
{
s1.write(0);
delay(1000);
s1.write(180);
delay(1000);
s1.write(0);
}

RESULT:
Thus, the servo motor control with arduino is implemented and executed successfully.
EX. NO: 12
IMPLEMENTATION OF LM35 TEMPERATURE SENSOR
Date:

AIM:
To implement and monitor LM35 temperature sensor and ultrasonic distance measurement
with Arduino.

SOFTWARE REQUIREMENT:

1. Arduino SDK

COMPONENTS REQUIRED:

1. Arduino Uno R3 -1Nos


2. USB Cable A/B -1 Nos
3. LCD display -1 Nos
4. I2c module -1 Nos
5. Jumper cables (M to F) -4 Nos
6. Ultrasonic sensor -1 Nos
7. LM35 temperature sensor -1 Nos

PROCEDURE:

1. Connect LCD display to arduino kit by following steps:

(i)connect I2c module VCC to 5v in arduino

(ii)Connect I2C module ground pin to Arduino Ground

(iii)Connect SDA and SCL to A4 and A5 in arduino

2. Connect Ultrasonic sensor to arduino by following steps:

(i)connect TRIG to pin 2 of arduino

(ii) Connect ECHO to pin 3 of arduino.


3. Connect LM35 temperature sensor with arduino kit by following steps:

(i) Connect positive (+) pin (1) to 5v of arduino

(ii) connect pin 2 of LM35 to A0 of Arduino


(iii)connect pin 3 to ground of arduino
4. Upload the header files <wire.h> and <liquid crystaldisplay.h>

CIRCUIT DIAGRAM:
Measure Temperature using LM35 with Arduino Uno
Ultrasonic Sensor with Arduino

CODE:
Measure Temperature using LM35 with Arduino Uno

const int lm35_pin = A1; /* LM35 O/P pin */


void setup() {
Serial.begin(9600);
}

void loop() {
int temp_adc_val;
float temp_val;
temp_adc_val = analogRead(lm35_pin); // Read Temperature
temp_val = (temp_adc_val * 4.88); // Convert adc value to equivalent voltage
temp_val = (temp_val/10); // LM35 gives output of 10mv/°C
Serial.print("Temperature = ");
Serial.print(temp_val);
Serial.print(" Degree Celsius\n");
delay(1000);
}

Ultrasonic Sensor with Arduino

#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int trigPin = 2; //declare pin for trigger pin of UltraSonic sensor;
int echoPin = 3; //declare pin for echo pin of UltraSonic sensor;
float speed = 0.0347; //declare speed of sound in air @ room temp;
int dist; //declare variable for containing distance sensed;
float pingTime; //declare variable for containing echo time;
float distinch;
void setup() {
Serial.begin(9600);

pinMode(trigPin,OUTPUT); //set trigger pin as outpin;


pinMode(echoPin,INPUT); //set echo pin as input;
// Initialize LCD
lcd.init();
lcd.backlight();
lcd.print ("CIRCUITSCHOOLS..");
lcd. setCursor (0, 1);
lcd.print ("Distance sensor");
delay(2000);
lcd.clear();
}
void loop() {
digitalWrite(trigPin,LOW);
delayMicroseconds(20);
digitalWrite(trigPin,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin,LOW); //creating a pulse for sensing distance;
pingTime = pulseIn(echoPin,HIGH); //read the echoTime, &hence the distance;
dist = (speed*pingTime*0.5);
distinch = dist/2.54;
Serial.print("Distance: ");
Serial.print(dist);
Serial.print("cms --- ");
Serial.print(distinch);
Serial.println("inches");
lcd.setCursor(0, 0);
lcd.print(dist);
lcd.print("cms");
lcd.setCursor(0, 1);
lcd.print(distinch);
lcd.print("inch");
delay(250);
}

RESULT
Thus the LM35 Temperature Sensor and Ultrasonic Distance Measurement with Arduino is
implemented and executed successfully
EX. NO: 13
IMPLEMENTATION OF IR SENSOR WITH ANALOG INPUT
Date:

AIM:
To implement IR Sensor with Analog input with Arduino.

SOFTWARE REQUIREMENT:

1. Arduino SDK

COMPONENTS REQUIRED:

1. Arduino Uno R3 - 1Nos


2. USB Cable A/B -1Nos
3. Jumper cables (M to F) - 4 Nos
4. IR sensor -1 Nos
5. LED -1 Nos

PROCEDURE:

1. Connect IR sensor with the following steps:

(i)connect out pin to 7 th pin of arduino

(ii)connect VCC to 5v of arduino

2. Connect GRND to GRND of arduino

3. Connect LED to detect the sensor

(i)connect 13th pin to LED positive and negative to grnd.

4. Upload the code and sensor will work with led light detection.
5. We can use buzzor for detection the sound.

PANIMALAR POLYTECHNIC COLLEGE


CIRCUIT DIAGRAM:
CODE:

void setup()
{
pinMode(7,INPUT);
pinMode(9,OUTPUT);
}
void loop()
{
If (digitalRead(7)== HIGH)
{
digitalWrite(9,HIGH);
}
else
{
digitalWrite(9,LOW);
}
}

RESULT:
Thus, the IR Sensor Analog Input with Arduino is implemented and executed successfully.
EX. NO: 14
TEMPERATURE SENSOR MONITORING WITH RASPBERRY PI
Date:

AIM:
To implement cloud reading temperature sensor using Raspberry Pi.

SOFTWARE REQUIREMENT:

1. Arduino SDK

COMPONENTS REQUIRED:

1. Arduino Uno R3 -1Nos


2. USB Cable A/B -1Nos
3. Jumper cables (M to F) -4Nos
4. NODE MCU -1Nos
5. WIFI ADAPTER -1Nos

PROCEDURE:

1. To create the think, speak account

• Sign up to THINK SPEAK account, by clicking on create new account

• Enter the details e-mail id,name and click on continue,

• You will be receiving the confirmation mail link and click on the link and then continue to
sign in the thinkspeak account.

2. Click on create channel and enter the field details.Then channel will be created.

3. Click on API keys and there will be 2 keys write API and Read API keys,write API keys will store
the sensor values and write in think speak and when you give the think speak key value to arduino
board then it is called write API keys.

4. Download DHT library and update into the arduino IDE

5. Upload below code in the arduino uno


6. Run the code and automatically the temperature will be increased upto the current temperature in the
think speak cloud interface.

CODE:

#include "dht.h"
#define dht_apin A0
dht DHT;
#include <SoftwareSerial.h> //Software Serial library
SoftwareSerial espSerial(2, 3); //Pin 2 and 3 act as RX and TX. Connect them to TX and RX of ESP8266
#define DEBUG true
String mySSID = "GS"; // WiFi SSID
String myPWD = "ptleecnpt"; // WiFi Password
String myAPI = "IFNXUVCVENMT25D8"; // API Key
String myHOST = "api.thingspeak.com";
String myPORT = "80";
String myFIELD = "field1";
int sendVal;
void setup()
{
Serial.begin(9600);
Serial.println("DHT11 Humidity & temperature Sensor\n\n");
delay(1000);
espSerial.begin(115200);
espData("AT+RST", 1000, DEBUG); //Reset the ESP8266 module
espData("AT+CWMODE=1", 1000, DEBUG); //Set the ESP mode as
station mode
espData("AT+CWJAP=\"" + mySSID + "\",\"" + myPWD + "\"", 1000, DEBUG); //Connect to WiFi
delay(1000);
}
void loop(){
DHT.read11(dht_apin);
String sendData = "GET /update?api_key=" + myAPI + "&" + myFIELD + "=" +String(DHT.humidity);
espData("AT+CIPMUX=1", 1000, DEBUG); //Allow multiple connections
espData("AT+CIPSTART=0,\"TCP\",\"" + myHOST + "\"," + myPORT, 1000,DEBUG);
espData("AT+CIPSEND=0," + String(sendData.length() + 4), 1000, DEBUG);
espSerial.find(">");
espSerial.println(sendData);
Serial.print("Value to be sent: ");
Serial.println(DHT.humidity);
espData("AT+CIPCLOSE=0", 1000, DEBUG);
delay(10000);
}
String espData(String command, const int timeout, boolean debug)
{
Serial.print("AT Command ==> ");
Serial.print(command);
Serial.println(" ");
String response = "";
espSerial.println(command);
long int time = millis();
while ( (time + timeout) > millis())
{
while (espSerial.available())
{
char c = espSerial.read();
response += c;
}
}
if (debug)
{}
return response;
}

PANIMALAR POLYTECHNIC COLLEGE


RESULT:
Thus, the thinkspeak cloud is connected with Arduino uno board and temperature is calculated
successfully.

You might also like