0% found this document useful (0 votes)
55 views40 pages

Lab Manual Iot 6th

The document provides an index and overview of 10 experiments involving the Arduino board and Raspberry Pi. It introduces the Arduino board, Arduino IDE, different cables and libraries. It describes experiments interfacing LED, buzzer, push button, temperature/humidity sensor, ultrasonic sensor, light sensor and flame sensor with Arduino. It also introduces Raspberry Pi, installation and provides an overview of the experiments.

Uploaded by

darshanbhavsar41
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)
55 views40 pages

Lab Manual Iot 6th

The document provides an index and overview of 10 experiments involving the Arduino board and Raspberry Pi. It introduces the Arduino board, Arduino IDE, different cables and libraries. It describes experiments interfacing LED, buzzer, push button, temperature/humidity sensor, ultrasonic sensor, light sensor and flame sensor with Arduino. It also introduces Raspberry Pi, installation and provides an overview of the experiments.

Uploaded by

darshanbhavsar41
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/ 40

SAL Institute of Technology & Engineering

Research

CE, CSE Department

IOT AND APPLICATIONS (3160716)

Laboratory Manual
Year: 2023-2024

1
INDEX

Sr. Page No.


No. Experiment From To Date Marks Signature

Introduction to Arduino Board, Arduino


1. IDE and Cables.
To interface LED / Buzzer with Arduino
2. Uno and write a program to turn ON LED
for 1 sec after every 2 seconds.
To interface Push button with Arduino
Uno and write a program to turn ON LED
3. when push button is pressed or at sensor
detection.
To interface Temp and Humidity module
4. with Arduino Uno and note the result.
Perform Experiment using Arduino Uno
5. to measure the distance of any object
using Ultrasonic Sensor.
Perform Light Sensor (Photoresister)
6. using Arduino Uno.

7. Perform Flame Sensor using Arduino.

8. Perform LASER module using Arduino.

9. An Introduction to Raspberry Pi.

10. Installation of Raspberry Pi.

2
Experiment No: 1 Date: / /
TITLE: Introduction to Arduino Board, Arduino IDE and Cables.
OBJECTIVES:

After studying this practical student will able to learn about basics of Arduino IDE and different types of
Arduino board and its usage.

THEORY:
Introduction to Arduino:

Arduino is an open-source prototyping platform based on easy-to-use hardware and software.


Looking at the board from the top down, this is an outline of what you will see (parts of the board
you might interact with in the course of normal use are highlighted)

Starting clockwise from the top centre:

3
• Analog Reference pin (orange)
• Digital Ground (light green)
• Digital Pins 2-13 (green)
• Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for digital i/o
(digitalRead and digitalWrite) if you are also using serial communication.
• Reset Button - S1 (dark blue)
• In-circuit Serial Programmer (blue-green)
• Analog In Pins 0-5 (light blue)
• Power and Ground Pins (power: orange, grounds: light orange)
• External Power Supply In (9-12VDC) - X1 (pink)
• Toggles External Power and USB Power SV1 (purple)
• USB (used for uploading sketches to the board and for serial communication between theboard and
the computer; can be used to power the board) (yellow)
Arduino IDE:
The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text
editor for writing code, a message area, a text console, a toolbar with buttons for common
functions and a series of menus. It connects to the Arduino and Genuino hardware to upload
programs and communicate with them.
 Writing Sketches
1. File
2. Edit
3. Sketch
4. Tools
5. Help
 Sketchbook
 Tabs, Multiple Files, and Compilation
 Uploading
 Libraries
 Third-Party Hardware
 Serial Monitor
 Preferences
 Language Support
 Boards

Writing Sketches:

Programs written using Arduino Software (IDE) are called sketches. These sketches are written
in the text editor and are saved with the file extension .ino. The editor has features for
cutting/pasting and for searching/ replacing text. The message area gives feedback while saving
and exporting and also displays errors. The console displays text output by the Arduino

4
Software (IDE), including complete error messages and other information. The bottom right
hand corner of the window displays the configured board and serial port. The toolbar buttons
allow you to verify and upload programs, create, open, and save sketches, and open the serial
monitor.

Sketchbook:

The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store your
programs (or sketches). The sketches in your sketchbook can be opened from the File
>Sketchbook menu or from the Open button on the toolbar. The first time you run the Arduino
software, it will automatically create a directory for your sketchbook. You can view or change
the location of the sketchbook location from with the Preferences dialog. Beginning with
version 1.0, files are saved with a.ino file extension. Previous versions use the.pde extension.
You may still open.pde named files in version 1.0 and later, the software will automatically
rename the extension to .ino.

Tabs, Multiple Files, and Compilation:

Allows you to manage sketches with more than one file (each of which appears in its own
tab). These can be normal Arduino code files (no visible extension), C files (.c extension),
C++ files (.cpp), or header files (.h).

Uploading:

Before uploading your sketch, you need to select the correct items from the Tools > Board and
Tools > Port menus. The boards are described below. On the Mac, the serial port is probably
something like /dev/tty. usbmodem241 (for an Uno or Mega2560 or Leonardo) or
/dev/tty.usbserial-1B1 (for a Duemilanove or earlier USB board), or /dev/tty. USA19QW1b1P1.1
(for a serial board connected with a Keyspan USB-to-Serial adapter). On Windows, it's probably
COM1 or COM2 (for a serial board) or COM4, COM5, COM7, or higher (for a USB board) –
to find out, you look for USB serial device in the ports section of the Windows Device Manager.
On Linux, it should be /dev/ttyACMx , /dev/ttyUSBx or similar. Once you've selected the
correct serial port and board, press the upload button in the toolbar or select the Upload item
from the File menu. Current Arduino boards will reset automatically and begin the upload. With
older boards (pre- Diecimila) that lack auto-reset, you'll need to press the reset button on the
board just before starting the upload. On most boards, you'll see the RX and TX LEDs blink as
the sketch is uploaded. The Arduino Software (IDE) will display a message when the upload is

5
complete, or show an error. When you upload a sketch, you're using the Arduino boot loader, a
small program that has been loaded on to the microcontroller on your board. It allows you to
upload code without using any additional hardware. The boot loader is active for a few seconds
when the board resets; then it starts whichever sketch was most recently uploaded to the
microcontroller. The boot loader will blink the on-board (pin 13) LED when it starts (i.e., when
the board resets).

Libraries:

Libraries provide extra functionality for use in sketches, e.g., working with hardware or
manipulating data. To use a library in a sketch, select it from the Sketch > Import Library menu.
This will insert one or more #include statements at the top of the sketch and compile the library
with your sketch. Because libraries are uploaded to the board with your sketch, they increase the
amount of space it takes up. If a sketch no longer needs a library, simply delete its #include
statements from the top of your code.
There is a list of libraries in the reference. Some libraries are included with the Arduino software.
Others can be downloaded from a variety of sources or through the Library Manager. Starting
with version 1.0.5 of the IDE, you do can import a library from a zip file and use it in an open
sketch. See these instructions for installing a third-party library.

Third-Party Hardware:
Support for third-party hardware can be added to the hardware directory of your sketch book
directory. Platforms installed there may include board definitions (which appear in the board
menu), core libraries, boot loaders, and programmer definitions. To install, create the hardware
directory, then unzip the third- party platform into its own sub-directory. (Don't use "arduino" as
the sub-directory name or you'll override the built-in Arduino platform.) To uninstall, simply
delete its directory.

Serial Monitor

Displays serial data being sent from the Arduino board. To senddata to the board, enter text and
click on the "send" button or press enter. Choose the baud rate from the drop-down that matches
the rate passed to Serial.begin in your sketch. Note that onWindows, Mac or Linux, the Arduino
or Genuino board will reset when you connect with the serial monitor.

6
Preferences:
Some preferences can be set in the preferences dialog (found under the Arduino menu on the
Mac,or File on Windows and Linux). The rest can be found in the preferences file, whose
location is shown in the preference dialog.

Language Support:
Since version 1.0.1, the Arduino Software (IDE) has been translated into 30+ different
languages.By default, the IDE loads in the language selected by your operating system.
(Note: on Windows and possibly Linux, this is determined by the locale setting which controls
currency and date formats, not by the language the operating system is displayed in.) If you would
like to change the language manually, start the Arduino Software (IDE) and open the Preferences
window. Next to the Editor Language there is a dropdown menu of currently supported
languages. Select your preferred language from the menu, and restart the software to use the
selected language. If your operating system language is not supported, the Arduino Software
(IDE) will default to English.

Boards:
The board selection has two effects: it sets the parameters (e.g., CPU speed and baud rate) used
when compiling and uploading sketches; and sets and the file and fuse settings used by the burn
boot loader command. Some of the board definitions differ only in the latter, so even if you've
been uploading successfully with a particular selection, you'll want to check it before burning the
boot loader.
- Arduino/Genuino Uno: An ATmega328 running at 16 MHz with auto-reset, 6 Analog In, 14
Digital I/O and 6 PWM.
- Arduino Mega: An ATmega1280 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital
I/O and 15 PWM.
- Arduino Micro: An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital
I/O and 7 PWM.

Arduino Cables:
Arduino is great but sometimes connecting interesting things to it can be a pain. Here are some
things that may make it easier for you. Here are some of the cables and pins that are available,
and below we'll show you how to use them for many different applications.

7
Standard issue USB 2.0 cables. This is the most common A to B Male/Male type peripheral cable.
Compatible with most Arduino boards such as Arduino Mega, Romeo, ArduinoDuemilanove.
Often used for printers and other peripherals. While still a little bulky in shape for small
embedded systems, this is a standard cable found everywhere. Use this cable with Arduino UNO
and others, but not for Arduino Leonardo based boards.May come in White or Black.

EXERCISE:

(1) Define different types of Arduino Boards.


(2) Define types of Cables.
(3) Install Arduino IDE in your system.
(4) Explain Hardware and Software requirement for installation of Arduino.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

8
Experiment No: 2 Date: / /
TITLE: To interface LED / Buzzer with Arduino Uno and write a program to turn ON LED for 1 sec
after every 2 seconds.
OBJECTIVES:
After studying this practical student will able to learn about use of Arduino IDE & Arduino Board and
implement the program of LED.

THEORY:
Hardware Required:
 Arduino or Genuino Board
 LED
 220-ohm resistor

Circuit:
To build the circuit, connect one end of the resistor to Arduino pin 13. Connect the long leg of the LED
(the positive leg, called the anode) to the other end of the resistor. Connect the short leg of the LED
(the negative leg, called the cathode) to the Arduino GND, as shown in the diagram and the schematic
below.
Most Arduino boards already have an LED attached to pin 13 on the board itself. If you run this example
with no hardware attached, you should see that LED blinks.
The value of the resistor in series with the LED may be of a different value than 220 ohm; the LED will
lit up also with values up to 1K ohm.

9
Code:

After you build the circuit plug your Arduino or Genuino board into your computer, start the
Arduino Software (IDE) and enter the code below. You may also load it from the menu
File/Examples/01.Basics/Blink. The first thing you do is to initialize pin 13 as an output pin
with the Line.

pinMode(13, OUTPUT);

In the main loop, you turn the LED on with the line:

digitalWrite(13, HIGH);

This supplies 5 volts to pin 13. That creates a voltage difference across the pins of the
LED, and lights it up. Then you turn it off with the line:

digitalWrite(13, LOW);

That takes pin 13 back to 0 volts, and turns the LED off. In between the on and the off, you
want enough time for a person to see the change, so the delay () commands tell the board
to do nothing for 1000 milliseconds, or one second. When you use the delay () command,
nothing else happens for that amount of time.

// the setup function runs once when you press reset or power the board
void setup ()
{ // initialize digital pin 13 as
an output. pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever


void loop ()
{
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay (1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW

10
delay (1000); // wait for a second
}

EXERCISE:

(1) Try to implement with different types of LED


(2) Implement it with different type of Ardunio board and check the output.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

11
Experiment No: 3 Date: / /
TITLE: To interface Push button with Arduino Uno and write a program to turn ON LED when push
button is pressed or at sensor detection.

OBJECTIVES:
After studying this practical student will able to learn about use of Arduino Uno Board and implement
the program of LED using PUSH button.

Circuit:

Code:

int buttonState=0;

void setup()

{
12
pinMode(11, OUTPUT);
pinMode(4, INPUT);
}
void loop ()
{
// read the state of the pushbutton buttonState=digitalRead(4);

// check if pushbutton is pressed. if it is, the button state is HIGH


If (buttonState == HIGH) {
digitalWrite(11, HIGH);
}
else {
digitalWrite(11, LOW); //// Delay a little bit to improve simulation
performance
}

delay (5);
}

Run the Circuit after simulation push button Pressed:

13
EXERCISE:

(1) Compare both the result i.e., before & after the PUSH button pressed, check the result of LED.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

14
Experiment No: 4 Date: / /
TITLE: To interface Temp and Humidity module with Arduino Uno and note the result.
OBJECTIVES:
After studying this practical able to understand about use of Arduino UNO and use of Temperature
and Humidity Sensor and notify the results.

THEORY:
In this tutorial we will learn how to use a DHT11 Temperature and Humidity Sensor.
It’s accurate enough for most projects that need to keep track of humidity and temperature readings.
Again, we will be using a Library specifically designed for these sensors that will make our code short
and easy to write.

Components
- 1 * Arduino Uno board

- 1 * USB cable

- 1 * temp and humidity module

- DuPont wires (Female to Male)

15
#include <math.h>

doubleThermister(intRawADC)

{double Temp;

Temp = log(((10240000/RawADC) - 10000));

Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp)) * Temp);

Temp = Temp - 273.15; // Convert Kelvin to Celcius return Temp;

void setup ()

Serial.begin(9600);

void loop ()

Serial.print(Thermister(analogRead (0))); // display Fahrenheit


Serial.println("c");

delay (500);

16
}
EXERCISE:

(1) Measure the output with different Environment.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

17
Experiment No: 5 Date: / /
TITLE: To Perform Experiment using Arduino Uno to measure the distance of any object
using Ultrasonic Sensor.
OBJECTIVES:
After performing this practical able to understand about the use of Ultrasonic Sensor which can
be used for different purposes but as of now will use it to measure the distance of any object
and notice the result.

THEORY:

Circuit of Ultrasonic Sensor:

Code:
/
*
Ping))) Sensor
This sketch reads a PING))) ultrasonic rangefinder and returns the distance to the closest
object in range. To do this, it sends a pulse to the sensor to initiate a reading, and then listens
for a pulse to return. The length of the returning pulse is proportional to the distance of the
object from the sensor.
The circuit:
* +V connection of the PING))) attached to +5V
* GND connection attached to ground
* SIG connection attached to digital pin 7 */

18
int inches = 0;
int cm = 0;

long readUltrasonicDistance(int triggerPin, int echoPin)


{
pinMode(triggerPin, OUTPUT); // Clear the
trigger digitalWrite(triggerPin, LOW);
delayMicroseconds(2);
// Sets the trigger pin to HIGH state for 10
microsecondsdigitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin,
LOW);pinMode(echoPin,
INPUT);
// Reads the echo pin, and returns the sound wave travel time in microseconds
returnpulseIn(echoPin, HIGH);
}
void setup ()
{
Serial.begin(9600);
}
void loop ()
{
// measure the ping time in cm
cm = 0.01723 * readUltrasonicDistance(7, 7);
// convert to inches by dividing by 2.54

inches =(cm / 2.54); Serial.print(inches);


Serial.print("in, ");
Serial.print(cm);
Serial.println("cm");
delay (100); // Wait for 100 millisecond(s)

19
}

Run the circuit after simulation:


When value Outside the Shadow:

When value Low in the Shadow:

When value High in the Shadow:

20
EXERCISE:

(1) Compare the result as discussed in above diagrams and note the performance.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

21
Experiment No: 6 Date: / /
TITLE: To Perform Light Sensor (Photoresistor) using Arduino Uno.
OBJECTIVES:
Understand about Light sensor and implement it with Arduino Uno.
THEORY:
Circuit of Potentiometer:

Code:
int sensorValue = 0;
void setup ()
{
pinMode(A0, INPUT);
pinMode(13, OUTPUT);
}
void loop ()
{

22
sensorValue = analogRead(A0);

// turn the LED on


digitalWrite(13, HIGH);
// pause the program for <sensorValue> millseconds
delay(sensorValue); // Wait for sensorValue millisecond(s)
// turn the LED off
digitalWrite(13, LOW);
// pause the program for <sensorValue> millseconds
delay(sensorValue); // Wait for sensorValue millisecond(s)
}

Run the Circuit after Simulation:

When high Reading When Low Reading

23
Circuit of Photo register:

Code:
int sensorValue = 0;
void setup ()
{
pinMode(A0, INPUT);
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop ()
{
// read the value from the sensor
sensorValue = analogRead(A0);
// print the sensor reading so you know its range
Serial.println(sensorValue);
24
// map the sensor reading to a range for the LED
analogWrite(9, map(sensorValue, 0, 1023, 0, 255));
delay(100); // Wait for 100 millisecond(s)
}

Run the Circuit after Simulation:

When High Reading When LOW Reading

EXERCISE:
(1) Compare the Result after the Simulation.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

25
Experiment No: 7 Date: / /
TITLE: To Perform Flame Sensor using Arduino.

OBJECTIVES: Learn about the Flame sensor and how it notify the result when some
unwanted events going to occur.

THEORY:

Circuit:

Code:
#include <Adafruit_NeoPixel.h>
// To add the NeoPixel library, which opens up a new set of commands we for
controlling ourNeoPixel ring.
#define PIN 9
#define NUMPIXELS 24

int delayval = 50;

26
int currentColor = 0;
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB +
NEO_KHZ800);
void setup ()
{
pixels.begin(); // This initializes the
NeoPixel lib
pixels.setBrightness(100);
pixels.show();
}

void loop {
uint32_t red = pixels.Color(255, 0, 0); //red
uint32_t orange = pixels.Color(255, 100, 10); //orange
uint32_t yellow = pixels.Color(255, 255, 0); //yellow
uint32_t green = pixels.Color(0, 255, 0);//green
uint32_t dkgreen = pixels.Color(0, 115, 0);//dark green
uint32_t cyan = pixels.Color(0, 255, 255); //cyan
uint32_t blue = pixels.Color(0, 0, 255); //blue
uint32_t magenta = pixels.Color(255, 0, 255); //magenta
uint32_t purple = pixels.Color(50, 0, 50); //purple
//put the colors in an array
uint32_t colors [9] = {red, orange, yellow, green, dkgreen, cyan, blue, magenta, purple};

for (int i = 0; i < NUMPIXELS; i++) {


pixels.setPixelColor(i, colors[currentColor]);
delay(delayval);
pixels.show();
currentColor++;
if (currentColor >= 9)
currentColor = 0;
}
}
27
Run the Circuit after simulation

EXERCISE:

(1) Compare the result as per above criteria and notify the result.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

28
Experiment No: 8 Date: / /
TITLE: To Perform LASER module using Arduino.
OBJECTIVES: Learn about the LASER module and notify the result.
THEORY:

The laser diode works on the principle that every atom in its excited state can emit photons if electrons at higher
energy level are provided with an external source of energy. There are basically three phenomena by which an atom
can emit light energy and that are Absorption, Spontaneous Emission & Stimulated emission.

Components
- 1 * Arduino Uno board

- 1 * USB cable

- 1 * Laser module

- DuPont wires (Female to Male)

Principle
Experimental Procedures: -

Step 1: Connect circuit as shown in the following photo:

29
Step 2: Program

Step 3: Compile the program

Code:
void setup ()
{
pinMode(13, OUTPUT);
}

void loop () {
digitalWrite(13, HIGH);
delay (1000);
digitalWrite(13, LOW);
delay (1000);
}

Step 4: Run the program into Arduino Uno board

EXERCISE:

(1) Execute the code with different parameters and note the result.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

30
Experiment No: 9 Date: / /
TITLE: An Introduction to Raspberry Pi.
OBJECTIVES: Understand the need of Raspberry Pi and usage of it to implement the different application
based on IOT.
THEORY:

Introduction

Raspberry Pi is a series of low-cost single-board computers which comes with built-in features such as
WIFI and Bluetooth and some USB and HDMI ports. We can connect a display, USB keyboard and
mouse to the system.
These mini-computers are highly flexible in the areas where they can be used such as embedded system,
weather reports and small security system. It is highly recommended for beginners to explore this
excellent device to be able to do projects like WIFI Hacker, AD-Blocker and a working server that has
some practical relevance!!

This is Raspberry Pi 4 Model B:


The history of the Raspberry Pi was basically introduced in 2006. Its main concept is based on Atmel
ATmega644 which is particularly designed for educational use and intended for Python. A Raspberry Pi
is of small size i.e., of a credit card sized single board computer, which is developed in the United
Kingdom(U.K) by a foundation called Raspberry Pi. The main motto of this foundation is to promote the
teaching of basic computer science in the education institutes and also in developing countries. The first
generation of Raspberry (Pi 1) was released in the year 2012, that has two types of models namely model

31
A and model B.

Why Raspberry Pi?

The Raspberry Pi is a popular choice when developing IoT products. It offers a complete Linux server
with a tiny platform at an incredibly low price. Actually, the Raspberry Pi is so well-known to IoT that
the company has featured several Internet of Things projects on their site. Here you will find projects
and community support for a range of IoT activities. Take for example, the World’s First Cloud Texting
Enable d Espresso Machine – powered by Raspberry Pi.

Partnered with the Zipwhip cloud texting application, the Raspberry Pi connects to an espresso machine
and allows people to text a message to it that automatically turns it on and starts brewing beverages.

In the subsequent year A+ and B+ models were released. Again in 2015, Raspberry Pi2 model B was
released and a immediate year Raspberry Pi3 model B was released in the market.

Raspberry Pi can be plugged into a TV, computer monitor, and it uses a standard keyboard and mouse.
It is user friendly as can be handled by all the age groups. It does everything you would expect a desktop
computer to do like word-processing, browsing the internet spreadsheets, playing games to playing high-
definition videos. It is used in many applications like in a wide array of digital maker projects, music
machines, parent detectors to the weather station and tweeting birdhouses with infrared cameras.

All models feature on a broadcom system on a chip (SOC), which includes chip graphics processing unit
GPU (a Video Core IV), an ARM compatible and CPU. The CPU speed ranges from 700 MHz to
1.2 GHz for the Pi 3 and on-board memory range from 256 MB to 1 GB RAM. An operating system is
32
stored in the secured digital SD cards and program memory in either the MicroSDHC or SDHC sizes.
Most boards have one to four USB slots, composite video output, HDMI and a 3.5 mm phone jack for
audio. Some models have WiFi and Bluetooth.
The Raspberry Pi Foundation provides Arch Linux ARM and Debian distributions for download, and
promotes Python as the main programming language, with support for BBC BASIC, Java, C, Perl,Ruby,
PHP, Squeak Smalltalk, C++, etc.

The following are essential to get started


 Video cable to suit the TV or monitor used
 SD card containing Linux Operating system
 Power supply (see Section 1.6 below)
 USB keyboard
 TV or monitor (with DVI, HDMI, Composite or SCART input)

Recommended optional extras include


 Internet connection, Model B only: LAN (Ethernet) cable
 USB mouse
 Powered USB hub
 Internet connection, Model A or B: USB WiFi adaptor

IoT with Raspberry PI Applications


Smart_Health

33
Smart Home automation

IOT is transforming the way devices operate at home. Using IOT several home devices are automated and they
can interact among themselves and with humans. Sensors are often used for automation in home appliances.
Some home automation IOT projects for engineering students are automation using hand gestures, smart
garage door, facial recognition door, smart alarm clock and automated blinds.

Smart car Navigation

Industrial IoT

Automation has been extensively used in all the industries to reduce the manual errors in the production process.
Using IOT devices, industries will be able to control and monitor various equipment, machinery, processes and
other applications with less or no human intervention. Automation helps in reducing the errors and improving the
efficiency of production. Thus, many industries are trying to adapt IOT system into their operations. Some
industries also offer IOT training to their employees to get knowledge on how to handle IOT systems and
devices. Some of the industrial automation IOT projects for final year students are vehicle simulation, smart
parking system, smart building project, biometrics and smartsecurity model.

IOT can help to perform any desired action like controlling a device or monitoring from a remote location. This
technology makes equipment and machinery more digitized and connected. This technology is preferred even by
the government to achieve better energy efficiency, a cleaner city and higher productivity. A few IOT projects
for smart cities are baggage tracker, smart trash collector, smart energy meter reading and smart liquid level

34
monitoring.

EXERCISE:

(1) Compare the Arduino and Rapberry Pi


(2) Define the advantages and disadvantages of Raspberry Pi.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

35
Experiment No: 10 Date: / /
TITLE: An Installation of Raspberry Pi.
OBJECTIVES: Understand the installation and configuration of Raspberry Pi to implement the different
applications of IOT.
THEORY:
The procedure is divided into three sections as per the relevance of the project and need. The
subsections are as follows:
1. Installing Raspbian on Raspberry Pi 3
2. Using SSH(Secure Shell) remote access and VNC remote access
3. GPIO Programming

Prerequisites
Few prerequisites are:
1. A functional Raspberry Pi
2. A micro-SD card of 8 GB or more and a Card Reader
3. USB keyboard and mouse
4. A working computer
5. Stable power supply to power the machine
6. Internet

Installing Raspbian on Raspberry Pi 3

A step by step procedure of process which tells you how to get started with Raspberry Pi is in this Link:
https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up

1. Head over to below link to download the Full Version of Raspbian OS (This should be around 2.4
GB).
2. Download the ZIP file by clicking on Download ZIP to start the
download. https://www.raspberrypi.org/software/

Downloading the Raspberry Pi Imager


1. Head over to below given link to download the Raspberry Pi Imager as per your current
available system.
https://www.raspberrypi.org/software/

 Windows
 macOS
 Ubuntu
36
2. Install the Imager to your system.

Writing the Disk Image to SD Card


1. Insert SD card into your computer via a Card Reader.
2. Open Raspberry Pi Imager and select the SD card with CHOOSE SD CARD option. Select the SD
card from the menu appeared.
3. Go to CHOOSE OS option. Select Use Custom option. A dialog box will appear. Navigate to the
zipfile of NOOBS which was downloaded.
4. Click on WRITE option and let the procedure to finish.
5. When prompted as done, safely eject the SD card from the reader.

Powering up your Pi device


1. Attach the SD memory card to the USB slot of your Pi. Connect Pi to the laptop using the
Ethernetcable (RJ45 STRAIGHT).
2. (IMPORTANT)Follow these steps on your laptop/PC before powering ON your Pi.

OPEN CONTROL PANEL > NETWORK AND SHARING


GOTO YOUR CONNECTION (WIRELESS)
CLICK ON THE CONNECTION ICON AND GOTO PROPERTIES
CLICK ON SHARING.
CLICK TO ENABLE INTERNET CONNECTION SHARING (IMPORTANT).
CLICK OK.
1. Insert power adaptor and Ethernet cable to Raspberry Pi and Laptop. Power on the device. An
Unidentified Network should appear as Local Area Connection.
2. Connect the keyboard, mouse, and HDMI display if you want. Remember that the external
screenonly needed to run the Pi for the first time.
3. Click on it and select Properties and select Internet Protocol Version 4. Note the IP Address shown.
The IP settings, in general, are as follows.
IP Address: 192.168.43.1 (for wlan or WiFi)
Subnet Mask: 255.255.255.0
1. Download a network utility tool Advanced IP Scanner to find the exact IP of the Raspberry Pi.
2. Open Advanced IP Scanner and give the scan range as 192.168.43.1-254. Generally,
yourDevice should be listed as follows:
Name: raspberrypi
IP: 192.168.43.X {where X varies from system to system} Note down all the details.
1. Turn Off your Pi device and take out the SD card to plug it back to your computer to create a blank
fileto turn on SSH.
37
2. Note the drive letter of SD card on the computer. Open cmd and type the following command,
where Kis your drive letter. This enables SSH in your device on start-up.
echo>K:\ssh

Connecting SSH and VNC


1. Download and Install an open-source software called PuTTy from
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
and VNC Viewer from https://www.realvnc.com/en/connect/download/viewer/
NOTE: Download putty.exe file under Alternate Binary Files 64-bit or 32-bit and Standalone 64-
bit forVNC viewer.
2. Open PuTTy and follow the steps below
SELECT THE SSH OPTION FROM OPTIONS AND SET PORT TO 22

WRITE THE IP OF YOUR RASPBERRY PI WHICH WAS NOTED EARLIER


3. Click OK to connect to Raspberry Pi via SSH.
4. If prompted with login credentials, the default credentials are
Username: pi

Password: raspberry
5. Once you are connected to Raspberry Pi via SSH, follow the procedure below in shell. These
settings help you to connect to the device via SSH and VNC.
1. Type sudo raspi-config in shell
2. A menu will appear, goto Interfacing Options (Option Number 5)
3. Choose SSH and choose "Enable Option"
4. Choose VNC option and enable this as well.
5. Goto Finish.
6. Close Putty and open VNC viewer. Enter the IP address of Raspberry Pi in the top search
option andpress enter.
7. And you are done!

GPIO Programming

GPIO, or General-Purpose Input / Output, is a feature in most modern embedded computer

hardware and a crucial part of many embedded systems.

38
The most common functions of GPIO pins include:
 Being configurable in software to be input or output
 Being enabled or disabled
 Setting the value of digital output.
 Reading the value of digital output.
 Generating an interrupt when the input changes the value

These pins are used with digital data which is typically referred to as High voltage and Low voltage.

Various discrete levels of voltages cannot be used with these pins.

Please refer to https://www.ics.com/blog/introduction-gpio-programming article for more info on the


basics of GPIO Pins.

GPIO programming is usually done with Python using RPi.GPIO which can be installed via terminal.

39
sudo apt-get install python-dev
sudo apt-get install python-rpi.gpio

The best way to learn Raspberry Pi and IoT is via small projects and by having fun. We recommend you
to check out this https://projects.raspberrypi.org/en/projects?hardware%5B%5D=raspberry-pi
to browse some fabulous projects to start with. Choose any of them and have fun. (^_^)

Foot Note
For Linux and macOS, connecting is even easier. Just use Advanced IP Scanner/Nmap or any tool you
wish to scan for Raspberry Pi and use the following command.
ssh pi@<IP>
We also recommend you to check out https://elec-club-iitb.github.io/tutorials/r_pi/
article from Electronics Club IIT-B for some extra insights.
Raspberry Pi has a limitless scope with the projects and stuff you can do with it, ranging from Robotics
to Ethical Hacking. The purpose of this article is to get you started with Raspberry Pi so that you can
explore this fantastic little tool under the guidance of the Electronics Club.
EXERCISE:

(1) Installation of Raspberry Pi by yourself and complete the configuration to develop and deploy any
application.

EVALUATION:

Problem
Understanding Timely
Analysis & Mock Total
Level Completion
Solution (2) (10)
(3) (2)
(3)

Signature with date:

40

You might also like