Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...
1. IOT LAB
Course Objectives:
1. Able to understand the application areas of IOT.
2. To acquire the knowledge and realize the revolution of Internet and Sensor Networks.
3. To acquire knowledge in designing, creating and deploying the real-time applications of IOT.
Course Outcomes:
After completion of this course, the students will be able to:
CO-1: Describe the embedded systems with Arduino environment and Raspberry Pi platforms.
CO-2: Analyze the designing, building and testing microcontroller based embedded Network Systems in
modeling real world.
CO-3: Identify the appropriate cloud architectures and applications to deploy models in different domains.
CO-4: Create, Design and deploy IOT devices using Arduino and Raspberry Pi applications.
Prerequisite(s):Network Standards, Network Protocols, Network Technologies.
2. IOT EXPERIMENT – 2
Arduino Simulation Environment & Raspberry Pi Environment:
1. Arduino & Raspberry Pi Architecture,
2. Setup the IDE, Writing Arduino Software, Installing Raspberry OS,
3. Arduino Libraries, Raspberry commands,
4. Basics of Embedded Programming for Arduino & Raspberry pi,
5. Interfacing LED, push button and buzzer with Arduino & Raspberry, and
6. Interfacing Arduino with LCD.
3. 1. Arduino & Raspberry Pi Architecture
Microprocessor & Microcontroller
Microprocessor consists of only a Central Processing Unit, whereas
Micro Controller contains a CPU, Memory, I/O all integrated into one
chip.
The microprocessor is useful in Personal Computers whereas Micro
Controller is useful in an embedded system.
Microprocessor
A microprocessor is basically the brain of the computer. We can also
call it simply a processor or CPU.
Furthermore, a microprocessor is basically a computer processor that
is mounted on a single IC (Integrated Circuit). It means that all the
functions of the processor are included on a single chip.
4. 1. Arduino & Raspberry Pi Architecture [Cont’d]
A computer's Central Processing Unit (CPU) constructed on a single
Integrated Circuit (IC) is a microprocessor.
A computer with one microprocessor, which functions as a CPU, is a
microcomputer.
Microcontroller
Some examples of it are 8051XA, PIC2x, Intel 8096, etc. 32-bit
Microcontroller:
A 32-bit microcontroller contains a bus width of 32 bits which is 4 bytes
long. The performance & accuracy of such microcontrollers is higher
than any other microcontrollers but they're a bit expensive & consume
lots of power.
5. 1. Arduino & Raspberry Pi Architecture [Cont’d]
There are a wide variety of controller boards that we can use for our
hardware projects.
The two most popular among them are: Arduino and Raspberry Pi.
Arduino is based on the ATmega family and has a relatively simple design and
software structure.
Raspberry Pi, basically is a single-board computer. Both of them have a CPU
which executes the instructions, timers, memory and I/O pins.
The key distinction between the two is that Arduino tends to have a
strong I/O capability which drives external hardware directly.
Whereas, Raspberry Pi has a weak I/O which requires transistors to
drive the hardware.
Let’s see the difference between Arduino and Raspberry Pi :-
22. 1.2. Raspberry Pi Architecture
Introduction
The Raspberry Pi is a mini-computer that can run various operating systems. It is primarily designed to make
computer science easier and fun for young students. Powered by an ARM-based microprocessor, it is also
cheaper than full-fledged desktop or laptop computers. This article will explain everything you need about the
Raspberry Pi models, features, and uses.
The first Raspberry Pi was introduced in 2012 by the Raspberry Pi Foundation. The name “Raspberry” is an
ode to how early computers were named after fruits (Apple, Tangerine Computer Systems, Acorn, and
Apricot Computers). Meanwhile, the “Pi” is short for the Python programming language - one of the most
popular programming languages used with the RPi.
With its credit card size, the RPi is designed to be compact and handy. It has a microSD card where the
operating system is installed, USB ports for connecting peripherals like mouse and keyboard, and a video and
audio output port for monitors and speakers. It also has its own port for connecting the Raspberry Pi camera.
As the years go by, more models with new features have come out. Early models have RCA and 3.5 mm jacks
for video and audio but are now replaced with HDMI (which combines video and audio). There are also
smaller models now like the Raspberry Pi Zero. Another improvement is the higher amount of Random
Access Memory (RAM) for the newer models. Finally, the old ones use a microUSB port for power while the
newest models now feature USB Type C.
24. 1.2. How does Raspberry Pi Work?
Besides running an operating system like an ordinary computer, the Raspberry Pi has a 40-pin General
Purpose Input/Output (GPIO) header. Here we can connect different kinds of devices and sensors that add
more features to the RPi.
The GPIO pins can be written or read programmatically. For example, you can connect a light-emitting diode
(LED) to GPIO 11 (this is how the pins are named) and have it turned on then off. Another example is to
connect a sensor that communicates serially. The RPi is able to read what values the sensor is reading.
You may write your code and run them directly on the Raspberry Pi. If the OS of choice is one of the Linux-
based OSs such as the Raspberry Pi OS, you would write the code in a text editor like Vim and use the
command line to compile and run it.
The capability of the RPi to add a camera, either through its dedicated port or via USB, makes it popular for
image processing applications. OpenCV is easily installed as well as machine learning tools like TensorFlow.
The higher RAM and much-improved microprocessors of newer models have made image processing
through the RPi run smoother than before.
Finally, the WiFi and Bluetooth functionalities of the Raspberry Pi make this mini-computer suitable for
wireless networking projects. Many users have used the RPi for Internet of Things (IoT) projects as well. The
Raspberry Pi is well capable of reading values from temperature and humidity sensors and has those values
readable on an internet browser.
26. 1.2. Types of Raspberry Pi [Top ‘6’ Models] [Cont’d]
As of this writing, there are six top models of the Raspberry Pi that
are or were available in the market. Among these top models are
their respective variations. The models are the following:
1. Raspberry Pi Zero
2. Raspberry Pi 1
3. Raspberry Pi 2 B
4. Raspberry Pi 3
5. Raspberry Pi 4B
6. Raspberry Pi 5
Let us examine these models one by one.
27. 1.2. Types of Raspberry Pi [Top ‘6’ Models] [Cont’d]
Raspberry Pi Zero
The Raspberry Pi Zero has a smaller form factor than the original Raspberry Pi. It still has a
microSD card for the OS, two microUSB ports for power and peripherals, a mini HDMI port for
video output, a camera port, and the same 40-pin GPIO header. The W model for the Raspberry Pi
Zero has added WiFi and Bluetooth capabilities.
A Raspberry Pi Zero 2 is also available in the market with the same form factor as its predecessor
but with an improved processor chip.
Raspberry Pi 1
The very first Raspberry Pi board is available as Model A, B, or B+. The primary difference
between these three models is that the A has only one USB port, the B has two while the B+ has
four. The A also has no ethernet port while both B and B+ have. The B+ also is the first Raspberry
Pi to introduce the 40-pin GPIO header. The A and B only have a 26-pin GPIO header. The original
A model also has a bigger SD card slot compared to the microSD card slot on the newer models.
Raspberry Pi 2 B
The Raspberry Pi 2 Model has a better microprocessor than its predecessor; the original RPi is
running on a 700 MHz single-core chip while the RPi 2 is now on a 900 MHz quad-core processor.
It also now comes with a 1 GB RAM instead of 512 MB. The Raspberry Pi 2 also inherits the
features of the B+ which are the 40-pin GPIO header, the four USB ports, and the microSD card
slot.
28. 1.2. Types of Raspberry Pi [Top ‘6’ Models] [Cont’d]
Raspberry Pi 3
The Raspberry Pi 3’s major improvement is the addition of a built-in WiFi and Bluetooth chip. With it, users
no longer need to plug in a WiFi or a Bluetooth dongle. The RPi 3 also has an improved processor, now
clocking at 1200 MHz.
Raspberry Pi 4B
Continuing the trend, the Raspberry Pi 4B bumps its processing power higher than its predecessor. The 4th
generation of RPi now boasts of a 1.5 GHz quad-core processor. Another new feature for the RPi 4 is the
option to choose between different RAM models. Users can choose between 2, 4, or 8 GB RAM models.
Another obvious improvement is the change from 4 x USB 2.0 ports to 2 x USB 3.0/2x USB 2.0 ports. The
USB 3.0 port offers 10 times the data rate of its predecessor. The RPi 4 now also comes with two micro
HDMI ports which means you can now connect two monitors to it. The RPi 4 is also the first model to use a
USB Type C for its power port.
Raspberry Pi 5
The Raspberry Pi 5 adds more important features to its already impressive predecessor, the RPi 4. First off,
the RPi 5 now has a 2.4 GHz, quad-core processor. Next, The GPU is now improved from a clock speed of
800 MHz to 1.1 GHz.
Another improvement is that the RPi 5 can now play 4K video in both of its micro HDMI ports. In contrast,
only one of the two micro HDMI ports of the RPi 4 can play in 4K resolution.
The RPi 5 also now has a PCI express port for connecting a slew of peripherals, an RTC battery, fan, and
UART connectors, and, for the first time ever, an on-off switch.
29. 1.2. Features of Raspberry Pi
Many features have been added as newer Raspberry Pi models have arrived. But there are common features
among all models which are listed below:
1. Processor (CPU): As already mentioned, Raspberry Pi models use ARM-based processors. Each
generation has its own CPU and corresponding improvements. All models use Broadcom processors
and typically have the prefix “BCM” (e.g. BCM2835, BCM2836, BCM2837, or BCM2711).
2. RAM (Memory): The amount of RAM on a Raspberry Pi varies across models. Older models have
lower RAM compared to newer ones. The lowest is 256MB while the newest has 8GB.
3. GPIO (General-Purpose Input/Output): Raspberry Pi boards include a set of GPIO pins that allow
for interfacing with external devices and components, making it a versatile platform for hardware
projects.
4. USB Ports: Raspberry Pi boards typically come with multiple USB ports for connecting peripherals
such as keyboards, mice, external storage devices, and other USB-compatible devices.
5. Video Output: Most Raspberry Pi models have an HDMI port for connecting to monitors or TVs.
Older models may have composite video or other types of video output.
6. Audio Output: Raspberry Pi boards usually have a 3.5mm audio jack for audio output. HDMI also
supports audio, so sound can be transmitted through an HDMI connection as well.
7. Ethernet Port: Many Raspberry Pi models include an Ethernet port for wired network connectivity.
However, some models rely solely on Wi-Fi for network connectivity.
30. 1.2. Features of Raspberry Pi [Cont’d]
Many features have been added as newer Raspberry Pi models have arrived. But there are common features
among all models which are listed below:
8. Wi-Fi and Bluetooth: Some Raspberry Pi models come with built-in Wi-Fi and Bluetooth
capabilities, enabling wireless network connectivity and communication with Bluetooth-enabled
devices.
9. Storage: Raspberry Pi boards do not have built-in storage but support microSD cards for primary
storage. Newer models might also support booting from USB storage.
10. Camera and Display Ports: Certain Raspberry Pi models have dedicated ports for connecting the
Raspberry Pi Camera Module and the Raspberry Pi Touchscreen Display.
11. OS Support: Raspberry Pi supports a variety of operating systems, including Raspbian (now called
Raspberry Pi OS), Ubuntu, and other Linux distributions. It can also run a special port of Windows
10. Additionally, there are community-supported projects for running different operating systems.
12. Power Supply: Raspberry Pi boards typically use a micro-USB or USB-C connector for power. The
power requirements vary depending on the model. The latest RPi 5 requires 5V and 5A while the
oldest ones only required 5V and 500 mA.
13. Form Factor: Raspberry Pi boards are compact, credit card-sized single-board computers, making
them suitable for a wide range of projects.
34. 1.2.1. What is Raspberry Pi? [Cont’d]
The Raspberry Pi is a debit card-sized low-cost computer that connects to a computer
Desktop or TV and uses a standard mouse and Keyboard.
It has a dedicated processor, memory, and a graphics driver, just like a PC. It also comes
with its operating system, Raspberry Pi OS, a modified version of Linux.
Raspberry Pi can browse the internet and stream high-definition video, as well as
spreadsheets, word processing, and gaming, just like a desktop computer.
The Raspberry Pi can communicate with the outside world and has been used in various
digital maker projects, including music machines and parent detectors, weather stations,
and tweeting birdhouses with infrared cameras.
People worldwide use Raspberry Pi to learn how to program and understand how
computers function.
Although the Raspberry Pi lacks storage, you can use microSD cards to store whichever
operating system you choose (Raspberry Pi, Ubuntu Mate, etc.). Because the Raspberry Pi
has Bluetooth, Ethernet, and WiFi connectivity, it may transfer files over the internet. The
software and the design of the Raspberry Pi project are not open-source.
37. 1.2.2. Usecases of Raspberry Pi [Cont’d]
Desktop (PC)
A simple desktop can be built using a Raspberry Pi, a microSD card, and a power source. An HDMI cable
and a suitable display, such as an old monitor, are also required. You'll also need a USB keyboard and mouse.
Robotics Controller
There are numerous Raspberry Pi robot-controller projects. A specific robotics package for Pi is available,
powered by the device battery, and can interface with and control robots.
Printing Using a Raspberry Pi
With the Raspberry Pi, you can print anything. All you’ll need is a Raspberry Pi that's connected to your
home network, as well as some print server software. First, this is accomplished by installing the Samba file-
sharing program, then CUPS. The Common Unix Printing System (CUPS) includes printer drivers and a
management console.
Game Servers
The basic operating system for the Raspberry Pi has a special version of the Minecraft game pre-installed.
Raspberry Pi applications can be used as a game server. It's a fantastic Minecraft game server. A wonderful
gaming experience can be created by using many Raspberry Pi.
Gaming Machine
As a retro gaming machine, the Raspberry Pi is perfect. It is one of the machine's lightest components. The
Raspberry Pi Zero, in particular, is a variant that can fit into small locations and be used for gaming projects.
The Raspberry Pi may also be used to restore many popular 16-bit game systems.
39. 1.2.3. Types of Raspberry Pi [Cont’d]
Raspberry Pi Zero
It is half the size of model A+ and has twice the utility. It has the same specifications as the
model A+, including a 1GHz single-core CPU, 512MB RAM, Mini-HDMI port, Micro-USB
OTG port, Micro-USB power, HAT-compatible 40-pin header, Composite video and reset
headers, and CSI camera connector for any project (v1.3 only).
Raspberry Pi 2
The Raspberry Pi 2 has a quad-core ARM cortex-A7 processor running at 900MHz and
SDRAM of around 1GB and works with the Raspberry Pi 1 without any issues.
Raspberry Pi Model B
It's a Raspberry Pi with more features. Following the success of the Raspberry Pi, the
following iteration, the Raspberry Pi 2, has been released. The Raspberry Pi Model B's
characteristics are as follows: the Raspberry Pi Model B features two USB ports, 512MB of
RAM, and a 100MB Ethernet connector.
40. 1.2.3. Types of Raspberry Pi [Cont’d]
Raspberry Pi Model A
The Raspberry Pi Model A+ is a more affordable and smaller version of the
Raspberry Pi. It's built around the BCM2835 system-on-chip (SoC), an ARM11
processor, and a powerful GPU. The Raspberry Pi Model A+ is better suited to
embedded and low-power projects without the need for Ethernet or multiple
USB connections.
Raspberry Pi 3 Model B
The Raspberry Pi, 3 model b, is the right solution for strongly linked designs
with wireless LAN and Bluetooth connectivity. Raspberry Pi 3 uses the
cheapest processor available. Single Board Computer powered by a Broadcom
BCM 2837 64-bit ARMv7 Quad-Core processor running at 1200MHz. RAM on
the Raspberry Pi 3 model b is 1GB SDRAM running at 400MHz.
43. 1.2.5. Advantages of Raspberry Pi [Cont’d]
1. The Raspberry Pi is a small computer that is roughly the size of a
credit card.
2. The Raspberry Pi is inexpensive.
3. Using a group of Raspberry Pi’s to function as a server is more
efficient than using a regular server.
4. The Raspberry Pi is ideal for adaptive technology because it can
display visuals and play movies.
5. This microcomputer can be used by small businesses on a tight
budget to use their product or build new technology that integrates
the product.
45. 1.2.6. Disadvantages of Raspberry Pi [Cont’d]
1. It is not a computer replacement, and the processor is not as
fast. Downloading and installing software takes time so that
you won't do any intricate multitasking.
2. Other operating systems, such as Windows, are
incompatible.
3. If the extra work is worth it, business owners should think
about it.
4. This product will not be beneficial for larger businesses that
already have large servers, which can perform all of the
Raspberry Pi tasks. As a result, it would not be worth it, and
putting everything together would take time.
46. 1.2.1. Features of Raspberry Pi
Computer in your Palm,
Single-board Computer,
Low Cost, and
Easy to access.