0% found this document useful (0 votes)
18 views8 pages

Iot A&r Unit-3 PNP

Uploaded by

patelatharv5116
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views8 pages

Iot A&r Unit-3 PNP

Uploaded by

patelatharv5116
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

INTERNET OF THINGS (4351703)

UNIT-III HARDWARE FOR IOT

INTRODUCTION TO MICROPROCESSORS AND MICROCONTROLLERS:

1) What is a Microprocessor?
In simple words, The microprocessor is useful in very intensive processes. It only
contains a CPU (central processing unit) but there are many other parts needed to
work with the CPU to complete a process. These all other parts are connected
externally.

Microprocessors are not made for a specific task as well as they are useful where
tasks are complex and tricky like the development of software, games, and other
applications that require high memory and where input and output are not defined.

A **microprocessor** is a central component of a computer or electronic device,


often referred to as the **CPU (Central Processing Unit)**. It is a **silicon-based
integrated circuit (IC)** that executes instructions and processes data, acting as
the brain of the system. Microprocessors perform arithmetic, logical, control,
and input/output operations specified by the instructions of a computer
program.

Key Functions:

1. **Fetch**: The microprocessor retrieves instructions from memory.

2. **Decode**: It interprets the instruction and prepares for execution.

3. **Execute**: The microprocessor performs the necessary operations (e.g., adding


two numbers).

4. **Store**: Results of the operation are stored back in memory or registers.

Characteristics:

- **Clock Speed**: Measured in GHz, it determines how fast the microprocessor can
execute instructions.

- **Core Count**: Modern microprocessors have multiple cores (dual-core, quad-core,


etc.), allowing for parallel processing.

- **Instruction Set**: The collection of commands the microprocessor can execute,


such as x86 or ARM architecture.

Examples:

- **Intel Core i7**

- **AMD Ryzen**

- **ARM Cortex-A**
Microprocessors are used in a variety of devices, including personal computers,
smartphones, cars, and industrial machines.

For eg.

A) Household devices: Complex home security, Home computers, Video game


systems and many more.

B) Transportation and Industrial Devices:

Automobiles, trains, planes, Computer servers, high tech medical devices, etc.

2) What is Microcontroller?
The microcontroller is designed for a specific task or to perform the assigned task
repeatedly. Once the program is embedded on a microcontroller chip, it can’t be
altered easily and you may need some special tools to reburn it. As per application,
the process is fixed in microcontroller. Hence, the output depends on the input given
by the user or sensors or predefined inputs.

The applications easily connect with concepts, so let's find out day to day life
examples

e.g. Calculator, Washing Machine, ATM machine, Robotic Arm, Camera, Microwave
oven, Oscilloscope, Digital multimeter, ECG Machine, Printer so on and so forth.

A **microcontroller** is a compact integrated circuit designed to perform a


specific function in an embedded system. It includes a **microprocessor
(CPU)**, as well as memory (RAM and ROM), input/output (I/O) ports, and other
eripherals like timers and communication interfaces, all on a single chip.

Key Features:

1. **CPU**: Executes the program instructions.

2. **Memory**:

**RAM**: Temporary storage for data during processing.

**ROM (or Flash memory)**: Stores the program code and data.

3. **I/O Ports**: Allows the microcontroller to interact with external devices like
sensors, motors, and displays.

4. **Peripherals**: Includes timers, counters, and communication interfaces like UART,


SPI, or I2C.

Common Uses:

**Embedded Systems**: Microcontrollers are used in devices where a simple,


dedicated task is required (e.g., controlling a washing machine, microwave, or car
engine).

**IoT Devices**: Many Internet of Things devices use microcontrollers to manage


sensors and communications.
- **Robotics**: Microcontrollers control motors, sensors, and decision-making
systems in robots.
Examples:
- **Arduino**: Popular for hobbyist electronics and DIY projects.
- **Raspberry Pi Pico**: A low-cost microcontroller.
- **PIC** or **AVR** microcontrollers: Widely used in industrial applications.
Differences Between a Microcontroller and a Microprocessor:
- **Microcontroller**: Typically used in embedded systems where a small, low-
power device needs to control specific hardware.
- **Microprocessor**: More general-purpose and used in complex systems like
personal computers and smartphones.
3) Difference between microprocessor and microcontroller:

We can see microprocessor is part of a microcontroller with extra memory, I/O ports,
and peripherals such as timer and counters.

Microcontroller Vs Microprocessor:
Sr.
Microprocessor Microcontroller
No

The presence of peripherals such as RAM,


We need to connect peripherals externally. So
1. ROM, Input-output, and Timers are In-built.
it makes circuit bulky.
So It is available on a single chip.

2. It increases the overall cost of the system high. The overall cost of the system is less.

We can connect external memory in ranges of The inbuilt finite memory helps to improve
3.
Mbytes and even Gbytes. But speed is less. the speed of operations.

4. You can't use it in a compact system. You can use it in compact systems.

Due to external components, the total power As external components are low, total power
consumption is high. Therefore, it is not ideal consumption is less. So it can be used with
5.
for the devices running on stored power like devices running on stored power like
batteries. batteries.

Most of the microprocessors do not have Most of the microcontrollers offer power-
6.
power-saving features. saving mode.

The microprocessor has a smaller number of


The microcontroller has more register.
7. registers, so more operations are memory-
Hence the programs are easier to write.
based.

These are based on the von Neumann model These are based on Harvard architecture
8. where program and data are stored in the same where program memory and data memory
memory module. are separate.

It is a byproduct of the development of


It is a central processing unit on a single
9. microprocessors with a CPU along with
silicon-based integrated chip.
other peripherals.
It uses an external bus to interface to RAM,
10 It uses an internal controlling bus.
ROM, and other peripherals.

Microprocessor-based systems can run at a Microcontroller based systems run up to


11 very high speed because of the technology 200MHz or more depending on the
involved. architecture.

It's useful for general purpose applications that


12 It's useful for application-specific systems.
allow you to handle loads of data.

It's complex and expensive, with a large It's simple and inexpensive with less number
13
number of instructions to process. of instructions to process.

Concept of Clock in Microprocessor and Microcontroller:

The clock in a microprocessor is an internal timing device that regulates the speed at
which the processor executes instructions. The clock's speed, also known as the clock
rate or clock speed, is a key specification for a CPU. It's measured in hertz (Hz), which
is the SI unit of frequency, or in gigahertz (GHz) or megahertz (MHz). A higher clock
speed generally means a faster CPU.
Every microprocessor has an internal clock that regulates the speed at which it
executes instructions and also synchronizes it with other components. The speed at
which the microprocessor executes instructions is called clock speed.

RAM and ROM:


RAM (random access memory) and ROM (read-only memory) are both types of
memory, but they differ in how they store data and how they respond to power being
turned off:
RAM
RAM is volatile memory that temporarily stores data that's currently being used, like
application programs and the operating system. RAM is generally faster than ROM
because it can perform both read and write operations. RAM's contents are erased
when the power is turned off.
 It’s volatile, meaning it loses its contents when the power is turned off
 RAM is used to store data that the CPU needs to access quickly
 It allows for both reading and writing of data
 More RAM generally means better performance, especially for multitasking
How RAM Works
When you open an application or file, it gets loaded into RAM. This allows your
computer to access this data much faster than if it had to read it from the hard drive
each time. The more RAM you have, the more applications and files your computer
can keep readily accessible.
Types of RAM
There are two main types of RAM used in modern computers:
1. SRAM (Static RAM):
Faster but more expensive
Used for cache memory in CPUs
2. DRAM (Dynamic RAM):
Slower but less expensive than SRAM
Used for main memory in computers
The most common type of RAM in modern computers is DDR SDRAM (Double Data
Rate Synchronous Dynamic RAM). This technology has evolved through several
generations:
DDR2
DDR3
DDR4
DDR5 (the latest standard)
Each new generation offers improvements in speed and energy efficiency.
ROM
ROM is non-volatile memory that permanently stores instructions for the computer,
such as the BIOS settings on the motherboard. ROM can only perform read
operations, and its contents are retained even when the power is off. ROM is not
designed for easy modification or upgrading.

The amount of ROM in a typical computer is much smaller than RAM or hard drive
space. Most computers have a few megabytes of ROM, which is sufficient for storing
the BIOS or UEFI firmware.
 It’s non-volatile, meaning it retains data even when the power is off
 ROM typically stores firmware or software that rarely changes
 It’s generally slower than RAM but faster than a hard drive
 Data in ROM is “read-only” and not easily modified.
ROM plays a crucial role in your computer’s startup process. It stores the BIOS (Basic
Input/Output System) or UEFI (Unified Extensible Firmware Interface), which is the
first software run when you turn on your computer and initializes hardware
components. This software initiates the boot process and helps load the operating
system.
Types of Programmable Read Only Memory
There are several types of ROM, each with its own characteristics:
1.PROM (Programmable Read-Only Memory):
Can be programmed once after manufacture
Programming requires a special device
2. EPROM (Erasable Programmable Read-Only Memory):
Can be erased and reprogrammed using ultraviolet light
Recognizable by the transparent “window” on the chip
EPROM chips are programmed using high voltages to modify memory cells and store
data
3. EEPROM (Electrically Erasable Programmable Read-Only Memory):
Can be electrically erased and reprogrammed
Allows for selective erasing and reprogramming
Also known as electrically erasable programmable rom, it is versatile in static data
storage and updatable firmware
4. Flash ROM:
A type of EEPROM that can be erased and rewritten in blocks
Commonly used in USB drives and solid-state drives (SSDs)
Additionally, mask ROM is a specific type of ROM that cannot be modified after
manufacturing, underscoring its importance in hard-wired memory.

Key Differences Between RAM and ROM

Feature RAM ROM

Volatile (loses data when Non-volatile (retains data when


Volatility
powered off) powered off)

Read/Write Can be read from and written to Primarily read-only


Slower than RAM, but faster than hard
Speed Faster
drives

Generally larger (measured in


Capacity Typically smaller (measured in MB)
GB)

Temporary data storage for active Permanent storage for essential


Usage
processes instructions

Cost More expensive per GB Less expensive per GB

Accessibilit
Directly accessible by CPU Not directly accessible by CPU
y

Data
Short-term Long-term
Retention

Peripherals:
A peripheral is a separate piece of circuitry that's connected to a microprocessor to
offload work from it. Peripherals are also known as input/output (I/O) devices, and they
can be used to communicate with the outside world.

Examples of such devices are printers, display monitor, hard and floppy disk
memories, keyboard. The activity of the controller is supervised by the
microprocessor, which intervenes on each transfer of data by execution of respective
instructions of data read or write from (to) the controller.

Introduction to Arduino Board Mega2560, GPIO in Mega2560:

Arduino Mega 2560 is a development electronic board based on the Atmega2560


microcontroller. This board is a good match for projects that require more GPIO pins
and memory space because it carries 16 analog pins and 54 digital I/O pins out of
which 15 pins are used for PWM output.

The Arduino programming language is based on C++.


The GPIO is commonly used to write and read the pin state. GPIO stands to General
Purpose Input Output, and is responsible to control or read the state of a specific pin
in the digital world. For example, this peripheral is widely used to create the LED
blinking or to read a simple button.

Pins:
It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16
analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB
connection, a power jack, an ICSP header, and a reset button.

5V: This pin outputs a regulated 5V from the regulator on the board. The board can
be supplied with power either from the DC power jack (7 - 12V), the USB connector
(5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins
bypasses the regulator, and can damage your board.

There are a total of 28 pins. There are 14 digital pins including TX(Transmission) and
RX(Receiver) pins, There are 6 analog pins, 3 ground pins, 1 Analog Reference
(AREF) pin, 1 Reset pin, 1 Vin pin, 1 3.3V pin and 1 5V pin.

The Arduino Uno pinout consists of 14 digital input/output pins, 6 analog inputs, a
power jack, USB connection and a ICSP header. The versatility of the pinout
provides applications of many different options such as driving motors, LEDs,
reading sensors and more.

The Mega 2560 can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non-USB) power can
come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be
connected by plugging a 2.1mm center-positive plug into the board's power jack.
The Official Arduino Mega 2560 is a Rev3 development board based on
the ATmega2560 microcontroller.

5 ground pins
Pin 3.3V & 5V: This pins are used to provide regulated power supply to the Mega
2560 board. GND Pin: Total 5 ground pins are provided on the Mega 2560 board.

What is the RAM of Arduino Mega 2560?


The ATmega2560 has 256 KB of flash memory for storing code (of which 8 KB is
used for the bootloader), 8 KB of SRAM and 4 KB of EEPROM (which can be read
and written with the EEPROM library).

What is the input voltage for Mega 2560?


The board can operate on an external supply of 6 to 20 volts. If supplied with less
than 7V, however, the 5V pin may supply less than five volts and the board may be
unstable. If using more than 12V, the voltage regulator may overheat and damage
the board. The recommended range is 7 to 12 volts.

Why choose Arduino Mega 2560?


The Flash memory on the Uno and Micro are the same at 32 kB, while the Mega
2560 has 256 kB, giving it 8x more memory space! The Flash memory simply means
how big of a sketch/code you can upload to your Arduino, therefore if you have a
hefty code the Mega 2560 is the way to go.

What is PWM in Arduino?


Pulse Width Modulation, or PWM, is a technique for getting analog results with digital
means. Digital control is used to create a square wave, a signal switched between
on and off.

Does Arduino Mega 2560 have EEPROM?


The supported micro-controllers on the various Arduino and Genuino boards have
different amounts of EEPROM: 1024 bytes on the ATmega328P, 512 bytes on the
ATmega168 and ATmega8, 4 KB (4096 bytes) on the ATmega1280 and
ATmega2560. The Arduino and Genuino 101 boards have an emulated EEPROM
space of 1024 bytes.

List functions for Arduino programming:


a. Loop function
b. Setup function
c. Control Structure
d. Arithmetic Operators
e. Comparison Operators
f. Boolean Operators

You might also like