Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
48 views35 pages

IOT LABORATORY Report (Final)

M.Tech IoT Lab Manual

Uploaded by

rashmi gs
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)
48 views35 pages

IOT LABORATORY Report (Final)

M.Tech IoT Lab Manual

Uploaded by

rashmi gs
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/ 35

IOT LABORATORY 2023-24

PROGRAM1:Transmit a stringusing UART

ComponentsRequired:
1. RaspberryPi3modelB
2. MicroSDcard8or16 GBwithRaspbianinstalled
3. WindowsPC/LinuxPCwithVNCviewertoremotelyoperateRaspberryiPi
4. PL2303PL2303HXUSBToTTL(Serial)ConverterModule –5Pin
5. JumperWires (Female toFemale)
HardwareConnections:
OnyourUSBtoTTLadapteryoushouldfindatleastfourconnections,somecircuitsdocomewith more
connections, but the only four you need is: VCC (IC Power-supply pin), TX (Transmitted
Data),RX(ReceivedData)andGND(Groundpower-supplypin)WiringyourUSBtoTTLadapter to your
Raspberry Pi is a simple process, with it requiring only 4 of the GPIO connecting to be
wiredtotheserialconnector,evenbetterall4GPIOpinsneededareinarow,soitiseasytofollow. Make use of our
table and guide below to connect your serial connector to your Raspberry Pi.
 VCCconnectstoPin 4.
 TXconnectstoPin8.
 RXconnectstoPin10.
 GNDconnectstoPin6.

DeptOfCSE,KVGCE,Sullia Page1
IOT LABORATORY 2023-24
Setting up the RaspberryPi for Seria lRead and Write:

1. CheckRPIisuptodatesudoapt-get updatesudoapt-get upgrade

2. NowthattheRaspberryPiisuptodatewecanmakeuseoftheraspi-configtool.Thistoolwill
allowustoeasilydisabletheserialinput/outputinterfacethatis enabledbydefaultsudoraspi- config

3. This command will load up the RaspberryPi configuration screen. This tool allows us to make quite a
numerous amount of different changes to the Raspberry Pi’s configuration, for now, though we are
only after one particular option. If you are after a more in-depth overview, you can check out our
raspi-config tool guide. Use the arrow keys to go down and select “5 Interfacing Options“. Once this
option has been selected, you can press Enter.

4. With the next screen you will want to use the arrow keys again to select “P6Serial“, pressEnter
Once highlighted to select this option
5. You will now be prompted as to whether you want the login shell to be accessible over serial, select
No with your arrow keys and press Enter to proceed.
6. ImmediatelyafteryouwillbeaskedifyouwanttomakeuseoftheSerialPortHardware,make sure that you
select Yes with your arrow keys and press Enter to proceed.
7. Once the Raspberry Pi has made the changes, you should see the following text appearon
your screen.
“TheserialloginshellisdisabledTheserialinterfaceisenabled“
Before these changes fully take effect, we must first restart the Raspberry Pi. To do this first get back to
the terminal by pressing Enter and then ESC. Type the following command into the terminal on the
Raspberry Pi to restart it. sudo reboot
UART COMMUNICATION:
UART stands for Universal Asynchronous Receiver/Transmitter It's not a communication protocol
like SPI and 12C, but a physical circuit in a microcontroller, or a stand- alone IC A UART's main purpose
is to transmit and receive serial data.
The UART that is going to transmit data receives the data from a data bus. The data bus is used to
send datato theUART by anotherdevice likeaCPU,memory,ormicrocontrollerData is transferred from the
data bus to the transmitting UART in parallel form. After the transmitting
UARTgetstheparalleldatafromthedatabus,itaddsastartbit,aparitybit,andastopbit.creating the data packet.
Next, the data packet is output serially, bit by bit at the Tx pin. The recerving UART reads the data packet
bit by bit at its Rx pin. The receiving UART then converts the data back into parallel form and removes
the start bit. parity bit and stop bits Finally, the Teceiving UART transfers the data packet in parallel to the
data bus on the receiving end.

DeptOfCSE,KVGCE,Sullia Page2
IOT LABORATORY 2023-24
Steps:
1. Typethe programin theArduinoIDE.
2. ConnecttheArduino boardwith CPUusing theUSB cable
3. Savethe program
4. InArduinoIDE,Tools Board->SelectArduino UNO
5. In Arduino IDE.Tools->Port->SelectportforArduinoUNO
6. Verify the program
7. Upload the program
8. Click on serial monitor (righthandsidecorner) for output.

Programs:
Code:
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println("HELLOWORLD");
}
delay(1000);

DeptOfCSE,KVGCE,Sullia Page3
IOT LABORATORY 2023-24

PROGRAM2:Point-to-PointcommunicationoftwoMotesovertheradio frequency.
ComponentsRequired:
1. RaspberryPi3modelB
2. MicroSDcard8or 16 GBwithRaspbian installed
3. WindowsPC/LinuxPCwithVNCviewertoremotelyoperateRaspberryiPi
4. 433MHZ TX/RXkit
5. JumperWires(FemaletoFemale)
Hardware Connections:

DeptOfCSE,KVGCE,Sullia Page4
IOT LABORATORY 2023-24
Dependencies:RPi.GPIO
Installation:OnyourRaspberryPi,installtherpi_rfmoduleviapip. Python 3:
#apt-getinstallpython3-pip #
pip3 install rpi-rf
NRF24L01TransceiverModule(RadioFrequency):
It uses the 2.4 GHz band and it can operate with baud rates from 250 kbps up to 2 Mbps. If used in
open space and with lower baud rate its range can reach up to 100 meters. The module can
use125differentchannelswhichgiveapossibilitytohaveanetworkof125independentlyworking modems in one
place. Each channel can have up to 6 addresses, or each unit can communicate with up to 6 other units at the
same time.
The power consumption of this module is just around 12mA during transmission. which is
evenlowerthanasingleLED.Theoperatingvoltageofthemoduleisfrom19to3.6V,butthegood
thingisthattheotherpinstolerate5Vlogic,sowecaneasilyconnectittoanArduinowithoutusing any logic level
converters
Three of these pins are for the SPIcommunication and they need to be connected to the SPI
pinsoftheArduino,butnotethateachArduinoboardhavedifferentSPIpinsThepinsCSNandCE
canbeconnectedtoany digitalpinoftheArduino boardand theyareused forsettingthemodulein
standbyoractivemode,aswellasforswitchingbetweentransmitorcommandmode.Thelastpinis an interrupt pin
which doesn’t have to be used.

ArduinoUnoandNRF24L01connection(sameconnectionfortransmitterandreceiver): Arduino
NRF24L01
VCC 3.3V
GND GND
Pin8 CSN
Pin7 CE
Pin13 SCK
Pin11 MOSI
Pin12 MISO

DeptOfCSE,KVGCE,Sullia Page5
IOT LABORATORY 2023-24
LED connection: positive (long wire of LED) to pin 2ofArduino Uno and negative to GND

Steps:
1. ImportRF24Network-master.ziptoArduinoIDEviaSketch->IncludeLibrary->ADDZiplibrary
2. ImportRF24-master.ziptoArduino IDEviaSketch->Include Library-> ADDZip library
3. TypethetransmittercodeinArduinoIDEandselectboardandportforfirstArduinouno.Upload the code to
transmitter Arduino (first Arduino).
4. TypethereceivercodeinanotherArduinoIDEandselectboardandportforsecondArduinouno. Upload the code
to receiver Arduino (second Arduino).
5. Ifdatasentin the code is'I'thenLEDinreceiver willbeONotherwiseLEDwillbeOFF.

DeptOfCSE,KVGCE,Sullia Page6
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page7
IOT LABORATORY 2023-24
PROGRAM 3:MultiPoint communication of two motes over the radio frequency
Components Required:
1. RaspberryPi3modelB
2. MicroSDcard8or16 GBwithRaspbianinstalled
3. WindowsPC/LinuxPCwithVNCviewertoremotelyoperateRaspberryiPi
4. 433MHZ TX/RXkit
5. JumperWires (Female toFemale)

DeptOfCSE,KVGCE,Sullia Page8
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page9
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page10
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page11
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page12
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page13
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page14
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page15
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page16
IOT LABORATORY 2023-24

PROGRAM 4: I2C Protocol Study.

DeptOfCSE,KVGCE,Sullia Page17
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page18
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page19
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page20
IOT LABORATORY 2023-24

DeptOfCSE,KVGCE,Sullia Page21
IOT LABORATORY 2023-24
PROGRAM 5: Reading Temperature and Relative Humidity value from the
sensor.

Aim: To read temperature and relative humidity values from the Dht11 sensor connected to Arduino uno
board.

Hardware requirement: Arduino uno board, Bread board, Dht11 sensor, Usb A to B cable and jumper wires

Software requirement:Windows: Win 10 (64-bit) or newer and Arduino ide.

IOT:The Internet of things (IOT) is the interconnection of uniquely identifiable embedded computing device
within the existing internet infrastructure. The internet of things connects devices and vehicles using electronic
sensors and the internet.

Arduino: Arduino is an open-source platform used for building electronics projects. Arduino consists of both
a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE
(Integrated Development Environment) that runs on your computer, used to write and upload computer code to
the physical board.

Arduino is an 8-bit microcontroller development board with a USB programming interface to connect to a
computer and additional sockets to external electronics like sensors, motors speakers’ diodes etc.

Dht11 sensor: The DHT11 humidity and temperature sensor makes it really easy to add humidity and
temperature data. It’s perfect for remote weather stations, home environmental control systems, and farm or
garden monitoring systems.

The DHT11 detects water vapor by measuring the electrical resistance between two electrodes. The humidity
sensing component is a moisture holding substrate with electrodes applied to the surface. When water vapor is
absorbed by the substrate, ions are released by the substrate which increases the conductivity between the
electrodes. The change in resistance between the two electrodes is proportional to the relative humidity. Higher
relative humidity decreases the resistance between the electrodes, while lower relative humidity increases the
resistance between the electrodes.

Arduino Installation

Step 1:Download Arduino from https://www.arduino.cc

Step 2: Launch Arduino IDE.

Step 3:After Arduino IDE software is downloaded, we need to unzip the folder. Inside the folder, we can find
the application icon with an infinity label (application.exe). Doubleclick the icon to start the IDE.

Step 4:Open your first project.


Once the software starts, you have two options –
• Create a new project.
• Open an existing project example. To create a new project, select File → New

Step 5:Select Arduino board.


 Go to Tools → Board and select the board.
DeptOfCSE,KVGCE,Sullia Page22
IOT LABORATORY 2023-24
Step 6: Select your serial port.
 Select the serial device of the Arduino board.
 Go to Tools → Serial Port menu. This is likely to be COM3 or higher (COM1 and COM2 are usually
reserved for hardware serial ports).

Step 7− Upload the program to your board.


 Click the "Upload" button in the environment.
 Open the serial monitor and you will get temperature and relative humidity values from the sensor.
CODE:

#include dht.h
dht DHT;
#define DHT11_PIN 7
void setup(){
Serial.begin(9600);
}
void loop()
{
int chk = DHT. read11(DHT11_PIN);
Serial.print("Temperature = ");
Serial.println(DHT.temperature);
Serial.print("Humidity = ");
Serial.println(DHT.humidity);
delay(1000):
}

DeptOfCSE,KVGCE,Sullia Page23
IOT LABORATORY 2023-24
PROGRAM 6: Study of Connectivity and configuration of Raspberry-Pi /Beagle
board/Arduino circuit with basic peripherals like LEDS. Understanding GPIO
and its use in the program.
Aim:
Study of Connectivity and configuration of Raspberry-Pi /Beagle board/Arduino circuit with basic
peripherals like LEDS. Understanding GPIO and its use in the program.

Hardware Requirement: Raspberry-Pi /Beagle board/Arduino, LED, Raspberry Pi , Ethernet Cable , Laptop/
PC , SD Card with Raspbian , Micro USB Cable

Connect a Raspberry-Pi to the Laptop or PC Display:

To connect a Raspberry Pi to a laptop or PC display, you can simply use an Ethernet cable. The Raspberry Pi’s
desktop GUI can be viewed through the laptop or PC display using a 100mbps Ethernet connection between
the two
We used VNC server software to connect the Raspberry-Pi to our laptop or PC. Installing the VNC server on
your Raspberry-Pi allows you to see the Raspberry Pi’s desktop remotely.

 Setting up your Raspberry Pi


 Install Raspbian OS on blank SD card.
 Insert this SD card into Raspberry-Pi board.
 Connect micro USB cable to power the Raspberry-Pi
 Sharing Internet Over Ethernet in Window OS

This step explains how you can share your laptop or PC with the Raspberry Pi via Ethernet cable.

 To share internet with multiple users over Ethernet, go to Network and Sharing Center.
 Then click on the WiFi network
 Double click on Wireless area connection
 Click on Properties (shown below)

DeptOfCSE,KVGCE,Sullia Page24
IOT LABORATORY 2023-24

Go to “Sharing” tab and click on “Allow other network users to connect”.

After this, make sure that the networking connection is changed to “Local Area Connection” Now, to check
the IP assigned to the network established, click on the new local area connection link created:

DeptOfCSE,KVGCE,Sullia Page25
IOT LABORATORY 2023-24
 Now open command prompt.
 Ping the broadcast address of your IP. (Type) E.g. : ping 192.168.137.1
 Stop the ping after 5 seconds.
 To get the IP address of Raspberry Pi in the established network, use the Software “Advance IP
Scanner”. It is free software

Setting up the VNC Server to Connect Your Raspberry Pi to the Laptop or PC Display :

First install VNC server and Putty on your laptop/ PC


Open Putty Software, and enter login ID: pi and Password: raspberry.

After that, enter commands into Putty i.e,


$ sudo apt-get update
$ sudo apt-get install tightvncserver
$ vncserver :1
You will be prompted to enter and confirm a password.
This will be asked only once, during first time setup.
Enter an 8 digit password.
Note that this is the password you will need to use to connect to your Raspberry Pi remotely.
Setting Up the Client Side (Laptop or PC)
Download VNC client and install it.
When you first run VNC viewer, you will see following screen

Enter the IP address of your Raspberry Pi given dynamically by your laptop and append with : (denoting port
number) and press connect. You will get a warning message, press ‘Continue’:

Enter the 8 digit password which was entered in the VNC server installation on your Raspberry Pi:

DeptOfCSE,KVGCE,Sullia Page26
IOT LABORATORY 2023-24

Finally, the Raspberry Pi desktop should appear as a VNC window. You will be able to access the GUI and do
everything as if you are using the Pi’s keyboard, mouse, and monitor directly.

Raspberry-Pi setup using mouse, keyboard and monitor

 To work with Raspberry-Pi, we have to connect some peripherals to it. They are as follows :
 A monitor with power cable and data cable
 A micro USB power supply
 A wired keyboard and mouse, or a wireless keyboard and mouse
 A micro SD card
 Monitors - HDMI

There are several different types of monitor that you can use with the Raspberry Pi:

Most modern television sets and monitors have an HDMI port, and are the easiest to get working with the
Raspberry Pi. You can use an HDMI cable to connect the Raspberry Pi directly to the television or monitor.
VGA. Some old monitors have a VGA port. These can be trickier to use as you'll need an HDMI-to-VGA
converter, which can change digital video to analogue video. A simple port adapter won't work.

DeptOfCSE,KVGCE,Sullia Page27
IOT LABORATORY 2023-24

 Power supplies For Raspberry Pi 3, it's recommended to use a 5V, 2.5A power supply.
 Mobile device charger
 Many mobile devices are powered using a 5V micro USB charger.
 These can often be used to power the Raspberry Pi, although it's worth checking that they provide
sufficient voltage and current (5V / 1.2 - 2.5A).

 Keyboard and mouse


 Wired keyboard and mouse
 Any standard USB keyboard and mouse can be used with the Raspberry Pi. These plug and play
devices will work without any additional driver. Simply plug them into the Raspberry Pi and they
should be recognized when it starts up.
 Bluetooth keyboard and mouse
 Bluetooth keyboards and mice can work with the Raspberry Pi, but your success rates will vary
depending on the model and manufacturer. It's best to consult the manufacturer's documentation to see
whether or not a device is compatible with the Raspberry Pi.
 SD cards

Understanding GPIO pins on Raspberry Pi board and its use in program

Aim/Objectives: To understand the GPIO pins of Raspberry-Pi 3 To program the GPIO pins of Raspberry-Pi
3 using Python
Introduction: Raspberry Pi 3 Model B is the latest version of raspberry pi board.
It is released on 29 February.
The above figure shows the Raspberry Pi 3 Model B and It’s GPIO pins General-purpose input/output (GPIO)
is a generic pin on an integrated circuit or computer board whose behavior—including whether it is an input or
output pin—is controllable by the user at run time.

DeptOfCSE,KVGCE,Sullia Page28
IOT LABORATORY 2023-24
 There are 40 pins available on board of Raspberry pi 3 model B.
 The Pins are arranged in a 2×20 fashion as shown in the figure above
 Out of these, 26 pins are GPIO pins
 As you can observe, the numbers to the pins are given in zigzag manner

 The first (bottom) row starts with number ‘1’. So the pins in this row have odd numbers i.e. from 1 to
39.
 The 2nd (Top) row starts with number ‘2’.
 So the pins in this row have even numbers i.e. from 2 to 40.
 Out of 40 pins, 26 pins are GPIO pins,8 pins are Ground (GND) pins,2 pins are 5V power supply pins
2 pins are 3.3V power supply pins, 2 pins are not used
 Now if you’re coming to the Raspberry Pi as an Arduino user, you’re probably used to referencing
pins with a single, unique number.
 In Raspberry Pi there are two different numbering schemes for referencing Pi pin numbers:
 Broadcom chip-specific pin numbers (BCM)
 Physical pin numbers (BOARD)
 You’re free to use either number-system.
 The programs require that you declare which scheme you’re using at the very beginning of your
program.
 In a program, at a time, you can use only one number scheme.
 Broadcom chip-specific pin numbers (BCM)
 BCM - Broadcom pin number, commonly called "GPIO", these are the ones you probably want to use
with RPi.GPIO
 The parameter used for this system is (GPIO.BCM).
 This is a lower level way of working - it refers to the channel numbers on the Broadcom SOC.
 To use this system, you have to always work with a diagram describing which channel number goes to
which pin on the RPi board.
 Your script could break between revisions of Raspberry Pi boards

In this system 26 GPIO pins are named as GPIO 01 to GPIO 26


 Physical Numbering System (BOARD)
 This system uses physical - Numbers corresponding to the pin's physical location on the header
 The numbers printed on the board are physical numbering system.
 The parameter used for this system is (GPIO.BOARD).
 The advantage of using this numbering system is that your hardware will always work, regardless of
the board revision of the RPi.
 You will not need to rewire your connector or change your code.
 In this system
 26 GPIO pins are named between 0 to 40

The below table summarizes the pinout of Raspberry-Pi in both the number systems.

DeptOfCSE,KVGCE,Sullia Page29
IOT LABORATORY 2023-24

The Python IDLE shell and command line To use the Python IDLE IDE for programming in Raspberry-Pi use
the following
Open Python 3 from the main menu:

Or open terminal window and type the command sudo idle 3.5 and press enter Install all libraries required for
Buzzer as given above.

Write the program as per algorithm given below


 Save with Ctrl + S and run with F5.
 See output on Python Shell or Terminal Window.
 Raspberry Pi GPIO programming using Python
 The Raspberry Pi is often used in conjunction with other hardware to create interesting electronic
projects.
 The Pi 3 comes with 40 GPIO pins that you can use to interface with various hardware devices— for
both receiving data from them or for writing data to them.
 To do this, we have to program the GPIO pins.
 To do this, special libraries in Python are used. To include these libraries in the program, the command
used is ‘import’
 This way, we can write applications to both read and also to control devices, i.e., turn them on and off,
etc. The default operating system used in Raspberry-Pi is Raspbian.
 The Python package used for Raspberry Pi GPIO programming is RPi.GPIO. It is already installed in
Raspbian.
 If you are using any other operating system, the package can be installed by using the following
command:
 $ sudo pip install RPi.GPIO

DeptOfCSE,KVGCE,Sullia Page30
IOT LABORATORY 2023-24
There are important 8 steps in the programming of Raspberry-Pi using Python as follows:

 Import the RPi.GPIO library using the following command import RPi.GPIO as GPIO
 Import the Time library using the following command
 import time
 Set numbering scheme to be used. The method used for this is GPIO.setmode(). We will use physical
number scheme. So the method is written as
 GPIO.setmode(GPIO.BOAD)
 Set the pin mode as INPUT or OUTPUT using the commands GPIO.setup(channel, GPIO.IN)
GPIO.setup(channel, GPIO.OUT)
 Read input using following command
 GPIO.input(pin no)
 Write output using following comman
 GPIO.output(pin no, state)
 Give delay using command using following command time.sleep(1) # delay for 1 second ⮚ Clean up
GPIO and exit using following commands GPIO.cleanup()
 print(“Exiting...”)
 You must clean up the pin set-ups before your program exits otherwise those pin settings will persist,
and that might cause trouble when you use the same pins in another program.
 The Pi ‘expresses its displeasure’ with a warning.
 To clean up the entire set of pins, invoke GPIO.cleanup().
 If you want only a few pins to be cleaned up, then the pin numbers should be provided as
GPIO.cleanup (channel_list).
 Anyway, you can suppress the warning messages by calling GPIO.setwarnings (False).
 Save the program with proper name. The file is saved with extension ‘.py’.
 The IDE named ‘IDLE’ used for programming is an interpreter and not a compiler. So to run the
python program, we need to give the super user permission as follows.

Studying Connectivity and Configuration of Raspberry Pi board with basic peripherals (LEDs)
Aim/Objectives: To understand the concept of Led bar
To understand the common anode & common cathode configuration.
To interface LED bar with Raspberry Pi.
Generate various patterns on LED bar.

Software: Raspbian OS , IDLE editor Hardware Modules: Raspberry Pi Board, LED bar, Monitor

Introduction to “LED”:

LED is a Light Emitting Diode. Light emitting diode is a two lead semiconductor light source. It is a p-n
junction diode, which emits light when it is activated. When a suitable voltage is applied to the leads, electrons
are able to recombine with electron holes within the device, and the color of light (corresponding to the energy
of photon) is determined by the energy band gap of the semiconductor. It has two terminals named as ‘anode
(+ve)’ and ‘cathode (-ve)’. Battery is connected to these two terminals. When LED is forward biased, it emits
light. In LED bar number of LEDs are connected in series (in our case 8 LEDs are connected) LED bar has
two configurations as Common Anode: In this, anode terminal of all the LEDs are made common and
connected to the VCC (+5v). By controlling cathode terminal we can make LED ON or OFF (current
sourcing). Common Cathode: In this, cathode terminal of all the LEDs are made common and connected to the
Ground (0v). By controlling anode terminal we can make LED ON or OFF (current sinking).
DeptOfCSE,KVGCE,Sullia Page31
IOT LABORATORY 2023-24

Steps for assembling circuit:


Connect led bar module pins from D0- D3 to Raspberry Pi GPIO pins 7, 11, 13, 15 respectively.
Connect led bar module pin COM to the GND pin of Raspberry-Pi module.

Procedure:

Write the program as per the algorithm given below.


 Save program.
 Run code using Run module.
 Algorithm:
 Import GPIO and Time library
 Set mode i.e. GPIO.BOARD
 Set GPIO 8 pins as a Output pin
 Print message “ON”
 After 1 second time delay, Make all the leds ON one by one
 Print message “OFF”
 After 1 second time delay, Make all the leds
 OFF one by one

DeptOfCSE,KVGCE,Sullia Page32
IOT LABORATORY 2023-24
PROGRAM 7: Study of different operating systems for Raspberry Pi / Beagle
board. Understanding the process of OS installation on Raspberry – Pi/ Beagle
board

AIM:
To study the pr ocess of OS Installation on Raspberry Pi Board

Introduction to Raspberry Pi:


Raspberry Pi is a small single board computer developed by Raspberry Pi Foundation in the
United Kingdom. It is a credit sized computer that is power ful enough to be used as a desktop
computer or to control robots, build proje cts and much mor e. It is power ed by an ARM
Processor, which means it is capable of running a variety of operating systems.

Hardware Requirement:
1. Raspberry Pi Board
2. Micr o SD Card with Card Reader
3. IO Per ipheral Devices: Keyboard, mouse, HDMI Cable, Ether net Cable, USB Cable
4. PC with inter net connection

Software Requirement:
1. Raspberry Imager: A fr ee utility for flashing contents into SD cards.
2. Inter net: It is used to download the imager file.

Raspberry Pi Imager is an application which helps users to install differ ent operating system
into an SD card. Once the operating system is installed onto the SD card, we can put the SD
card into our raspberry pi to boot it and wor k on it.

1. Download the latest version of Raspberry Pi Imager installer for your Operating
System

1. Run the installer and follow the prompts to complete the setup.
2. Launch the Raspberry Pi Imager executable(exe) from the windows start menu.
3. Click Choose OS and choose Raspberry Pi OS.

DeptOfCSE,KVGCE,Sullia Page33
IOT LABORATORY 2023-24

4. Click Choose SD card. Click on Choose Storage button on the Imager application
That will show you a list of connected micr o SD cards or USB storage devices.
Select SD Card.
5. Click Write to begin the image writing process.

6. After writing process is complete, the Raspberry Pi OS image will be verified.

Conclusion:
Overall installing Raspberry PI OS on a Raspberry Pi Single Board computer is a gr eat starting
point for anyone who wants to explor e the possibilities of DIY computing.It is an open -source
and has fr ee availability. Users can access to the source code and make improvements to it. All
in all, Installing it is an excellent choice for anyone looking to explor e the unique projects
using their Raspberry Pi device.

DeptOfCSE,KVGCE,Sullia Page34
IOT LABORATORY 2023-24
PROGRAM 8 : Familiarization with the concept of IOT, Arduino/Raspberry Pi
and perform necessary software Installation.

Aim: To study IOT, their charactersictics of components and basic awareness of Arduino/raspberry pi.

Hardware Requirement:Arduino basic kit, USB A-to-B cable

Software Requirement:Windows: Win 10(64-bit) or newer.

IOT: The Internet of things(IOT) is the interconnection of uniquely identifiable embedded computing
devicewithin the existing internet infrastructure. The internet of things connects devices and vehicles using
electronic sensors and the internet.

Arduino:Arduino is an open-source platform used for building electronics projects. Arduino consists of a
botha physical programmable circuit board (often refferedto as a microcontroller) and a piece of software, or
IDE (Integrated Devolopment Environment) that runs on your computer, used to write and upload computer
code to the physical board.

Arduino is an 8-bit-microcontroller development board with a USB programming interface to connect to a


computer and additional sockets to external electronics like sensors, motors speakers’ diodes etc.

Arduino Installation

Step 1: Download Arduino from https://www.arduino.cc


Step 2: Launch Arduino IDE
Step 3: After Arduino IDE software is downloaded, we need to unzip the folder.
Inside the folder, we can find the application icon with an infinity label (application.exe). Double click
the Icon to start the IDE.
Step 4: Open your first project.
Once the software starts, you have two options –
 Create a new project.
 Open an existing project example. To create a new project , select file → New
Step 5: Select Arduino board
 Go to Tools →Board and select the board.
Step 6: Select your serial port.
 Select the serial device of the Arduino board.
 Go to Tools→Serial Port menu. This is likely to be COM3 or higher
(COM1 and COM2 are usually reserved for hardware serial ports).
Step 7: Upload the program to your board.
 Click the “Upload” button in the environment.
 Wait a few second, will see the RX and TX LEDs on the board, flashing.
If the upload is successful, the message “Done uploading” will appear in the status bar.

DeptOfCSE,KVGCE,Sullia Page35

You might also like