Fundamentals of IOT with Python PDF
Document Details
Uploaded by SpiritualSyntax
Marwadi University
Tags
Summary
This document provides an introduction to the Internet of Things (IoT). It covers various aspects of IoT, including definitions, characteristics, physical design, logical design, advantages, disadvantages, and examples.
Full Transcript
Chapter 1:Introduction Of IOT Fundamentals of IOT with Python (09CE1506) Diploma Studies Computer Engineering Content The “Things” in IOT and History of IOT IOT Definition Characteristic Of IOT Physical Design of IOT Logical Design of IOT IOT Communicatio...
Chapter 1:Introduction Of IOT Fundamentals of IOT with Python (09CE1506) Diploma Studies Computer Engineering Content The “Things” in IOT and History of IOT IOT Definition Characteristic Of IOT Physical Design of IOT Logical Design of IOT IOT Communication Model Advantages Disadvantages IOT Example Sensors Actuators The “Things” in IOT: Anything besides a computer, a laptop, desktop, server type of device, and even no O.S sometimes, we'll call that a thing. It has some features and usually involves a processor. Intelligence, Computer technology & Internet connectivity. History of IOT: Term “Internet of Things” was coined by Kevin Ashton in 1999 during his work at Procter & Gamble. Used technology called RFID (used in many places like shopping malls, libraries etc.) Definition of IOT: The Internet of Things (IOT) is a system of Interrelated computing devices, mechanical and digital machines, objects, animals or people Provided with unique identifiers (UIDs) Ability to transfer data over a network without requiring human-to-human or human-to-computer interaction. The Internet of Things, is about Extending the power of the internet beyond computers and smart phones to a whole range of other things, processes and environments. Those “connected” things are used to gather information, send information back, or both. The Internet of Things, refers to Ever-growing network of physical objects that feature an IP address for internet connectivity, And communication occurs between these objects and other Internet-enabled devices and systems. Computing concept that describes the idea of everyday physical objects being connected to the internet and being able to identify themselves to other devices. IOT Application Smart cities (and regions) Smart car and mobility Smart home and assisted living Smart industries Public safety Energy and environmental protection Agriculture and tourism, etc Characteristic of IOT Dynamic & Self-Adapting. Self-Configuring. Interoperable Communication Protocols. Unique Identity. Integrated into Information Network. ❑ Dynamic & Self-Adapting. ❖ Dynamically adapt ❖ Taking actions ❖ eg, Surveillance Cameras ❑ Self-Configuring. ❖ Large no’ of devices working together. ❖ Fetching latest s/w updates without manual intervention. Configuring themselves. ❑ Interoperable Communication Protocols. ❖ Supports Interoperable communication protocols. ❖ Communicate through various protocols with other devices. ❑ Unique Identity. ❖ IP address or URI. ❖ To Query, Monitor & Control. ❑ Integrated into Information Network. ❖ Communicate and exchange data. ❖ Ex, Weather monitoring ( nodes ) ❑ They should be efficient and scalable as well. URI(Uniform Resource Identifier) ❑ URI: Sequence of character used to identify resource (logical or physical). URL URI URN URL: Specifies both the identity and the location of a resource (How and Where). URI: A more comprehensive term covering both URLs (identifying and locating) and URNs (just identifying). URN: Focuses only on uniquely identifying a resource, not on where it is located or how to access it. Physical Design of IOT Physical Design of IOT A physical design of an IoT system refers to the individual node devices and their protocols that are utilized to create a functional IoT ecosystem. Each node device can perform tasks such as remote sensing, actuating, monitoring, etc., by relying on physically connected devices. It may also be capable of transmitting information through different types of wireless or wired connections. Node devices are used to build a connection, process data, and provide interfaces, and storage, in an IoT system. They generate data that can be analyzed by the IoT system and program to perform operations and improve the system. Things/Devices are used to build a connection, process data, provide interfaces, provide storage, and provide graphics interfaces in an IoT system. all these generate data in a form that can be analyzed by an analytical system and program to perform operations and used to improve the system. for example temperature sensor that is used to analyze the temperature generates the data from a location and is then determined by algorithms. Connectivity: Devices like USB hosts and ETHERNET provides connectivity between the devices and the server. Processor: Processors like CPU and other units process the data. This is used to improve the decision quality of an IoT system. Audio/Video Interfaces: System interfaces like HDMI and RCA devices record audio and videos. Input/Output interface: Devices like UART, SPI, CAN, etc give input and output signals to sensors and actuators. Storage Interfaces: IoT devices like SD, MMC, and SDIO generate data. Storage interfaces store those data. Controlling of activity: Devices like DDR and GPU control the activity of an IoT system. ❖IOT devices can, ❑Exchange data with other connected devices and application either directly or indirectly. ❑Collect data. ❑They can also transmit the data to centralized servers or cloud based application for further processing. ❖ Connectivity: Various protocols such as USB host and Ethernet are employed to establish connectivity between devices and server. Connectivity options enable the seamless transfer of data, facilitating communication and data exchange within the iot network. ❖ Processor: Handling data processing task Responsible for executing algorithms, performing computations and analyzed data. Effectively processing the data, iot system can enhance the quantity decision making process. ❖ Audio/Video Interface: HDMI and RAC are utilize within to capture and record a/v content. Enable the integration of audio and video recording capabilities, allowing the system to gather multimedia data for analysis for further. RAC: Root Cause analysis which use for identify appropriate solution. ❖ I/O Interface: These are utilized to establish communication between sensors, actuators and iot devices. Exchange the signals, facilitating the input and output of data from sensors and actuators. ❖ Storage and Interface: Interface provides a means efficient store and retrieve data ensuring that important information is preserved for further analysis or references. UART: Universal Asynchronous receiver/transmitter Which use for exchanging serial data between two device. SPI: Serial Peripheral Interface which use for primarily in embedded system for short distance wired communication between IC. HDMI: High definition Multimedia Cable which use for the transferring of both high-definition audio and video through a single cable, from one device to another. I2C: to establish communication between two or more ICs (Integrated Circuits). RAC: Root Cause analysis SD: Secure Digital MMC: Multimedia Card SDIO: SD Input output DDR: Double data rate GPU: Graphics Processing Unit Physical Design of IOT Physical design of IOT Universal Asynchronous Receiver/Transmitter Serial Peripheral interface inter-IC bus Controller Area Network EXAMPLE ARDUINO UNO INTERFACE IOT Protocols IOT Protocols contain 4 layers, ❑Link Layer ❑Network Layer ❑Transport Layer ❑Application Layer Link Layer Protocols ❑Link Layer:Determines how the data is physically sent over the network layer (e.g. copper wire, coaxial cable or a radio wave). 1. IEEE 802.3--Ethernet (wired connection): It is a collection of wired Ethernet standards for the link layer. 2. 802.11 –Wi-Fi: IEEE 802.11 is a collection of wireless local area network(WLAN) communication standards. 3. IEEE 802.16--WiMAX (Worldwide Interoperability for Microwave Access) It is a collection of wireless broadband standards. It uses micro waves, more range. 4. 2G/3g/LTE-Mobile Communication There are different generation of mobile communication standards including 2G, 3G and 4G LTE(Long Term Evolution). 5.802.15.4 – LR-WPAN Standards for low rate wireless personal area network It provides data rates from 40Kb/s to 250Kb/s. low-cost and low-speed communication for power constrained devices. Network Layer Protocols: Network layer protocol : The network layers are responsible for sending of IP datagram’s from the source network to the destination network. 1. IPV4 :(addresses are 32-bit integers that can be expressed in hexadecimal notation. ) IPv4 is short for Internet Protocol version 4. The 4th version of the Internet protocol (IP) is still a popular protocol for communication over the Internet. It establishes the rules and limitations for communication over the Internet or on a local network. 2. IPV6: The IPv6 is a network layer protocol that allows communication and data transfer between two different hosts. It sets specific rules that help identify the separate hosts and track their location. That way, they could exchange information successfully. Only when the two corresponding IP addresses are identified, the route could be established, and the hosts are able to communicate. IPv6 operates with 128-bit addresses. Each address includes eight different groups of strings, and every group has four characters (alphanumeric), divided by a colon. 3. 6LoWPAN ( IPv6 over Low Power Wireless Personal Area Networks ) Encapsulation and header compression mechanisms that allow IPv6 packets to be sent and received over IEEE 802.15.4 based networks. Used in general automation and industries. Transport Layer Protocols: ❑Transport Layer: This layer is used to control the flow of data segments and handle error control. also, these layer protocols provide end-to-end message transfer capability independent of the underlying network. The transport layer protocols provide end to end message transfer capability independent of the underlying network. Provide functions such as error control, segmentation, flow control and congestion control. 1.TCP: Transmission Control Protocol (TCP) is connection-oriented, meaning once a connection has been established, data can be transmitted in two directions. TCP has built-in systems to check for errors and to guarantee data will be delivered in the order it was sent, making it the perfect protocol for transferring information like still images, data files, and web pages. TCP UDP TCP is a connection-oriented protocol. UDP is the Datagram oriented protocol. TCP is reliable as it guarantees delivery of data to The delivery of data to the destination cannot be the destination router. guaranteed in UDP. TCP provides extensive error checking mechanisms. UDP has only the basic error checking mechanism It is because it provides flow control and using checksums. acknowledgment of data. TCP is comparatively slower than UDP. UDP is faster, simpler and more efficient than TCP. TCP header size is 20 bytes. UDP Header size is 8 bytes. 2.UDP: User Datagram Protocol (UDP) is a simpler, connectionless Internet protocol wherein error-checking and recovery services are not required. With UDP, there is no overhead for opening a connection, maintaining a connection, or terminating a connection; data is continuously sent to the recipient, whether or not they receive it. Although UDP isn’t ideal for sending an email, viewing a webpage, or downloading a file, it is largely preferred for real-time communications like broadcast or multitask network transmission. Application Layer Protocols: ❑Application Layer: In this layer, protocols define how the data can be sent over the network with the lower layer protocols using the application interface. these protocols include HTTP, WebSocket, XMPP, MQTT, DDS, and AMQP protocols. 1. HTTP(HyperText Transfer Protocol): It forms the foundation of the World Wide Web(WWW). The protocol follows a request-response model. It is used to communicate between web browsers and servers. it makes a request to a server and then waits till it receives a response and in between the request server does not keep any data between the two requests. 2. CoAP – Constrained Application Protocol: It is used for machine to machine(M2M) applications. Made for constrained environment, devices and networks Runs on top of UDP, Client server architectures & catagrams(Collision Avoidance Time Allocation (CATA) Protocol is a Contention Based MAC Protocols with Reservation which is based on dynamic topology). It is a web-based protocol that resembles HTTP. It is also based on the request-response model. Based on the REST-style architecture, this protocol considers the various objects in the network as resources. These resources are uniquely assigned a URI. a client sends requests to a server using HTTP command (get, post) etc. 3.Websocket : This protocol enables two-way communication between a client and a host that can be run on an untrusted code in a controlled environment. This protocol is commonly used by web browsers. Uses TCP, Client can be browser, a mobile application or an IOT device. 4. MQTT – Message Queue Telemetry Transport: light weight messaging protocol. Based on publish subscribe model. Uses concept of a message broker. SMQTT is an extension of MQTT(Secure). It does not require that both the client and the server establish a connection at the same time. It provides faster data transmission, like how WhatsApp/messenger provides a faster delivery. It's a real-time messaging protocol. It allows the clients to subscribe to the narrow selection of topics so that they can receive the information they are looking for. 5. XMPP – Extensible Messaging and Presence Protocol: XMPP is useful for real time exchange of data and it is an open standard protocol. It is based on XML. It is decentralized , uses client server architecture. It is decentralised means there is no centralised XMPP server just like email, anyone can run their own XMPP server. Each XMPP client is identified by JID (Jabber ID). A network configuration where there are multiple authorities that serve as a centralized hub for a subsection of participants. Supports both client-server & server to server communication. Supports real-time communication between IOT devices. Secure – authenticity and encryption. #JID { user, server, resource } For example, I’m a whatsApp user and I’m identified by my mobile number, so user = "8767898790“ server = "whatsapp.com“ resource = "mobile Ex: -" JID : "[email protected]/mobile" Example : Fault Tolerance 6. DDS – Data distribution service: Uses publish subscribe model, Publisher is an object. middleware standard for D 2 D or M 2 M. Data Distribution Service is another publish-subscribe protocol but it is different from MQTT which connects them to server but here DDS protocol is a Broker-less architecture that’s why it is a high speed and high- performance protocol than MQTT as it is not dependent upon any intermediary system. Provides QOS ( Reliability, Fault tolerance) Fault tolerance is the ability of a system to maintain proper operation in the event of failures or faults in one or more of its components. Quality of service refers to the effectiveness of a network to provide more suitable or appropriate service to the application. 7. AMQP(Advance message queuing protocol ): AMQP kind of an open standard for business messaging. Supports Point to Point, Publish subscribe and routing queuing, it also have brokers. Messages either delivered by broker or customer can pull the messages from the queue. AMQP is used to collect data from various sensors and devices and transmit it to processing systems or cloud services. Message Queue: It is a unique entity that connects messages to their resources or points. Binding: Bindings are a set of predetermined instructions for queuing and exchanging. It manages message transmission and delivery. Example: AMQP Logical Design of IOT(Functional Block Diagram: It is the actual design of the IoT system. It illustrates the assembling and configuration of the components. An IoT system comprises of a number of functional blocks that provide the system the capabilities for identification, sensing, actuation, communication, and management. Functional Block: Device – Sensing , actuation, monitoring and control function. Devices within the IoT framework are responsible for sensing and monitoring functions, gathering data from the surrounding environment. These devices enable the collection of relevant information required for system operations. Communication – handles communication using protocols. The communication block plays a crucial role. It helps with facilitating communication between the client & the cloud−based server. It provides seamless data transmission & reception by employing proper protocols. Services – IOT services such as services for device such as monitoring, discovery, data publishing & control. The services functional block offers a set of capabilities, including device monitoring and control, data publication and deletion, as well as system restoration. These services enhance the functionality and utility of the IoT system. Management – govern IOT system. The management functional block encompasses a range of functions designed to oversee an IoT system. These functions enable effective administration and coordination of various system components. Security – authentication , authorization, integrity & security. The security block is instrumental in defending an IoT system through several defensive measures implementation. These criteria encompass authorization mechanisms, data security protocols, authentication processes, & additional security elements such as two−step verification. Application – An interface, user can control and monitor various aspects of IOT system. An application is an interface that facilitates users in accessing and analyzing the status of a system. It serves as a control system allowing users to monitor and evaluate system operations. Also view status and analyze the data. An IoT system or application consists of distinct functional blocks that collectively contribute to its operation. Each block performs specific functions, ranging from device control and communication to service provision, user interaction, system management, and security enforcement. IOT communication model IN IoT, There are four kind of communication models. 1. Request - Response. 2. Publish - Subscribe. 3. Push - Pull. 4. Exclusive Pair. The IoT communication model is a diverse range of technology, with each variant playing a unique role, used for specific use cases that are based on several factors like data type, transmission frequency, and security requirements. 1. Request-Response Model: The Request−Response Model is an essential framework consisting of two primary entities: the client & the server. The client can bring diverse forms such as a web application or a mobile application, & its objective can range from browsing web pages to accessing emails. 2. Publish- Subscriber Model: This model involves Publishers, Brokers, and Consumers where Publishers act as the the data source and dispatch information to topics managed by Brokers, unknown to Consumers. Consumers, on the other hand, subscribe to these topics handled by the broker, to receive information. 3. Push-Pull Model: The Push-Pull model involves data publishers, data consumers, and data queues where Publishers and Consumers operate independently. Publishers transmit data by pushing it into the queue, while Consumers, located on the other end, pull the data from the queue and maintain a streamlined flow of information exchange. 4. Exclusive Pair Model: The Exclusive Pair model is a bi-directional gem, meaning that it can easily facilitate a complete communication cycle between client and server. The model allows a constant open connection that continues until the client initiates a request to close it. This distinctive feature ensures a continuous reliable channel for communication. Advantage of IOT: o Communication o Automation and Control o Monitor o Time and Money Saves o Better Quality of Life It can assist in the smarter control of homes and cities via mobile phones. It enhances security and offers personal protection. By automating activities, it saves us a lot of time. Information is easily accessible, even if we are far away from our actual location, and it is updated frequently in real time. Electric Devices are directly connected and communicate with a controller computer, such as a cell phone, resulting in efficient electricity use. As a result, there will be no unnecessary use of electricity equipment. Personal assistance can be provided by IoT apps, which can alert you to your regular plans. It is useful for safety because it senses any potential danger and warns users. For example, GM OnStar, is a integrated device that system which identifies a car crash or accident on road. It immediately makes a call if an accident or crash is found. It minimizes human effort because IoT devices connect and communicate with one another and perform a variety of tasks without the need for human intervention. Asset tracking, traffic or transportation tracking, inventory control, delivery, surveillance, individual order tracking, and customer management can all be made more cost-effective with the right tracking system. Disadvantages of IOT: o Compatibility o Complexity o Privacy/Security o Safety o Technology Takes Control of Life Hackers may gain access to the system and steal personal information. Since we add so many devices to the internet, there is a risk that our information as it can be misused. They rely heavily on the internet and are unable to function effectively without it. With the complexity of systems, there are many ways for them to fail. We lose control of our lives—our lives will be fully controlled and reliant on technology. Overuse of the Internet and technology makes people unintelligent because they rely on smart devices instead of doing physical work, causing them to become lazy. Unskilled workers are at a high risk of losing their jobs, which could lead to unemployment. Smart surveillance cameras, robots, smart ironing systems, smart washing machines, and other facilities are replacing security guards, maids, ironmen, and dry-cleaning services etc. It is very difficult to plan, build, manage, and enable a broad technology to IoT framework. Deploying IoT devices is very costly and time-consuming. IOT Example IOT Example IOT Example Sensors A Device that can detect the changes in a physical environment. Convert physical parameters such as temperature, heat, motion, humidity, pressure, etc. into electrical signals. We can transform this signal into a human readable display and send them through a network for further processing. Example of Sensor Actuators A device that converts a control signal into some kind of movement. Obtains a control signal in the form of electric voltage, current, etc. Converts the received control signal into mechanical motion. Example of Actuators To move To “ON” or “OFF” To rotate Locking Mechanism Sensors and Actuators Sensors Actuators