IOT UNIT - III PDF
Document Details
Uploaded by AbundantHeliotrope1957
Prof. Ratna Biswas
Tags
Summary
This document provides an introduction to the Web of Things (WoT). It discusses the concept of WoT and its relationship to the Internet of Things (IoT). The document also touches upon the need for WoT and its benefits.
Full Transcript
Internet of Things UNIT-III Web of Things and Programming Framework for IoT: Web of Things versus Internet of Things, Two Pillars of the Web – Architecture Standardization for WoT – Platform Middleware for WoT – Unified Multitier WoT Architecture. Programming paradigm, assembly, proce...
Internet of Things UNIT-III Web of Things and Programming Framework for IoT: Web of Things versus Internet of Things, Two Pillars of the Web – Architecture Standardization for WoT – Platform Middleware for WoT – Unified Multitier WoT Architecture. Programming paradigm, assembly, procedural, Functional, OOP, multi-paradigm programming, Introduction to Arduino programming, Introduction to Python programming, Raspberry Pi and its components, Case studies of IoT using Raspberry Pi Introduction to Web of Things (WoT) There’s no doubt that the internet of things (IoT) has made things easier for us, but it also brings in complexities as the number of devices around us increases. One of the significant hurdles in the widespread adoption of IoT has been the difficulty communicating and managing all these devices. To communicate with your ten IoT devices, you need ten mobile applications. This won’t be convenient as you will have to switch between one app to another. Unfortunately, that is happening with most IoT devices. The problem is that there’s not a single “lingua franca” spoken by every object – there are hundreds! The worst part is that most of these IoT protocols and standards aren’t compatible with each other, and for this reason, the IoT hasn’t been able to actualize its full potential. Connecting devices to the internet and giving them IP addresses is only the first step towards the internet of things as it facilitates data exchange. However, it doesn’t guarantee that devices understand what it means. That’s why we need something like HTTP, a universal way to transfer data in text, images, sound, and other media elements so that devices communicate with each other. The Web of Things – or WoT – is what fills this vacuum by using and adapting Web protocols to connect anything in the physical world and give it a presence on the World Wide Web! Definition of Web of Things (WoT) Web of Things (WoT) refers to a set of standards formed by the world wide web consortium (W3C) to facilitate the interoperability, fragmentation, and usability of the Internet of Things (IoT). In other words, it is a subset of the internet of things (IoT) and is built around software standards such as REST, HTTP, and URIs to allow devices to interact with one another. What is the Web of Things? The term "Web of Things" (WoT) describes an idea in which physical objects are linked to the internet so they can interact with other internet-enabled devices and with each other. By incorporating actual items into the online world, it essentially expands upon the concepts of the Internet of Things (IoT). --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-1 In contrast to conventional Internet of Things solutions, which frequently depend on exclusive protocols and communication techniques, the Web of Things makes use of common web technologies like HTTP, WebSocket, and RESTful APIs. No matter what the underlying hardware or software of various devices and platforms is, this standardization enables smooth compatibility between them. The Web of Things facilitates the development, deployment, and integration of IoT solutions by enabling devices to publish and consume data using web standards. By enabling devices to communicate with one another independently, this method creates a more transparent and decentralized environment that opens new avenues for automation, data sharing, and wise decision-making. The Web of Things promises to create a smarter and more connected world in which everyday devices can easily interact with digital services to create a more responsive and effective environment. Need for Web of Things By leveraging standard web technologies and principles, WoT empowers developers to create a more connected, intelligent, and efficient world. Take on the problem of facilitating data interchange and connectivity between various IoT platforms and devices. Solve interoperability problems brought on by exclusive communication techniques and protocols. To handle the increasing number of connected devices across multiple domains, enable scalability. Democratize IoT programming by giving programmers of all experience levels a dependable and approachable platform. Encourage automation to improve user experiences, increase resource efficiency, and streamline procedures. Make using IoT devices and services easier for users by offering user-friendly interfaces. Utilize the power of data insights to inform choices and spur creativity across a range of sectors. To produce cutting-edge IoT solutions, encourage cooperation and experimentation among developers, researchers, and companies. Benefits of the Web of Things Web of Things offers a powerful framework for building interconnected, interoperable, and secure IoT ecosystems that can unlock new possibilities and enhance various industries and domains. The following are some main advantages: Interconnectivity The Web of Things (WoT) provides a means of facilitating data exchange and communication across a variety of Internet of Things (IoT) platforms and devices. The interoperability of traditional IoT systems is frequently hampered by proprietary protocols and communication techniques. Through the use of common web --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-2 technologies like HTTP, WebSocket, and RESTful APIs, WoT makes it possible for devices to talk to one another without regard to the underlying software or hardware. Standardization To facilitate the development, deployment, and integration of IoT solutions, WoT encourages the use of standardized communication protocols and interfaces. Because of this standardization, gadgets made by many vendors can operate together flawlessly. By utilizing their pre-existing expertise in web development tools and frameworks, developers can quickly accelerate creativity and lower the learning curve when developing WoT applications. Scalability As IoT devices proliferate in a variety of areas, including smart cities, smart homes, and industrial automation, scalable IoT solutions are becoming more and more necessary. WoT facilitates the integration of a wide range of devices, including cellphones, cloud services, actuators, and sensors. Because of its scalability, extensive IoT ecosystems with millions of connected devices can be built. Accessibility WoT gives developers of all experience levels a comfortable and approachable environment, democratizing IoT development. To create WoT apps, developers can take advantage of a robust ecosystem of tools, libraries, and frameworks by utilizing web technologies. Because of its accessibility, developing IoT solutions is now easier, enabling a larger community of developers to take part in the IoT revolution. Automation In Internet of Things applications, automation is a major factor in productivity and efficiency. With the help of well-defined rules and real-time data, WoT allows devices to communicate with one another and make intelligent decisions. For instance, a smart thermostat linked to the WoT might automatically modify the temperature in response to occupancy trends and meteorological predictions, resulting in reduced energy use and increased comfort. Improved User Experience WoT makes interaction with IoT devices and services easier by offering user-friendly interfaces. It's simple for users to monitor and manage their IoT environment from anywhere by using web browsers or mobile apps to access and control their linked devices. Customers and organizations alike are more likely to embrace and be satisfied with the improved user experience. Data Insights Data insights are a crucial component of Internet of Things applications, as they facilitate innovative thinking and decision-making. WoT makes it possible to gather, examine, and use data from a variety of sources, including sensors, gadgets, and cloud services. Businesses may use this data to their advantage by making informed --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-3 decisions and staying one step ahead of the competition by learning important insights about market trends, customer behavior, and operational effectiveness. Innovation WoT fosters innovation by making it possible to create new IoT services and apps. Development teams, researchers, and companies are encouraged to collaborate and experiment with WoT, which offers a standardized platform for communication and engagement. This encourages the development of novel responses to urgent problems in fields including environmental monitoring, transportation, healthcare, and agriculture. The Web of Things (WoT) Architecture The WoT is composed of many different progressing architectural standards. Many organizations proposed the standards prompted by W3C. This complete standardization by the world wide web consortium is the foundation of various building blocks. These are: Layer 1 - Accessibility / Access Layer 2 - Findability / Find Layer 3 - Sharing / Share Layer 4 - Composition / Compose Let’s dive into these to gain a better understanding. Layer 1- Accessibility: This layer converts anything into a web thing. This will enable us to interact with the converted web thing with HTTP requests. To put it more simply, a web thing is a REST API that permits us to communicate with anything in the actual world. 1. HTML 2. REST API 3. URL / URI 4. Gateway 5. HTTP Layer 2 - Findability: It is one thing to make the data more accessible, but it is wholly different than the applications can understand what the data is or the purpose. For this purpose, the second layer comes into action. It ensures that other HTTP users can use your device, and it is easily discoverable and workable by different WoT applications. It is done by resing the semantic web standards to explain the things and their purpose of existing. 1. REST Crawler 2. Linked Data 3. Link Header 4. Search Engines 5. JSON --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-4 Layer 3 - Sharing: Just like you secure your piggy bank away from your sibling’s reach, this layer does the same work for WoT. This layer’s job is to find a safe way to transfer the data across services securely. Different protocols are used at this level, such as TLS, OAuth, etc. 1. Social Networks 2. OAuth 3. RDFa 4. Encryption 5. Authentication Layer 4 - Composition: The fourth step is to find a way and tools to build an application for the web of things. At the Composition layer, web tools span from web toolkits (JavaScript SDKs) that provide a higher-level abstraction to dashboards with programmable widgets, and lastly, physical mashup tools like Node-RED. 1. Systems Integration 2. Node-RED 3. Automated UI generation 4. Web Application 5. IFTTT An Example of Web of Things (WoT) Application: Let’s say you are trying to build a smart home, and you buy many IoT-enabled appliances such as Smart TV, refrigerator, door, CCTV cameras, etc. To manage these things from your smartphone, you will need to have different applications for different devices. Plus, you will need to ensure that these devices communicate to put them in use. Let’s understand this with a practical example. In case of a burglary, you want your CCTV camera to give a signal to your security alarm system and warn you. This can be made possible by WoT as it establishes communication protocols and standards to create a ‘web’ of things. Real-life Use Cases of the Web of Things Many real-world applications are utilizing the Web of Things (WoT) to facilitate automation, connectivity, and interoperability among heterogeneous devices and settings. These are a few noteworthy use cases: Automation of Smart Homes With a single interface, WoT makes it possible to integrate and manage a variety of smart home appliances, lighting controls, security cameras, and thermostats. Using web-based apps or voice assistants, users may remotely monitor and control their home environment, change settings, and get notifications. IoT for Industry (IIoT) --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-5 WoT enables communication and data sharing between actuators, sensors, control systems, and machines in industrial settings. Manufacturing facilities use Work Order Technology (WoT) to track equipment performance, streamline production procedures, forecast maintenance requirements, and raise overall productivity and efficiency. Smart Cities WoT technology is used in smart city projects to improve public services, energy management, transportation networks, and urban infrastructure. Applications include intelligent street lighting, parking management, environmental monitoring, garbage management, and smart traffic management. Healthcare Tracking and Assistive Technology Wearable sensors and medical equipment are used in WoT to enable remote monitoring of patients' health parameters, such as blood pressure, glucose levels, and heart rate. WoT-powered assistive technologies improve the quality of life for people with impairments by enabling remote monitoring, control, and support with devices and situations. Agricultural IoT (AgriTech) WoT solutions are used in agriculture for animal tracking, irrigation control, crop monitoring, and precision farming. To maximize yields and improve resource use, farmers can remotely monitor crop health, soil conditions, weather forecasts, and equipment status. Management of Supply Chains and Retail Retailers use WoT for supply chain optimization, inventory control, and customized customer service. RFID tags, sensors, and networked gadgets provide seamless checkout experiences, inventory level monitoring, and tracking of goods along the supply chain. Environmental Monitoring Applications including tracking wildlife, assessing water quality, and monitoring air quality all make use of WoT. Real-time data is gathered by sensors placed in both natural and urban settings, and it is then sent to web-based platforms for analysis, visualization, and decision-making. Energy Management and Smart Networks To optimize electrical networks and manage energy, utilities implement Work-of-the-Day technologies. Real-time energy usage monitoring, load balancing, and the integration of renewable energy sources are made possible by smart meters, sensors, and grid- connected devices. These actual use examples highlight the wide range of uses and potential advantages of the Web of Things in numerous sectors and fields. --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-6 Difference Between IoT and WoT The main distinctions between WoT and IoT in terms of architecture, development, security, communication, and user experience are shown in this table. WoT expands on the idea of device-to-device communication, which is the main focus of IoT, by adding web technologies to improve user interaction, connectivity, and interoperability. Aspect Internet of Things (IoT) Web of Things (WoT) Extension of IoT that adds web Network of interconnected physical Definition technologies for enhanced connectivity devices and interoperability Utilizes web protocols (HTTP, WebSocket) Device-to-device communication Communication for device communication and data using various protocols exchange Interoperability challenges due to Aims to enhance interoperability by Interoperability diverse protocols and standards leveraging web standards and protocols Often relies on proprietary or Built on open, standardized web protocols Architecture specialized protocols and and architectures architectures Data access and control may be Facilitates data access and control through Data Access limited to proprietary platforms or standardized web interfaces and APIs protocols Scalability challenges due to Strives for scalability through standardized Scalability heterogeneous devices and communication and interoperability protocols Development may require Utilizes familiar web development tools Development specialized IoT platforms and and technologies for application frameworks development Security vulnerabilities due to Emphasizes security through established Security diverse devices and protocols web security mechanisms and standards Focuses on providing uniform user Often lacks standardized user User Interface experiences across devices through web- interfaces and interactions based interfaces Smart home devices (thermostats, Integration of smart home devices Example cameras, etc.) accessible via web browsers or apps Architecture Standardization for WoT --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-7 The W3C Web of Things (WoT) architecture is a set of principles and guidelines that enable interoperability across IoT platforms and application domains. The architecture is designed to preserve and complement existing IoT standards and solutions. The Web of Things (WoT) architecture is a framework that allows devices and objects to connect to the web. The W3C Web of Things (WoT) architecture specification describes the abstract architecture for the WoT. It includes the following features: Interoperability The WoT architecture allows IoT devices and services to communicate with each other across multiple networking protocols and application domains. Standardized definition and programming The WoT architecture offers a standardized way to define and program IoT behavior. Security and privacy The WoT architecture should support security and privacy at least as well as the systems it connects to. Building blocks The WoT architecture is made up of modular building blocks that are described in other documents. Levels The WoT architecture stack is made up of levels that add extra functionality, rather than layers The WoT architecture is based on requirements derived from use cases for multiple application domains. It can be mapped onto a variety of concrete deployment scenarios. Platform Middleware for WoT Platform middleware for the Web of Things (WoT) is a software layer that connects physical devices and applications in the WoT architecture. It acts as a bridge between devices and applications, providing a common interface for communication and managing data flow. Platform middleware also offers security and privacy features to ensure that data is transmitted securely. Platform middleware is an essential component of the WoT architecture, enabling devices to be integrated into the web and providing a seamless user experience Here are some other things to know about platform middleware: Platform middleware and communication middleware Platform middleware and communication middleware are closely related and sometimes integrated, but there are differences between them. Platform middleware and application frameworks Platform middleware is also known as application frameworks. Platform middleware and tools --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-8 Platform middleware may provide a container for application program logic, as well as tools like web servers, application servers, and content management systems. Platform middleware and products Platform middleware products are available on premises or through a cloud platform suite. Programming Paradigm A programming paradigm is a relatively high-level way to conceptualize and structure the implementation of a computer program. A programming language can be classified as supporting one or more paradigms Procedural Programming Procedural programming is a programming paradigm that involves writing computer programs as a series of steps, or procedures, that call each other. It's also known as imperative programming. What is Procedural language? A procedural language is a sort of computer programming language that has a set of functions, instructions, and statements that must be executed in a certain order to accomplish a job or program. In general, procedural language is used to specify the steps that the computer takes to solve a problem. Computer procedural languages include BASIC, C, FORTRAN, Java, and Pascal, to name a few. To create programs, they use variables, conditional statements, and functions that permit a computer to process and provide the desired output. Although it allows the users to give computers instructions in a natural language like Chinese, French, or English, computers are unable to understand human communication. Therefore, users cannot do that. Human intelligence can create ambiguities in communication with natural language, but a computer needs a clear instruction, mathematically precise communication system. Every time, all symbols or collections of symbols must have exactly the same meaning. They also employ unanticipated boundaries, elements, and explanations to present an optimal yield and create codes that allow a PC to find. Script and software programmers employ procedural languages as one of the most frequent forms of programming languages. The programming editor or ides, such as Microsoft Visual Studio, Eclipse, or Adobe Dreamweaver, are used to create a program by using a procedural language. With the help of these editors, users can use one or more procedural languages to develop code, as well as test the code, and fix bugs in the code. As its name suggests, procedural programming languages depend upon functions, well- organized procedures, or subroutines in a program's architecture, which helps the computer to provide a desired state or output. A procedural language program is broken down into statements, functions, variables, and conditional operators. Functions and --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-9 procedures are applied to the data and variables in order to complete a job. These procedures allow the users to call themselves anywhere between the program hierarchy and other procedures also. A procedural language program has one or more procedures. Functional Programming Functional programming (FP) is an approach to software development that uses pure functions to create maintainable software. In other words, building programs by applying and composing functions Functional programming is a programming paradigm that uses pure functions to build computer programs. It's characterized by: Modularity: Functional programming breaks down large projects into simpler modules. Pure functions: Functions take an input value and produce an output value without being affected by the program. Immutable values: Functional programming uses immutable values. Expressions: Functional programming uses expressions instead of statements. Avoids shared state: Functional programming doesn't use shared state or mutable data. Functional programming has several advantages, including: Easier to analyze, test, and maintain: Functional programming makes it easier to analyze, test, and maintain code. More bug resistant: Functional programming aims to write code that is more bug resistant by avoiding flow-control statements. Clearer to understand: Functional programming aims to write code that is clearer to understand. Functional programming is especially good for mathematical functions where the values don't have any correlation. Object Oriented Programming (OOP) As the name suggests, Object-Oriented Programming or OOPs refers to languages that use objects in programming. Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism, etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. OOPs Concepts: Class Objects Data Abstraction Encapsulation Inheritance Polymorphism Dynamic Binding Message Passing --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-10 1. Class: A class is a user-defined data type. It consists of data members and member functions, which can be accessed and used by creating an instance of that class. It represents the set of properties or methods that are common to all objects of one type. A class is like a blueprint for an object. For Example: Consider the Class of Cars. There may be many cars with different names and brands but all of them will share some common properties like all of them will have 4 wheels, Speed Limit, Mileage range, etc. So here, Car is the class, and wheels, speed limits, mileage are their properties. 2. Object: It is a basic unit of Object-Oriented Programming and represents the real-life entities. An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is instantiated (i.e. an object is created) memory is allocated. An object has an identity, state, and behavior. Each object contains data and code to manipulate the data. Objects can interact without having to know details of each other’s data or code, it is sufficient to know the type of message accepted and type of response returned by the objects. For example “Dog” is a real-life Object, which has some characteristics like color, Breed, Bark, Sleep, and Eats. 3. Data Abstraction: Data abstraction is one of the most essential and important features of object-oriented programming. Data abstraction refers to providing only essential information about the data to the outside world, hiding the background details or implementation. Consider a real-life example of a man driving a car. The man only knows that pressing the accelerators will increase the speed of the car or applying brakes will stop the car, but he does not know about how on pressing the accelerator the speed is increasing, he does not know about the inner mechanism of the car or the implementation of the accelerator, brakes, etc in the car. This is what abstraction is. 4. Encapsulation: Encapsulation is defined as the wrapping up of data under a single unit. It is the mechanism that binds together code and the data it manipulates. In Encapsulation, the variables or data of a class are hidden from any other class and can be accessed only through any member function of their class in which they are declared. As in encapsulation, the data in a class is hidden from other classes, so it is also known as data-hiding. 5. Inheritance: Inheritance is an important pillar of OOP(Object-Oriented Programming). The capability of a class to derive properties and characteristics from another class is called Inheritance. When we write a class, we inherit properties from other classes. So when we create a class, we do not need to write all the properties and functions again and again, as these can be inherited from another class that possesses it. Inheritance allows the user to reuse the code whenever possible and reduce its redundancy. --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-11 6. Polymorphism: The word polymorphism means having many forms. In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form. For example, A person at the same time can have different characteristics. Like a man at the same time is a father, a husband, an employee. So the same person posses different behavior in different situations. This is called polymorphism. --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-12 7. Dynamic Binding: In dynamic binding, the code to be executed in response to the function call is decided at runtime. Dynamic binding means that the code associated with a given procedure call is not known until the time of the call at run time. Dynamic Method Binding One of the main advantages of inheritance is that some derived class D has all the members of its base class B. Once D is not hiding any of the public members of B, then an object of D can represent B in any context where a B could be used. This feature is known as subtype polymorphism. 8. Message Passing: It is a form of communication used in object-oriented programming as well as parallel programming. Objects communicate with one another by sending and receiving information to each other. A message for an object is a request for execution of a procedure and therefore will invoke a function in the receiving object that generates the desired results. Message passing involves specifying the name of the object, the name of the function, and the information to be sent. Why do we need object-oriented programming To make the development and maintenance of projects more effortless. To provide the feature of data hiding that is good for security concerns. We can solve real-world problems if we are using object-oriented programming. It ensures code reusability. It lets us write generic code: which will work with a range of data, so we don’t have to write basic stuff over and over again. Multi-Paradigm Programming Multi-paradigm programming is the ability to use multiple programming styles, or paradigms, in a single programming language. This allows programmers to solve problems and express ideas in a variety of ways, and to be more flexible and versatile. --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-13 Some of these are: Java, C#, C++, Javascript, Typescript, Python. All of them are marketed as multi-paradigm. They “have” support for OOP, FP, procedural. What happens in reality is actually class-based, which is in its essence procedural in disguise. Long methods, ridden with conditionals, loops, multiple levels of nesting, christmas trees. Classes 500+ lines of code long, mostly singleton services, managed by a IOC container. You get the worst of both worlds — the bad performance of high-level languages and the bad maintainability of procedural languages. Introduction to Arduino Programming What is Arduino? Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing. Over the years Arduino has been the brain of thousands of projects, from everyday objects to complex scientific instruments. A worldwide community of makers - students, hobbyists, artists, programmers, and professionals - has gathered around this open- source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike. Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping, aimed at students without a background in electronics and programming. As soon as it reached a wider community, the Arduino board started changing to adapt to new needs and challenges, differentiating its offer from simple 8-bit boards to products for IoT applications, wearable, 3D printing, and embedded environments. Why Arduino? Thanks to its simple and accessible user experience, Arduino has been used in thousands of different projects and applications. The Arduino software is easy-to-use for beginners, yet flexible enough for advanced users. It runs on Mac, Windows, and Linux. Teachers and students use it to build low cost scientific instruments, to prove chemistry and physics principles, or to get started with programming and robotics. Designers and architects build interactive prototypes, musicians and artists use it for installations and to experiment with new musical instruments. Makers, of course, use it to build many of the projects exhibited at the Maker Faire, for example. Arduino is a key tool to learn new things. Anyone - children, hobbyists, artists, programmers - can start tinkering just following the step by step instructions of a kit, or sharing ideas online with other members of the Arduino community. There are many other microcontrollers and microcontroller platforms available for physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-14 Handyboard, and many others offer similar functionality. All of these tools take the messy details of microcontroller programming and wrap it up in an easy-to-use package. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, students, and interested amateurs over other systems: Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller platforms. The least expensive version of the Arduino module can be assembled by hand, and even the pre-assembled Arduino modules cost less than \$50 Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows. Simple, clear programming environment - The Arduino Software (IDE) is easy-to- use for beginners, yet flexible enough for advanced users to take advantage of as well. For teachers, it's conveniently based on the Processing programming environment, so students learning to program in that environment will be familiar with how the Arduino IDE works. Open source and extensible software - The Arduino software is published as open source tools, available for extension by experienced programmers. The language can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from Arduino to the AVR C programming language on which it's based. Similarly, you can add AVR-C code directly into your Arduino programs if you want to. Open source and extensible hardware - The plans of the Arduino boards are published under a Creative Commons license, so experienced circuit designers can make their own version of the module, extending it and improving it. Even relatively inexperienced users can build the breadboard version of the module in order to understand how it works and save money. Python Programming Language Python is a widely used programming language that offers several unique features and advantages compared to languages like Java and C++. Our Python tutorial thoroughly explains Python basics and advanced concepts, starting with installation, conditional statements, loops, built-in data structures, Object-Oriented Programming, Generators, Exception Handling, Python RegEx, and many other concepts. This tutorial is designed for beginners and working professionals. In the late 1980s, Guido van Rossum dreamed of developing Python. The first version of Python 0.9.0 was released in 1991. Since its release, Python started gaining popularity. According to reports, Python is now the most popular programming language among developers because of its high demands in the tech realm. --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-15 What is Python Python is a general-purpose, dynamically typed, high-level, compiled and interpreted, garbage-collected, and purely object-oriented programming language that supports procedural, object-oriented, and functional programming. Features of Python: o Easy to use and Read - Python's syntax is clear and easy to read, making it an ideal language for both beginners and experienced programmers. This simplicity can lead to faster development and reduce the chances of errors. o Dynamically Typed - The data types of variables are determined during run- time. We do not need to specify the data type of a variable during writing codes. o High-level - High-level language means human readable code. o Compiled and Interpreted - Python code first gets compiled into bytecode, and then interpreted line by line. When we download the Python in our system form org we download the default implement of Python known as CPython. CPython is considered to be Complied and Interpreted both. o Garbage Collected - Memory allocation and de-allocation are automatically managed. Programmers do not specifically need to manage the memory. o Purely Object-Oriented - It refers to everything as an object, including numbers and strings. o Cross-platform Compatibility - Python can be easily installed on Windows, macOS, and various Linux distributions, allowing developers to create software that runs across different operating systems. o Rich Standard Library - Python comes with several standard libraries that provide ready-to-use modules and functions for various tasks, ranging from web development and data manipulation to machine learning and networking. o Open Source - Python is an open-source, cost-free programming language. It is utilized in several sectors and disciplines as a result. Python has many web-based assets, open-source projects, and a vibrant community. Learning the language, working together on projects, and contributing to the Python ecosystem are all made very easy for developers. What is Raspberry Pi? Raspberry Pi is a small single board computer. By connecting peripherals like Keyboard, mouse, display to the Raspberry Pi, it will act as a mini personal computer. Raspberry Pi is popularly used for real time Image/Video Processing, IoT based applications and Robotics applications. Raspberry Pi is slower than laptop or desktop but is still a computer which can provide all the expected features or abilities, at a low power consumption. OS for Raspberry Pi Raspberry Pi Foundation officially provides Debian based Raspbian OS. Also, they provide NOOBS OS for Raspberry Pi. We can install several Third-Party versions of OS like Ubuntu, Archlinux, RISC OS, Windows 10 IOT Core, etc. --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-16 Raspbian OS is official Operating System available for free to use. This OS is efficiently optimized to use with Raspberry Pi. Raspbian have GUI which includes tools for Browsing, Python programming, office, games, etc. We should use SD card (minimum 8 GB recommended) to store the OS (operating System). Raspberry Pi is more than computer as it provides access to the on-chip hardware i.e. GPIOs for developing an application. By accessing GPIO, we can connect devices like LED, motors, sensors, etc and can control them too. Raspberry Pi processor It has ARM based Broadcom Processor SoC along with on-chip GPU (Graphics Processing Unit). The CPU speed of Raspberry Pi varies from 700 MHz to 1.2 GHz. Also, it has on-board SDRAM that ranges from 256 MB to 1 GB. Raspberry Pi also provides on-chip SPI, I2C, I2S and UART modules. History of Raspberry Pi Software developer Eben Upton and Software Engineers Pete Lomas and David Braden formed the Raspberry Pi foundation in 2006. The main aim of this foundation was to devise a computer to inspire children. Hence, in order to reduce the cost, the early prototypes of the Raspberry Pi were based on the 8-bit Atmel ATmega microcontroller. On February 29th, 2012, the team started taking the orders for Model B and in the same year, they started its production run which consisted of around 10,000 units. These models were manufactured by the founders in China and Taiwan. On February 4th, 2013, they started taking the orders for lower cost Model A. Similarly, on November 10th, 2014, the team launched for even more low-cost Model A+. The cheapest Raspberry Pi Zero was launched on November 26th, 2015. The name Raspberry Pi was chosen with “Raspberry” as an ode to tradition of naming early computer companies after fruit. Here, "Pi" is for Python Programming Language. 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. --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-17 The following diagram shows the architecture of Raspberry Pi: The following diagram shows some main blocks of Raspberry Pi: Raspberry Pi mainly consists of the following blocks/components: 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. --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-18 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. Link for application and how to use the Raspberry Pi https://www.javatpoint.com/applications-of-raspberry-pi --------------------------------------------------------------------------------------------------------------------- Internet of Things (Unit-III) Developed by Prof. Ratna Biswas Page-19