IoT Lab-Manual - Yash
IoT Lab-Manual - Yash
DEPARTMENT
OF
INFORMATION TECHNOLOGY
Laboratory Manual
For Internet of
Things
Practical List
THEORY:
The structure of a Computer system can be visualized as having four basic components:
1. Hardware: Provides basic computing resources - CPU, memory, I/O devices.
2. Operating system: Controls and coordinates use of hardware among various applications
and users.
3. Application programs: Define the ways in which the system resources are used to solve
the computing problems of the users.
4. Users: Anybody who desires work to be done by a computer system. People, machines,
other computers.
➢ Memory Management
Memory management refers to management of Primary Memory or Main Memory (RAM). Main
memory is a large array of words or bytes where each word or byte has its own address. Main
memory provides a fast storage that can be accessed directly by the CPU. For a program to be
executed, it must be in the main memory.
An Operating System does the following activities for memory management
−
● Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are
not in use.
● In multiprogramming, the OS decides which process will get memory when and how
much. ● Allocates the memory when a process requests it to do so.
● De-allocates the memory when a process no longer needs it or has been terminated.
➔ Device Management
An Operating System manages device communication via their respective drivers. It handles
different connected devices like keyboard, mouse, printers, etc.
It does the following activities for device management −
● Keep track of all devices. Program responsible for this task is known as the I/O controller.
● Decides which process gets the device when and for how much time.
● Allocates the device in an efficient way.
● De-allocates devices.
➔ File Management
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions.
An Operating System does the following activities for file
management −
● Keeps track of information, location, uses, status etc. The collective facilities are often
known as file systems.
● Decides who gets the resources.
● Allocates the resources.
● De-allocates the resources.
● Control over system performance − Recording delays between request for a service
and response from the system.
● Job accounting − Keeping track of time and resources used by various jobs and users.
● Error detecting aids − Production of dumps, traces, error messages, and other debugging
and error detecting aids.
NOTE: The state of the windows operating system can be checked using ‘Windows Task
Manager’ as shown below-
EXERCISES:
1. What is an Operating System? Describe the various functions of an operating system in
brief.
3. What do you mean by an Operating System process? What activities does an OS perform
for process management?
4. What is the application software and System Software?
QUIZ:
1. List the various operating systems that you have used.
REFERENCES:
1. https://www.tutorialspoint.com/operating_system/os_overview.htm
2. https://www.guru99.com/operating-system-tutorial.html
EVALUATION:
Date: Signature:
THEORY:
What is Windows OS?
Windows OS, computer operating system (OS) developed by Microsoft Corporation to run
personal computers (PCs). Windows featured the first graphical user interface (GUI) for
operating systems. Approximately 90 percent of PCs run some version of Windows. The various
versions of Windows are Windows XP, Windows 7, Windows 8, Windows 10, etc.
Windows has two command shells: The Command shell and PowerShell. Each shell is a software
program that provides direct communication between you and the operating system or
application, providing an environment to automate IT operations.
You can run windows command prompt (cmd) by searching cmd in run menu (Windows + R) as
shown below-
EXERCISES:
1. Explain the following windows commands:
cd, dir, chdir, cls, copy, del, delete, fdisk, find, findstr, format, ftp, ipconfig, mkdir, more,
move, net, netsh, netstat, ping, rd, remove, rmdir, telnet, tree, xcopy.
QUIZ:
1. What command should be used to create a new directory in windows?
REFERENCES:
1. https://helpdeskgeek.com/help-desk/21-cmd-commands-all-windows-users-should-know/
2. https://docs.microsoft.com/en-us/windows-server/administration/windows- commands/windows-
commands
EVALUATION:
4 2 4 10
Date: Signature:
THEORY:
What is Unix?
● Unix is an OS for Programmers as shell (the command interpreter) that provides the
programming facility.
● It provides an in-built security mechanism through the username and password, combined
with the access rights associated with files.
The main concept that unites all the versions of Unix is the following four basics −
● passwd
The passwd command is used to change passwords for user accounts. A normal user may
only change the password for his or her own account, while the superuser may change the
password for any account.
Syntax: passwd [options] [LOGIN]
● uname
Print certain system information. Syntax:
uname [OPTION]...
● who
who command prints information about all users who are currently logged in.?
Syntax: who [OPTION]... [ FILE ] [ am i ]
● find
To search the entire file-system to locate files and directories according to the specific
search criteria. Other than searching files in can also perform actions(executing
commands) on searched files. Syntax: find [option] [action]
● man
To view manual pages for Unix commands. Syntax: man
<command_name>
● clear
To clear the terminal screen.
Syntax: clear
● ls list files and directories in the specified directory or the current working directory.
Syntax:
ls [options] [path]
● cd
Change the current working directory to the specified path. Syntax:
cd [path]
● cp
copy files from source to destination. Syntax:
cp [source/filename] [destination]
● rm
remove files and directories.
Syntax: rm <name>
● mv
rename or move files and directories to another location.
Syntax: mv <source path> <destination path>
● chmod
change file/directory access permissions. (r-read; w-write; x-execute)
Syntax: chmod [OPTIONS] MODE FILE…
(remove execute permission for all users)
● mkdir
make a new directory.
Syntax: mkdir <directory name>
● rmdir
remove directories
Syntax: rmdir <directory name>
Syntax: ipconfig
● netstat
show network stats and routing information.
Syntax: netstat
QUIZ:
1. In Unix, how would you check if a given file exists in the current directory?
REFERENCES:
1. https://www.unixtutorial.org/basic-unix-commands
2. https://www.tutorialspoint.com/unix/index.htm
3. https://www.geeksforgeeks.org/introduction-to-unix-system/
EVALUATION:
4 2 4 10
Date: Signature :
THEORY:
Introduction to HTML
HTML stands for Hypertext Markup Language, and it is the most widely used language to write
Web Pages.
● Hypertext refers to the way in which Web pages (HTML documents) are linked together.
Thus, the link available on a webpage is called Hypertext.
● As its name suggests, HTML is a Markup Language which means you use HTML to
simply "mark-up" a text document with tags that tell a Web browser how to structure it to
display.
● HTML describes the structure of a Web page
● HTML consists of a series of elements
● HTML elements tell the browser how to display the content
● HTML elements are represented by tags
● HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
● Browsers do not display the HTML tags, but use them to render the content of the page
Features of HTML
● It is easy to learn and easy to use.
● It is platform independent.
● Images, video and audio can be added to a web page.
● Hypertext can be added to text.
● It is a markup language.
Advantages
● HTML is used to build websites.
● It is supported by all browsers.
Disadvantages
● HTML can create only static web pages so for dynamic web pages other languages have
to be used.
● Large amount of code has to be written to create a simple web page. ● Security feature is
not good.
Tag Description
<DOCTYPE! html> This tag defines the document type and HTML version.
<html>
This is called HTML root element and used to wrap all the
code.
<head> Head tag contains metadata, title, page CSS etc. All the
HTML elements that can be used inside <head> are:
- <style>
- <title>
- <base>
- <noscript>
- <script>
- <meta>
<h1> This tag represents the heading. There are different types of
<p> This tag represents a paragraph. They start with the <p> tag
and ends with <p>.
Output
Output
● Horizontal Break
Horizontal lines are used to visually break-up sections of a document. The <hr> tag
creates a line from the current position in the document to the right margin and breaks the
line accordingly.
Like the <br /> tag, it also does not have any body. Example:
<p>This is paragraph one and should be on top</p> <hr />
<p>This is paragraph two and should be at bottom</p>
● Formatting Tags
These tags are used to format the text in a paragraph. ○
Bold Text
Anything that appears within <b>...</b> element, is displayed in bold. Example:
<p>The following word uses a <b>bold</b> typeface.</p>
○ Italic Text
Anything that appears within <i>...</i> element is displayed in italicized.
Example: <p>The following word uses a <i>italicized</i> typeface.</p>
○ Underlined Text
Anything that appears within <u>...</u> element, is displayed with underline
Example:
<p>The following word uses a <u>underlined</u> typeface.</p>
○ Striked Text
Anything that appears within <strike>...</strike> element is displayed with
strikethrough, which is a thin line through the text Example:
<p>The following word uses a <strike>strikethrough</strike> typeface.</p>
○ Monospaced Font
The content of a <tt>...</tt> element is written in monospaced font. Most of the
fonts are known as variable-width fonts because different letters are of different
○ Superscript Text
The content of a <sup>...</sup> element is written in superscript; the font size
used is the same size as the characters surrounding it but is displayed half a
character's height above the other characters.
Example:
<p>The following word uses a <sup>superscript</sup> typeface.</p>
○ Subscript Text
The content of a <sub>...</sub> element is written in subscript; the font size used
is the same as the characters surrounding it, but is displayed half a character's
height beneath the other characters.
Example:
<p>The following word uses a <sub>subscript</sub> typeface.</p>
○ Inserted Text
Anything that appears within <ins>...</ins> element is displayed as inserted text.
Example:
<p>I want to drink <del>cola</del> <ins>wine</ins></p>
○ Deleted Text
Anything that appears within <del>...</del> element, is displayed as deleted text.
Example:
<p>I want to drink <del>cola</del> <ins>wine</ins></p>
○ Large Text
The content of the <big>...</big> element is displayed one font size larger than
the rest of the text surrounding it.
Example:
<p>The following word uses a <big>big</big> typeface.</p>
○ Small Text
EXERCISES:
1. Explain any 5 basic HTML tags with their syntax and usage.
2. Enlist and explain the various text formatting tags in HTML with examples.
3. Give examples of empty tags in HTML.
QUIZ:
1. Where is the content in <title> tag displayed when a html file is opened in a web browser?
2. Name one HTML tag that does not require a closing tag.
REFERENCES:
1. https://www.geeksforgeeks.org/html-introduction/
2. https://www.tutorialspoint.com/html/index.htm
EVALUATION:
4 2 4 10
Date: Signature:
THEORY:
What is a Static Website?
A static website or a web page is a collection of items like text, images and multimedia elements
containing marked up content created with Hyper Text Markup Language (HTML) and stored in
a web server. Wikipedia is an example of a static website.
A static website does not interact with the user. It just displays information for the reader to read.
● Browser interprets the marked-up content and displays it in the browser window to give a
look and feel to the website. All web browsers have their own way of interpreting HTML
markups. This is the reason the same website looks different on Chrome, Firefox, Safari,
Edge and Internet Explorer. Web designers focus on developing sites that look similar on
all browsers and platforms.
● Static sites are more appropriate for distributing fixed content that does not change with
time or not need frequent update.
● Generally, site owners create and update the content of static sites by themselves.
Notice the content of the original file and the look in the browser, all the HTML tags are converted
in the browser accordingly and only the content is displayed excluding the spaces. For example, the
content in between the h1 tags is interpreted as a heading during the display in the browser window.
● The same content will be loaded every time you open the file since there is no interactive
processing neither at server nor at browser side.
● For a real case on the internet, the HTML file will be located on a web server with a page
name on the domain like “www.domain-name.com/staticpage.html”. The web page will
open in the browser window when a visitor enters this URL directly on the browser
address bar or when this URL is redirected from a search result.
2. Create a static website about yourself, describing your interests, achievements and other
details.
QUIZ:
1. List some advantages of static websites.
REFERENCES:
1. https://www.webnots.com/basics-of-a-static-website/
EVALUATION:
4 2 4 10
Date: Signature:
THEORY:
What is IOT?
IOT stands for Internet of Things. In simple words, this is the concept of basically connecting
any physical device with an on and off switch to the Internet.
This includes everything from cell phones, washing machines, Air conditioners, wearable devices
etc. As mentioned, anything that has on and off switch then chances are it can be part of IOT. The
“The Internet of Things is simply a network of internet connected objects able to collect and
exchange data. The word Internet of Things has two main parts; Internet being the backbone of
connectivity, and the Things meaning object/device. ”
➢ Sensor/Device
Sensor and device are a key component that helps you to collect live data from the surrounding
environment. All this data may have various levels of complexity.
A device may have various types of sensors which perform multiple tasks apart from sensing.
Example, a mobile phone is a device which has multiple sensors like GPS, camera etc.
➢ Connectivity
All collected data is sent to cloud infrastructure, but it needs a medium for transport.
So, this sensor should be connected to cloud using various medium of communication like
Bluetooth, Wi-Fi, WAN etc.
➢ Data Processing
Once data is collected, and it gets to the cloud, the software performs processing on gathered
data.
➢ User Interface
The information needs to be available to the end user in some way which can be achieved by
triggering alarms on their phone or sending them notification through email or text message.
IOT is a big model that tries to integrate multiple things together, while Embedded systems are
part of the overall IOT. In one sentence, the embedded system is a subset of IOT.
In short: IOT = ET + NT + IT
At the simplest level, IOT is a combination of Embedded Technology (ET), Network Technology
(NT) and Information Technology (IT).
Example:
Let’s imagine you have a "Smart air conditioning unit" in your home that is connected to the
internet. (This is a "thing" connected to the internet) Now, imagine it's a hot summer day and you
have left for home from your work. You would like your home to be cool enough by the time you
enter it. So, when you leave your office, you can remotely switch ON the air conditioning unit of
your home using your mobile (another "Thing" connected to the internet). Technically, with the
internet, you can control your AC system from any part of the world as long as both the AC and
your mobile are connected using the "Internet".
● Your smart A/C will have an embedded system that collects temperature data from a
sensor and send it to the cloud (internet) using a WIFI module. This is your Embedded
System.
● The WIFI network and Cloud constitute your Network Technology.
● Your mobile will have an APP running in it that will receive the data. Depending on the
received data, the app (in turn the mobile) will switch ON the A/C depending on your
GPS coordinate. The mobile app infrastructure is a simple Information Technology.
Applications Of IOT:
Smart Thermometers Helps you to save resources on heating bills by knowing your
usage patterns.
Activity Trackers Helps you to capture heart rate patterns, calorie expenditure,
activity levels, and skin temperature on your wrist.
Smart Outlets Remotely turn any device on or off. It also allows you to track
a device's energy level and get custom notifications directly
into your smartphone.
Connect Health The concept of a connected health care system facilitates real-
time health monitoring and patient care. It helps in improved
medical decision-making based on patient data.
Smart City Smart cities offer all types of use cases which include traffic
management to water distribution, waste management, etc.
Smart Health Smart homes encapsulate the connectivity inside your homes.
It includes smoke detectors, home appliances, light bulbs,
windows, door locks, etc.
Smart supply chain Helps you in real time tracking of goods while they are on the
road, or getting suppliers to exchange inventory information.
EXERCISES:
1. What is IoT?
2. Differentiate between IoT and Embedded System.
3. Explain one application of IoT with all its components.
QUIZ:
1. List 5 real life applications of IoT.
REFERENCES:
EVALUATION:
Date: Signature:
THEORY:
What is Arduino?
Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino
boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it
into an output - activating a motor, turning on an LED, publishing something online.
Advantages of Arduino
● Inexpensive
● Cross-platform
● Simple, clear programming environment
● Open source and extensible software
● Open source and extensible hardware
Arduino UNO
Here, we will study the Arduino UNO board because it is the most popular board in the Arduino board
family. In addition, it is the best board to get started with electronics and coding. Some boards look a bit
different from the one given below, but most Arduinos have a majority of these components in common.
Power USB
Arduino boards can be powered by using the USB cable from your computer.
All you need to do is connect the USB cable to the USB connection (1).
Arduino boards can be powered directly from the AC mains power supply by
connecting it to the Barrel Jack (2).
Voltage Regulator
The function of the voltage regulator is to control the voltage given to the Arduino
board and stabilize the DC voltages used by the processor and other elements.
Crystal Oscillator
The crystal oscillator helps Arduino in dealing with time issues. How does
Arduino calculate time? The answer is, by using the crystal oscillator. The number
printed on top of the Arduino crystal is 16.000H9H. It tells us that the frequency
is 16,000,000 Hertz or 16 MHz
Arduino Reset
You can reset your Arduino board, i.e., start your program from the beginning.
You can reset the UNO board in two ways. First, by using the reset button (17) on
the board. Second, you can connect an external reset button to the Arduino pin
labelled RESET (5).
37 IT Department, L.E. College, Morbi
Boda Yash Maheshbhai 210310116016
Analog pins
The Arduino UNO board has six analog input pins A0 through A5. These pins
can read the signal from an analog sensor like the humidity sensor or
temperature sensor and convert it into a digital value that can be read by the
microprocessor.
Main microcontroller
Each Arduino board has its own microcontroller (11). You can assume it as the
brain of your board. The main IC (integrated circuit) on the Arduino is slightly
different from board to board. The microcontrollers are usually of the ATMEL
Company. You must know what IC your board has before loading up a new
program from the Arduino IDE. This information is available on the top of the
IC. For more details about the IC construction and functions, you can refer to
the data sheet.
Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino
consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred
to as an SPI (Serial Peripheral Interface), which could be considered as an
"expansion" of the output. Actually, you are slaving the output device to the
master of the SPI bus.
Boda Yash Maheshbhai 210310116016
This LED should light up when you plug your Arduino into a power source to
indicate that your board is powered up correctly. If this light does not turn on,
then there is something wrong with the connection.
TX and RX LEDs
On your board, you will find two labels: TX (transmit) and RX (receive). They
appear in two places on the Arduino UNO board. First, at the digital pins 0 and
1, to indicate the pins responsible for serial communication. Second, the TX and
RX led (13). The TX led flashes with different speed while sending the serial
data. The speed of flashing depends on the baud rate used by the board.
RX flashes during the receiving process.
Digital I/O
The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM
(Pulse Width Modulation) output. These pins can be configured to work as
input digital pins to read logic values (0 or 1) or as digital output pins to drive
different modules like LEDs, relays, etc. The pins labeled “~” can be used to
generate PWM.
AREF
EXERCISES:
1. What is Arduino? What is its purpose?
QUIZ:
1. How many types of Arduinos do we have?
REFERENCES:
1. https://www.arduino.cc/
EVALUATION:
4 2 4 10
Date: Signature :
TITLE: Developing LED blinking project using Arduino. [Attach a report of your chosen
project]
THEORY:
Components Required
● 1 × Breadboard
● 1 × Arduino UNO R3
● 1 × LED
● 1 × 330Ω Resistor ● 2 × Jumper
Procedure
Follow the circuit diagram and hook up the components on the breadboard as shown in the
image given below.
Note: To find out the polarity of an LED, look at it closely. The shorter of the two legs, towards
the flat edge of the bulb indicates the negative terminal.
Components like resistors need to have their terminals bent into 90° angles in order to fit the
breadboard sockets properly. You can also cut the terminals shorter.
Open the Arduino IDE software on your computer. Coding in the Arduino language will control
your circuit. Open the new sketch File by clicking New.
Program:
*
Blink
Turns on an LED on for one second, then off for one second, repeatedly. */
// the setup function runs once when you press reset or power the board
void setup() { // initialize digital pin 13 as an output. pin Mode(2,
OUTPUT);
}
// the loop function runs over and over again forever void
loop() {
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second digitalWrite(2, LOW); // turn the LED
off by making the voltage LOW delay(1000); // wait for a second }
Code to Note pinMode(2, OUTPUT) − Before you can use one of Arduino’s pins, you need to
tell Arduino Uno R3 whether it is an INPUT or OUTPUT. We use a builtin “function” called
pinMode() to do this. digitalWrite(2, HIGH) − When you are using a pin as an OUTPUT, you
can command it to be HIGH (output 5 volts), or LOW (output 0 volts).
Result
You should see your LED turn on and off. If the required output is not seen, make sure you have
assembled the circuit correctly, and verified and uploaded the code to your board.
EXERCISES:
1. Which two methods are required in the Arduino program?
2. List out different sensors which can be used to design IoT application,
QUIZ:
1. Give the purpose of pinMode().
REFERENCES:
1. https://youtu.be/ZEVxj1_wlTY
EVALUATION:
Observation and Timely Completion Quiz and Viva Total
Implementation
4 2 4 10
Date: Signature :