Unit 4 Iot
Unit 4 Iot
In the context of the Internet of Things (IoT), a communication model describes the various ways in which IoT devices
communicate with each other, with gateways, and with cloud services. These models define the architecture and methods
used for data transmission, ensuring efficient and reliable communication across the IoT ecosystem.
● The client, when required, requests the information from the server. This request is usually in the encoded format.
● This model is stateless since the data between the requests is not retained and each request is independently
handled.
● The server Categories the request, and fetches the data from the database and its resource representation. This
data is converted to response and is transferred in an encoded format to the client. The client, in turn, receives the
response.
● On the other hand — In Request-Response communication model client sends a request to the server and the
server responds to the request. When the server receives the request it decides how to respond, fetches the data
retrieves resources, and prepares the response, and sends it to the client.
2. Publisher-Subscriber Model –
This model comprises three entities: Publishers, Brokers, and Consumers.
● Publishers are the source of data. It sends the data to the topic which are managed by the broker. They are not
aware of consumers.
● Consumers subscribe to the topics which are managed by the broker.
● Hence, Brokers responsibility is to accept data from publishers and send it to the appropriate consumers. The
broker only has the information regarding the consumer to which a particular topic belongs to which the publisher
is unaware of.
3. Push-Pull Model –
The push-pull model constitutes data publishers, data consumers, and data queues.
4. Exclusive Pair –
● Exclusive Pair is the bi-directional model, including full-duplex communication among client and server. The
connection is constant and remains open till the client sends a request to close the connection.
● The Server has the record of all the connections which has been opened.
● This is a state-full connection model and the server is aware of all open connections.
● WebSocket based communication API is fully based on this model.
IoT Communication APIs
Generally we used Two APIs For IoT Communication. These IoT Communication APIs are:
Representational state transfer (REST) is a set of architectural principles by which you can design Web services the Web APIs
that focus on systems’s resources and how resource states are addressed and transferred. REST APIs that follow the request
response communication model, the rest architectural constraint apply to the components, connector and data elements,
within a distributed hypermedia system. The rest architectural constraint are as follows:
Client-server – The principle behind the client-server constraint is the separation of concerns. for example clients should not
be concerned with the storage of data which is concern of the serve. Similarly the server should not be concerned about the
user interface, which is concern of the clien. Separation allows client and server to be independently developed and updated.
Stateless – Each request from client to server must contain all the information necessary to understand the request, and
cannot take advantage of any stored context on the server. The session state is kept entirely on the client.
Cache-able – Cache constraints requires that the data within a response to a request be implicitly or explicitly leveled as
cache-able or non cache-able. If a response is cache-able, then a client cache is given the right to reuse that repsonse data for
later, equivalent requests. caching can partially or completely eliminate some instructions and improve efficiency and
scalability.
Layered system – layered system constraints, constrains the behavior of components such that each component cannot see
beyond the immediate layer with they are interacting. For example, the client cannot tell whether it is connected directly to the
end server or two an intermediaryalong the way. System scalability can be improved by allowing intermediaries to respond to
requests instead of the end server, without the client having to do anything different.
Uniform interface – uniform interface constraints requires that the method of communication between client and server must
be uniform. Resources are identified in the requests (by URIsin web based systems) and are themselves is separate from the
representations of the resources data returned to the client. When a client holds a representation of resources it has all the
information required to update or delete the resource you (provided the client has required permissions). Each message
includes enough information to describe how to process the message.
Code on demand – Servers can provide executable code or scripts for clients to execute in their context. this constraint is the
only one that is optional.
A RESTful web service is a ” Web API ” implemented using HTTP and REST principles. REST is most popular IoT
Communication APIs.
Create a
new entry
in the
List the Replace collection.
URIs and the The new
perhaps entire entry’s
Not
Collection, such as other collectio URI is Delete the entire
general
https://api.example.com/resources/ details of n with assigned collection.
ly used
the another automatic
collection’s collectio ally and is
members. n. usually
returned
by the
operation.
Websocket APIs allow bi-directional, full duplex communication between clients and servers. Websocket APIs follow the
exclusive pair communication model. Unlike request-response model such as REST, the WebSocket APIs allow full duplex
communication and do not require new coonection to be setup for each message to be sent. Websocket communication
begins with a connection setup request sent by the client to the server. The request (called websocket handshake) is sent over
HTTP and the server interprets it is an upgrade request. If the server supports websocket protocol, the server responds to the
websocket handshake response. After the connection setup client and server can send data/mesages to each other in full
duplex mode. Websocket API reduce the network traffic and letency as there is no overhead for connection setup and
termination requests for each message. Websocket suitable for IoT applications that have low latency or high throughput
requirements. So Web socket is most suitable IoT Communication APIs for IoT System.
IoT communication protocols are the rules and standards that enable devices in an IoT ecosystem to communicate with each
other, gateways, and cloud services. These protocols ensure reliable and efficient data transmission across diverse
environments and use cases.
One of the main pillars of IoT is its connectivity. It consists of a huge network of elements, both objects and people of different
sizes and shapes, which are connected to gather and share information. In general, the information is gathered and used to
automate or help make decisions. Due to the variety of data types and applications, different communication and network
protocols are needed.
BLUETOOTH
What is Bluetooth?
Bluetooth simply follows the principle of transmitting and receiving data using radio waves. It can be paired with the other
device which has also Bluetooth but it should be within the estimated communication range to connect. When two devices start
to share data, they form a network called piconet which can further accommodate more than five devices.
Architecture of Bluetooth
The architecture of Bluetooth defines two types of networks:
Piconet: Piconet is a type of Bluetooth network that contains one primary node called the master node and seven active
secondary nodes called slave nodes. Thus, we can say that there is a total of 8 active nodes which are present at a distance of
10 meters. The communication between the primary and secondary nodes can be one-to-one or one-to-many. Possible
communication is only between the master and slave; Slave-slave communication is not possible. It also has 255 parked
nodes, these are secondary nodes and cannot take participation in communication unless it gets converted to the active state.
Bluetooth Architecture
Scatternet: It is formed by using various piconets. A slave that is present in one piconet can act as master or we can say
primary in another piconet. This kind of node can receive a message from a master in one piconet and deliver the message to
its slave in the other piconet where it is acting as a master. This type of node is referred to as a bridge node. A station cannot
be mastered in two piconets.
Bluetooth Protocol Stack
1. Radio (RF) layer: It specifies the details of the air interface, including frequency, the use of frequency hopping and
transmit power. It performs modulation/demodulation of the data into RF signals. It defines the physical
characteristics of Bluetooth transceivers. It defines two types of physical links: connection-less and
connection-oriented.
2. Baseband Link layer: The baseband is the digital engine of a Bluetooth system and is equivalent to the MAC
sublayer in LANs. It performs the connection establishment within a piconet, addressing, packet format, timing
and power control.
3. Link Manager protocol layer: It performs the management of the already established links which includes
authentication and encryption processes. It is responsible for creating the links, monitoring their health, and
terminating them gracefully upon command or failure.
4. Logical Link Control and Adaption (L2CAP) Protocol layer: It is also known as the heart of the Bluetooth
protocol stack. It allows the communication between upper and lower layers of the Bluetooth protocol stack. It
packages the data packets received from upper layers into the form expected by lower layers. It also performs
segmentation and multiplexing.
5. Service Discovery Protocol (SDP) layer: It is short for Service Discovery Protocol. It allows discovering the
interface with WAP and OBEX. It also provides emulation of serial ports over the logical link control and adaption
protocol(L2CAP). The protocol is based on the ETSI standard TS 07.10.
7. OBEX: It is short for Object Exchange. It is a communication protocol to exchange objects between 2 devices.
8. WAP: It is short for Wireless Access Protocol. It is used for internet access.
9. TCS: It is short for Telephony Control Protocol. It provides telephony service. The basic function of this layer is call
control (setup & release) and group management for the gateway serving multiple devices.
10. Application layer: It enables the user to interact with the application.
Types of Bluetooth
Various types of Bluetooth are available in the market nowadays. Let us look at them.
● In-Car Headset: One can make calls from the car speaker system without the use of mobile phones.
● Stereo Headset: To listen to music in car or in music players at home.
● Webcam: One can link the camera with the help of Bluetooth with their laptop or phone.
● Bluetooth-equipped Printer: The printer can be used when connected via Bluetooth with mobile phone or laptop.
● Bluetooth Global Positioning System (GPS): To use Global Positioning System (GPS) in cars, one can connect
their phone with car system via Bluetooth to fetch the directions of the address.
Advantages of Bluetooth
● It is a low-cost and easy-to-use device.
● It can also penetrate through walls.
● It creates an Ad-hoc connection immediately without any wires.
● It is used for voice and data transfer.
Disadvantages of Bluetooth
● It can be hacked and hence, less secure.
● It has a slow data transfer rate of 3 Mbps.
● Bluetooth communication does not support routing.
Applications of Bluetooth
● It can be used in wireless headsets, wireless PANs, and LANs.
● It can connect a digital camera wireless to a mobile phone.
● It can transfer data in terms of videos, songs, photographs, or files from one cell phone to another cell phone or
computer.
● It is used in the sectors of Medical healthcare, sports and fitness, Military.
Wi-Fi
Wi-Fi is a wireless networking technology, by which we can access networks or connect with other computers or mobile using a
wireless medium. In Wi-Fi, data are transferred over radio frequencies in a circular range.
Wi-Fi, a brand name given by the Wi-Fi Alliance (formerly Wireless Ethernet Compatibility Alliance), is a generic term that
refers to the communication standard for the wireless network which works as a Local Area Network to operate without using
the cable and any types of wiring. It is known as WLAN. The communication standard is IEEE 802.11. Wi-Fi works using
Physical Data Link Layer.
Applications of Wi-Fi :
Wi-Fi has many applications, it is used in all the sectors where a computer or any digital media is used, also for entertaining
Wi-Fi is used. Some of the applications are mentioned below –
● Accessing Internet: Using Wi-Fi we can access the internet in any Wi-Fi-capable device wirelessly.
● We can stream or cast audio or video wirelessly on any device using Wi-Fi for our entertainment.
● We can share files, data, etc between two or more computers or mobile phones using Wi-Fi, and the speed of the
data transfer rate is also very high. Also, we can print any document using a Wi-Fi printer, this is very much used
nowadays.
● We can use Wi-Fi as HOTSPOTS also, it points Wireless Internet access for a particular range of area. Using
Hotspot the owner of the main network connection can offer temporary network access to Wi-Fi-capable devices
so that the users can use the network without knowing anything about the main network connection. Wi-Fi
adapters are mainly spreading radio signals using the owner network connection to provide a hotspot.
● Using Wi-Fi or WLAN we can construct simple wireless connections from one point to another, known as Point to
point networks. This can be useful to connect two locations that are difficult to reach by wire, such as two buildings
of corporate business.
● One more important application is VoWi-Fi, which is known as voice-over Wi-Fi. Some years ago telecom
companies are introduced VoLTE (Voice over Long-Term Evolution ). Nowadays they are introduced to VoWi-Fi, by
which we can call anyone by using our home Wi-Fi network, only one thing is that the mobile needs to connect
with the Wi-Fi. Then the voice is transferred using the Wi-Fi network instead of using the mobile SIM network, so
the call quality is very good. Many mobile phones are already getting the support of VoWi-Fi.
● Wi-Fi in offices: In an office, all the computers are interconnected using Wi-Fi. For Wi-Fi, there are no wiring
complexities. Also, the speed of the network is good. For Wi-Fi, a project can be presented to all the members at a
time in the form of an excel sheet, ppt, etc. For Wi-Fi, there is no network loss as in cable due to cable break.
Types of Wi-Fi:
Year of
Standards Description
Release
This version has a link speed from 2Mb/s to 11 Mb/s over a 2.4 GHz
Wi-Fi-1 (802.11b) 1999
frequency band
In this version the speed was increased up to 54 to 108 Mb/s over 2.4
Wi-Fi-3 (802.11g) 2003
GHz
This is the same as 802.11g but only the security mechanism was
802.11i 2004
increased in this version
This is also the same as 802.11g, only Voice over Wireless LAN and
802.11e 2004
multimedia streaming are involved
This version supports both 2.4 GHz and 5 GHz radio frequency and it
Wi-Fi-4 (802.11n) 2009
offers up to 72 to 600 Mb/s speed
Wi-Fi-5
2014 It supports a speed of 1733 Mb/s in the 5 GHz band
(802.11ac)
A new version will release in 2020 named 802.11ax developed by Huawei, which can support, a maximum of 3.5 Gb/s. it will
know Wi-Fi 6.
Wi-Fi is a wireless technology for networking, so it uses Electromagnetic waves to transmit networks. We know that there are
many divisions of Electromagnetic waves according to their frequency such as X-ray, Gamma-ray, radio wave, microwave, etc,
in Wi-Fi, the radio frequency is used. For transmitting Wi-Fi signal there is three medium,
● Base station network or an Ethernet(802.3) connection: It is the main host network from where the network
connection is provided to the router.
● Access point or router: it is a bridge between a wired network and a wireless network. It accepts a wired
Ethernet connection and converts the wired connection to a wireless connection and spreads the connection as a
radio wave.
● Accessing devices: It is our mobile, computer, etc from where we use the Wi-Fi and surfing internet.
Working of Wi-Fi
All the electronics devices read data in binary form, also router or our devices, here routers provide radio waves and those
waves are receive by our devices and read the waves in binary form. We all know how a wave looks like, the upper pick of the
wave is known as 1 and the lower pick of the wave is known as 0 in binary. Like below:
Data transmission
● SSID (Service Set Identifier): It is a 32 character name that identifies the Wi-Fi network and differentiates one
Wi-Fi from another Wi-Fi. All the devices are attempting to connect a particular SSID. Simply, SSID is the name of
the wireless network.
● WPA-PSK (Wi-Fi Protected Access- Pre-Shared Key): It is a program developed by the Wi-Fi Alliance Authority
to secure wireless networks with the use of Pre-Shared Key(PSK) authentication. WPA has 3 types, such as WPA.
WPA2, WPA3. It is a way of encrypting the Wi-Fi signal to protect from unwanted users.
● Wi-Fi uses Ad-Hoc networks to transmit. It is a point-to-point network without any interface.
Base Station
Advantages of Wi-Fi
● It is a flexible network connection, no wiring complexities. Can be accessed from anywhere in the Wi-Fi range.
● It does not require regulatory approval for individual users.
● It is salable, can be expanded by using Wi-Fi Extenders.
● It can be set up in an easy and fast way. Just need to configure the SSID and Password.
● Security in a high in Wi-Fi network, its uses WPA encryption to encrypt radio signals.
● It is also lower in cost.
● It also can provide Hotspots.
● it supports roaming also.
Disadvantages of Wi-Fi
● Power consumption is high while using Wi-Fi in any device which has a battery, such as mobile, laptops, etc.
● Many times there may be some security problems happening even it has encryption. Such as many times has
known devices become unknown to the router, Wi-Fi can be hacked also.
● Speed is slower than a direct cable connection.
● It has lower radiation like cell phones, so it can harm humans.
● Wi-Fi signals may be affected by climatic conditions like thunderstorms.
● Unauthorized access to Wi-Fi can happen because it does not have a firewall.
● To use Wi-Fi we need a router, which needs a power source, so at the time of power cut, we cannot access the
internet.
ZigBee
ZigBee is a Personal Area Network task group with low rate task group 4. It is a technology of home networking. ZigBee is a
technological standard created for controlling and sensing the network. As we know that ZigBee is the Personal Area Network
of task group 4 so it is based on IEEE 802.15.4 and is created by Zigbee Alliance.
ZigBee is an open, global, packet-based protocol designed to provide an easy-to-use architecture for secure, reliable, low
power wireless networks. Flow or process control equipment can be place anywhere and still communicate with the rest of the
system. It can also be moved, since the network doesn’t care about the physical location of a sensor, pump or valve.
IEEE802.15.4 developed the PHY and MAC layer whereas, the ZigBee takes care of upper higher layers.
ZigBee is a standard that addresses the need for very low-cost implementation of Low power devices with Low data rates for
short-range wireless communications.
IEEE 802.15.4 supports star and peer-to-peer topologies. The ZigBee specification supports star and two kinds of peer-to-peer
topologies, mesh and cluster tree. ZigBee-compliant devices are sometimes specified as supporting point-to-point and
point-to-multipoint topologies.
● Zigbee Coordinator Device: It communicates with routers. This device is used for connecting the devices.
● Zigbee Router: It is used for passing the data between devices.
● Zigbee End Device: It is the device that is going to be controlled.
General Characteristics of Zigbee Standard:
Operating Frequency Bands (Only one channel will be selected for use in a network):
Features of Zigbee:
1. Stochastic addressing: A device is assigned a random address and announced. Mechanism for address conflict
resolution. Parents node don’t need to maintain assigned address table.
2. Link Management: Each node maintains quality of links to neighbors. Link quality is used as link cost in routing.
3. Frequency Agility: Nodes experience interference report to channel manager, which then selects another channel
4. Asymmetric Link: Each node has different transmit power and sensitivity. Paths may be asymmetric.
5. Power Management: Routers and Coordinators use main power. End Devices use batteries.
Advantages of Zigbee:
applications.
8. Mesh networking: Zigbee uses a mesh network topology, which allows for devices to communicate with each
other without the need for a central hub or router. This makes it ideal for use in smart home applications where
devices need to communicate with each other and with a central control hub.
9. Reliability: Zigbee protocol is designed to be highly reliable, with robust mechanisms in place to ensure that data
Disadvantages of Zigbee :
1. Limited range: Zigbee has a relatively short range compared to other wireless communications protocols, which
can make it less suitable for certain types of applications or for use in large buildings.
2. Limited data rate: Zigbee is designed for low-data-rate applications, which can make it less suitable for
● Star Topology (ZigBee Smart Energy): Consists of a coordinator and several end devices, end devices
communicate only with the coordinator.
● Mesh Topology (Self Healing Process): Mesh topology consists of one coordinator, several routers, and end
devices.
● Tree Topology: In this topology, the network consists of a central node which is a coordinator, several routers, and
end devices. the function of the router is to extend the network coverage.
Architecture of Zigbee:
1. Application Layer
2. Application Interface Layer
3. Security Layer
4. Network Layer
5. Medium Access Control Layer
6. Physical Layer
● Physical layer: The lowest two layers i.e the physical and the MAC (Medium Access Control) Layer are defined
by the IEEE 802.15.4 specifications. The Physical layer is closest to the hardware and directly controls and
communicates with the Zigbee radio. The physical layer translates the data packets in the over-the-air bits for
transmission and vice-versa during the reception.
● Medium Access Control layer (MAC layer): The layer is responsible for the interface between the physical and
network layer. The MAC layer is also responsible for providing PAN ID and also network discovery through beacon
requests.
● Network layer: This layer acts as an interface between the MAC layer and the application layer. It is responsible
for mesh networking.
● Application layer: The application layer in the Zigbee stack is the highest protocol layer and it consists of the
application support sub-layer and Zigbee device object. It contains manufacturer-defined applications.
Channel Access:
1. Contention Based Method (Carrier-Sense Multiple Access With Collision Avoidance Mechanism)
2. Contention Free Method (Coordinator dedicates a specific time slot to each device (Guaranteed Time Slot
(GTS)))
Zigbee Applications:
1. Home Automation
2. Medical Data Collection
3. Industrial Control Systems
4. meter reading system
5. light control system
6. Commercial
7. Government Markets Worldwide
8. Home Networking
GPS
What is GPS?
1. Definition:
● Global Positioning System (GPS): A satellite constellation providing highly accurate positioning, navigation,
and timing (PNT) measurements worldwide.
● Operator: Managed by the U.S. Space Force, but available for use by anyone globally.
2. History:
● Initiation: GPS started in 1973.
● First Satellite: Launched in 1978.
● Satellite Series (Blocks):
● Block I: 10 satellites launched between 1978 and 1981.
● Block II: Introduced in 1989 with multiple sub-series (IIA, IIR, IIR-M, IIF) enhancing capabilities.
● Block III: Latest generation, starting with the IIIA series in 2018, featuring new signals and higher
broadcasting power.
M-code:
1. Definition:
● A specialized GPS signal for U.S. Department of Defense use.
2. Purpose:
● Enhances defense against jamming and interference.
3. Features:
● Broadcast on existing L1 and L2 frequencies.
● Provides a dedicated signal for military receivers, ensuring secure PNT access.
GPS Accuracy:
1. GPS:
● One of several Global Navigation Satellite Systems (GNSS).
2. GNSS:
●A collective term for all satellite constellations providing PNT, including GPS, GLONASS (Russia), BeiDou
(China), and Galileo (EU).
3. Comparison:
● GPS: Managed by the U.S. Space Force, widely used globally.
● Other GNSS: Provides additional coverage and redundancy for enhanced PNT accuracy and reliability.
Applications of GPS:
1. Industry Applications:
● Precision Agriculture: Tracking planting and harvesting routes.
● Autonomous Vehicles: Lane-level positioning accuracy.
● Surveying and Mapping: High precision for environmental and construction projects.
● Defense: Secure navigation and timing through M-code.
● Commercial Marine: Safe navigation and vessel tracking.
2. Use Cases:
● Navigation: Mobile phones and vehicle GPS systems providing directions.
● Tracking: Monitoring the movement of goods, vehicles, and machinery.
● Surveying: Accurate mapping of terrains and infrastructure projects.
● Timing: Synchronization of financial transactions, communication networks, and power grids.
1. Key Components:
● GPS Receivers: Devices that compute PNT from satellite signals.
● Antennas: Ensure high-quality signal reception for accurate calculations.
● Correction Services: Address multipath, timing, and atmospheric errors to improve accuracy.
2. Anti-Jam Technology (GAJT):
● Purpose: Protects GPS and other satellite signals from interference, jamming, and spoofing.
● Importance: Enhances system resilience, ensuring reliable PNT in hostile environments.
1. Importance:
● GPS is foundational for many modern technologies, providing essential PNT services.
2. Evolution:
● Continues to evolve with advancements in satellite technology, signal processing, and anti-jamming
capabilities.
● Supports the growth of autonomous applications and remains integral to daily life.
Raspberry Pi
It is a cheap, credit-card-sized device that uses a daily keyboard and mouse and joins to a TV or computer monitor. It is a thin
weighable computer that let every person of all ages to discover programming and gain how to programme in variant
languages like and Scratch. From exploring the internet and watching high-definition video, word-processing, to creating
spreadsheets, and it can do every possible thing we'd expect a desktop computer to do and playing sports.
Used:
It also provides a set of general purpose input/output pins allowing you to control electronic components for physical computing
and explore the Internet of Things (IOT).
Raspberry pi Diagram :
Raspberry Pi model –
1. pi 1 model B – 2012
2. pi 1 model A – 2013
3. pi 1 model B+ -2014
4. pi 1 model A+ – 2014
5. Pi 2 Model B – 2015
6. Pi 3 Model B- 2016
7. Pi 3 Model B+ -2018
8. Pi 3 Model A+ -2019
9. Pi 4 Model A – 2019
10. Pi Model B – 2020
11. Pi 400 – 2021
Specs of the Computer: – The computer has a quad-core ARM processor that doesn’t support the same instruction as an
X86 desktop CPU. It has 1GB of RAM, One HDMI port, four USB ports, one Ethernet connection, Micro SD slot for storage,
one combined 3.5mm audio/video port, and a Bluetooth connection. It has got a series of input and output pins that are used
for making projects like – home security cameras, Encrypted Door lock, etc.
Versatility of Raspberry Pi: – It is indeed a versatile computer and can be utilized by people from all age groups, it can be
used for watching videos on YouTube, watching movies, and programming in languages like , Scratch, and many more. As
mentioned above it has a series of I/O pins that give this board the ability to interact with its environment and hence can be
utilized to build really cool and interactive projects.
Examples of projects: – It can be turned into a weather station by connecting some instruments to it for check the
temperature, wind speed, humidity etc… It can be turned into a home surveillance system due to its small size; by adding
some cameras to it the security network will be ready. If you love reading books it can also become a storage device for storing
thousands of eBooks and also you can access them through the internet by using this device
Architecture of Raspberry Pi
Raspberry Pi is a small single-board computer (SBC). It is a credit card-sized computer that can be plugged into a monitor. It
acts as a minicomputer by connecting the keyboard, mouse, and display. Raspberry Pi has an ARM processor and 512MB of
RAM. The architecture of Raspberry Pi is discussed in this article.
● Processor: Raspberry Pi uses Broadcom BCM2835 system on chip which is an ARM processor and Video core
Graphics Processing Unit (GPU). It is the heart of the Raspberry Pi which controls the operations of all the
connected devices and handles all the required computations.
● HDMI: High Definition Multimedia Interface is used for transmitting video or digital audio data to a computer
monitor or to digital TV. This HDMI port helps Raspberry Pi to connect its signals to any digital device such as a
monitor digital TV or display through an HDMI cable.
● GPIO ports: General Purpose Input Output ports are available on Raspberry Pi which allows the user to interface
various I/P devices.
● Audio output: An audio connector is available for connecting audio output devices such as headphones and
speakers.
● USB ports: This is a common port available for various peripherals such as a mouse, keyboard, or any other I/P
device. With the help of a USB port, the system can be expanded by connecting more peripherals.
● SD card: The SD card slot is available on Raspberry Pi. An SD card with an operating system installed is required
for booting the device.
● Ethernet: The ethernet connector allows access to the wired network, it is available only on the model B of
Raspberry Pi.
● Power supply: A micro USB power connector is available onto which a 5V power supply can be connected.
● Camera module: Camera Serial Interface (CSI) connects the Broadcom processor to the Pi camera.
● Display: Display Serial Interface (DSI) is used for connecting LCD to Raspberry Pi using 15 15-pin ribbon cables.
DSI provides a high-resolution display interface that is specifically used for sending video data.
Accessing GPIO Pins – Sending and Receiving Signals Using GPIO Pins
Accessing GPIO (General Purpose Input/Output) pins on a microcontroller or a single-board computer (like a Raspberry Pi)
allows you to interface with various hardware components such as LEDs, buttons, sensors, and more. Here’s a guide on how
to send and receive signals using GPIO pins.
1. Definition:
● GPIO Pins: Programmable pins on a microcontroller or single-board computer that can be configured as either
input or output.
2. Functionality:
● Input Mode: Reads digital signals (e.g., from buttons or sensors).
● Output Mode: Sends digital signals to control devices (e.g., LEDs, motors).
Hardware Setup
1. Microcontroller or Single-Board Computer: Commonly used devices include Raspberry Pi, Arduino, and
ESP8266/ESP32.
2. Peripherals: Components like LEDs, resistors, buttons, sensors, and relays.
Accessing GPIO Pins
On a Raspberry Pi
1. Library Installation:
● Use the RPi.GPIO library (for ) to control GPIO pins.
2. Setup:
● Import the library and configure the pin numbering scheme (BCM or BOARD).
# Turn LED on
GPIO.output(18, GPIO.HIGH) # or GPIO.output(18, 1)
# Stop PWM
pwm.stop()
2. Debouncing:
● Handle noisy signals by debouncing.
def button_callback(channel):
print("Button pressed")
Clean Up
1. Release Resources:
● Ensure GPIO pins are reset on exit.
# Clean up all GPIO settings
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
try:
while True:
GPIO.output(18, GPIO.HIGH)
time.sleep(1)
GPIO.output(18, GPIO.LOW)
time.sleep(1)
except KeyboardInterrupt:
GPIO.cleanup()
Safety Tips
1. Current Limiting Resistors: Always use resistors with LEDs to prevent damage.
2. Voltage Levels: Ensure the GPIO voltage levels match your components (e.g., 3.3V or 5V).
3. Circuit Isolation: Use optocouplers or relays for high-voltage applications.
Summary
● GPIO Pins: Allow you to interface with hardware by sending and receiving digital signals.
● Modes: Configure GPIO pins as input or output.
● Control: Use libraries like RPi.GPIO to control pins programmatically.
● Applications: Suitable for projects like LED control, sensor reading, and motor control.
Using GPIO pins effectively enables a wide range of hardware projects, from simple LED blinkers to complex sensor networks
and automation systems.