Professional Documents
Culture Documents
Devices
© Kalasalingam academy of research and education
Course Outline
CO1: : Distinguish between the different concepts of
IoT for its applications.
0 0 0 0 8 1000 10 8
1 1 1 1 9 1001 11 9
2 10 2 2 10 1010 12 A
3 11 3 3 11 1011 13 B
4 100 4 4 12 1100 14 C
5 101 5 5 13 1101 15 D
6 110 6 6 14 1110 16 E
7 111 7 7 15 1111 17 F
Decimal Octal
Binary Hexadecimal
Note the difference between the XOR gate and the OR gate; they
differ only in one input situation.
When both input signals are 1, the OR gate produces a 1 and the XOR
produces a 0
XOR is called the exclusive OR
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Introduction to microcontrollers and microprocessors
What is a Microprocessor?
A microprocessor is a controlling unit of a micro-computer wrapped inside a small chip.
It performs Arithmetic Logical Unit (ALU) operations and communicates with the other devices connected
with it. It is a single Integrated Circuit in which several functions are combined.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Introduction to microcontrollers and microprocessors
What is Microcontroller?
A microcontroller is a chip optimized to control electronic devices.
It is stored in a single integrated circuit which is dedicated to performing a particular task and execute one
specific application.
It is specially designed circuits for embedded applications and is widely used in automatically controlled
electronic devices. It contains memory, processor, and programmable I/O.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Introduction to microcontrollers and microprocessors
Microprocessor Microcontroller
Microprocessor is the heart of Computer system. Micro Controller is the heart of an embedded
system.
It is only a processor, so memory and I/O Micro Controller has a processor along with internal
components need to be connected externally memory and I/O components.
Memory and I/O has to be connected externally, so Memory and I/O are already present, and the
the circuit becomes large. internal circuit is small.
You can't use it in compact systems You can use it in compact systems.
Cost of the entire system is high Cost of the entire system is low
Due to external components, the total power As external components are low, total power
consumption is high. Therefore, it is not ideal for the consumption is less. So it can be used with devices
devices running on stored power like batteries. running on stored power like batteries.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Introduction to microcontrollers and microprocessors
Microprocessor Microcontroller
Most of the microprocessors do not have power Most of the microcontrollers offer power-saving
saving features. mode.
It is mainly used in personal computers. It is used mainly in a washing machine, MP3 players,
and embedded systems.
Microprocessor has a smaller number of registers, so Microcontroller has more register. Hence the
more operations are memory-based. programs are easier to write.
Microprocessors are based on Von Neumann model Micro controllers arc based on Harvard architecture
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Introduction to microcontrollers and microprocessors
Microprocessor Microcontroller
It has no RAM, ROM, Input-Output units, timers, and It has a CPU along with RAM, ROM, and other
other peripherals on the chip. peripherals embedded on a single chip.
It uses an external bus to interface to RAM, ROM, and It uses an internal controlling bus.
other peripherals.
Microprocessor-based systems can run at a very high Microcontroller based systems run up to 200MHz or
speed because of the technology involved. more depending on the architecture.
It's used for general purpose applications that allow It's used for application-specific systems.
you to handle loads of data.
It's complex and expensive, with a large number of It's simple and inexpensive with less number of
instructions to process. instructions to process.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Introduction to microcontrollers and microprocessors
Applications of Microprocessor
Calculators
Accounting system
Games machine
Complex industrial controllers
Traffic light
Control data
Military applications
Defense systems
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Introduction to microcontrollers and microprocessors
Applications of Microcontroller
Mobile phones
Automobiles
CD/DVD players
Washing machines
Cameras
Security alarms
Keyboard controllers
Microwave oven
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Unit 2 Outline & Course in Progress
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Different microcontrollers
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 33
Different microcontrollers
The microcontrollers are characterized regarding bus-width, instruction set, and memory structure.
For the same family, there may be different forms with different sources.
8-bit microcontroller
16-bit microcontroller
32-bit microcontroller
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Different microcontrollers
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Different microcontrollers
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Different microcontrollers
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Different microcontrollers
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Different microcontrollers
Harvard Architecture:
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Different microcontrollers
AVR: AVR microcontroller is developed by Atmel service provider, AVR architecture is based on the Harvard architecture. It is
based on Reduced Instruction Set Computers(RISC). AVR is not an acronym it is just a name given to the RISC architecture based
microcontroller.
PIC: PIC microcontroller is also a Harvard architecture-based controller. PIC is an acronym stands for "Peripheral Interface
Controller". This type of microcontroller supports programming in C, Assembly and BASIC C.
Hitachi: Hitachi microcontroller belongs to H8 family of the controller. H8 is name used in large family of 8-bit, 16-bit and 32-bit
microcontroller developed by Renesas Technology, founded in an early 1990s within Hitachi semiconductors.
Motorola: Motorola microcontroller is highly integrated microcontroller that is used for high-performance data manipulation
operation. This microcontroller unit uses a System Integration Module (SIM), Time Processing Unit (TPU) and Queued Serial
Module(QSM).
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Arduino UNO & its Architecture
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
Arduino Boards
Arduino board was designed in the Ivrea Interaction Design Institute intended
for students without a background in electronics and programming concepts.
All boards are entirely open-source, allowing users to build them separately
and finally adapt them to their exact needs.
Arduino board has been used for making different engineering projects and
different applications. The Arduino software is very simple to use for beginners,
yet flexible adequate for advanced users. It runs Windows, Linux, and Mac.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICESSSS 43
The Function of the Arduino Board
The flexibility of the Arduino board is enormous so that one can do anything they imagine.
This board can be connected very easily to different modules such as obstacle sensors, presence detectors,
fire sensors, GSM Modules GPS modules, etc.
The main function of the Arduino board is to control electronics through reading inputs & changing it into
outputs because this board works like a tool.
This board is also used to make different electronics projects in the field of electronics, electrical, robotics,
etc.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 44
Advantages
Arduino also makes simpler the working process of microcontroller, but it gives some advantages over other
systems for teachers, students, and beginners.
Inexpensive
Cross-platform
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 45
Types : Arduino Uno (R3) – Pin details
Source : https://www.elprocus.com/
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 46
Types : Arduino Uno (R3)
As compared with other types of Arduino boards, it is very simple to use like the
Arduino Mega type board.
It consists of 14-digital I/O pins, where 6-pins can be used as PWM(pulse width
modulation outputs), 6-analog inputs, a reset button, a power jack, a USB
connection, an In-Circuit Serial Programming header (ICSP), etc.
The code is stored in the flash program memory, whereas the data is stored in the data
memory.
The Atmega328 has 32 KB of flash memory for storing code (of which 0.5 KB is used for the
bootloader), 2 KB of SRAM and 1 KB of EEPROM and operates with a clock speed of 16MHz.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 48
UNO Architecture
Source : https://www.elprocus.com/
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 49
UNO Pin details
Pin Category Pin Name Details
Power Vin, 3.3V, 5V, GND Vin: Input voltage to Arduino when using an external power source.
5V: Regulated power supply used to power microcontroller and other
components on the board.
3.3V: 3.3V supply generated by on-board voltage regulator. Maximum
current draw is 50mA.
GND: ground pins.
Reset Reset Resets the microcontroller.
Analog Pins A0 – A5 Used to provide analog input in the range of 0-5V
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 50
UNO Pin details
Pin Category Pin Name Details
Input/Output Digital Pins 0 - 13 Can be used as input or output pins.
Pins
Serial 0(Rx), 1(Tx) Used to receive and transmit TTL serial data.
External 2, 3 To trigger an interrupt.
Interrupts
PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.
SPI 10 (SS), 11 (MOSI), 12 (MISO) Used for SPI communication.
and 13 (SCK)
Inbuilt LED 13 To turn on the inbuilt LED.
TWI A4 (SDA), A5 (SCA) Used for TWI communication.
AREF AREF To provide reference voltage for input voltage.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 51
UNO Architecture
Source : https://www.elprocus.com/
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 52
UNO Architecture
The 14 digital input/output pins can be used as input or output pins by using pinMode(),
digitalRead() and digitalWrite() functions in arduino programming. Each pin operate at 5V and can
provide or receive a maximum of 40mA current, and has an internal pull-up resistor of 20-50 KOhms
which are disconnected by default.
Out of these 14 pins, some pins have specific functions as listed below:
Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL serial data.
They are connected with the corresponding ATmega328P USB to TTL serial chip.
External Interrupt Pins 2 and 3: These pins can be configured to trigger an interrupt on a low value,
a rising or falling edge, or a change in value.
PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using analogWrite()
function.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 53
UNO Architecture
SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI communication.
In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13 is HIGH – LED is on and
when pin 13 is LOW, its off.
Along with 14 Digital pins, there are 6 analog input pins, each of which provide 10 bits of resolution,
i.e. 1024 different values. They measure from 0 to 5 volts but this limit can be increased by using
AREF pin with analog Reference() function.
Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using Wire library.
Arduino Uno has a couple of other pins as explained below:
AREF: Used to provide reference voltage for analog inputs with analogReference() function.
Reset Pin: Making this pin LOW, resets the microcontroller.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 54
UNO Architecture
The basic working of CPU of ATmega328:-
The data is uploaded in serial via the port (being uploaded from the computer’s Arduino IDE). The data is
decoded and then the instructions are sent to instruction register and it decodes the instructions on the
same clock pulse.
On the next clock pulse the next set of instructions are loaded in instruction register.
In general purpose registers the registers are of 8-bit but there are 3 16-bit registers also.
8-bit registers are used to store data for normal calculations and results.
16-bit registers are used to store data of timer counter in 2 different register. E.g., X-low & X-high.
They are fast and are used to store specific hardware functions.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 55
UNO Architecture
The basic working of CPU of ATmega328 (Contd…..):-
EEPROM stores data permanently even if the power is cut out. Programming inside a EEPROM is slow.
Interrupt Unit checks whether there is an interrupt for the execution of instruction to be executed in ISR
(Interrupt Service Routine).
Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between microcontrollers
and small peripherals such as Camera, Display, SD cards, etc. It uses separate clock and data lines, along
with a select line to choose the device you wish to talk to.
Watchdog timer is used to detect and recover from MCU malfunctioning.
Analog comparator compares the input values on the positive and negative pin, when the value of positive
pin is higher the output is set.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 56
UNO Architecture
The basic working of CPU of ATmega328 (Contd…..):-
Status and control is used to control the flow of execution of commands by checking other blocks inside
the CPU at regular intervals.
ALU (Arithmetic and Logical unit)The high performance AVR ALU operates in direct connection with all
the 32 general purpose working registers. Within a single clock cycle, arithmetic operations b/w general
purpose registers are executed. The ALU operations are divided into 3 main categories – arithmetic,
logical and bit-function.
I/O pins The digital inputs and outputs (digital I/O) on the Arduino are what allow you to connect the
Arduino sensors, actuators, and other ICs. Learning how to use them will allow you to use the Arduino to
do some useful things, such as reading switch inputs, lighting indicators, and controlling relay outputs.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 57
ADC and DAC
Connecting digital circuitry to sensor devices is simple if the sensor devices are inherently digital themselves.
Switches, relays, and encoders are easily interfaced with gate circuits due to the on/off nature of their
signals.
However, when analog devices are involved, interfacing becomes much more complex.
What is needed is a way to electronically translate analog signals into digital (binary) quantities, and vice
versa.
An analog-to-digital converter, or ADC, performs the former task while a digital-to-analog converter, or DAC,
performs the latter.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 58
Unit 2 Outline & Course in Progress
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
ADC
An ADC inputs an analog electrical signal such as voltage or current and outputs a binary number. In block
diagram form, it can be represented as such:
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 61
ADC
Connecting digital circuitry to sensor devices is simple if the sensor devices are inherently digital
themselves.
Switches, relays, and encoders are easily interfaced with gate circuits due to the on/off nature of their
signals.
However, when analog devices are involved, interfacing becomes much more complex. What is needed is a
way to electronically translate analog signals into digital (binary) quantities, and vice versa.
An analog-to-digital converter, or ADC, performs the former task while a digital-to-analog converter, or DAC,
performs the latter.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 62
ADC : IC - ADC0808/0809
This eliminates the need for external zero and full-scale adjustments.
ADC0808 is a monolithic CMOS device, offers high speed, high accuracy, minimal temperature
dependence, excellent long-term accuracy and repeatability and consumes minimal power.
These features make this device ideally suited to applications from process and machine control to
consumer and automotive applications.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 63
ADC : IC - ADC0808/0809
Source: https://www.eeeguide.com/
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 64
ADC : IC - ADC0808/0809
Pin Number Pin Name Description
1 to 5, These 7 pins are the input pins for Analog
Analog Channel 1 to 5 voltage(sensor).
27, 28
This is an input pin which is made high to start
6 START
conversion.
End of Conversion This is an output pin which goes high once the conversion
7
(EOC) is over.
8,14,15,18, Output digital pins which gives the result of the ADC
Output (2-1 to 2-7) conversion.
19,20,21
Must be made high to get output on output pins.
9 OUT EN
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 65
ADC : IC - ADC0808/0809
22 Address Latch Enable(ALE) This pin is should be temporarily made high to select ADC
channel.
23,24,25 ADD A, ADD B, ADD C These three pins are used to select the channel
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 66
ADC : IC - ADC0808/0809 - Usage
ADC0808 Features
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 67
ADC : IC - ADC0808/0809 - Usages
The ADC0808 IC is a commonly used ADC module for projects where an external ADC is required.
It is a 28-pin Eight channel 8-bit ADC module.
Meaning it can measure up to eight ADC value from 0V to 5V and the precision when voltage
reference (Vref –pin 9) is +5V is 19.53mV (Step size).
That is for every increase of 19.53mV on input side there will be an increase of 1 bit at the output
side.
This IC is very Ideal to use with Microprocessors like Raspberry Pi, Beagle bone etc.. Or even to
use as a standalone ADC module.
Every ADC module requires a clock to function; this IC requires an external clock pulse to work.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 68
DAC
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
DAC
A DAC, on the other hand, inputs a binary number and outputs an analog voltage or current signal. In block
diagram form, it looks like this:
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 70
DAC : IC - DAC0808
DAC0808 is a D/A converter IC and is used for converting 8 bit digital data input to analog signal
output.
It is a monolithic IC featuring a full scale output current settling time of 150 ns while dissipating
only 33 mW with ±5V supplies.
The chip accuracy of conversion is good and power consumption is also low to make it popular.
The power supply currents of the DAC0808 are independent of bit codes, and exhibits essentially
constant device characteristics over the entire supply voltage range.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 71
DAC : IC - DAC0808
Source: https://www.eeeguide.com/
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 72
DAC : IC - DAC0808 – Pin details
Pin number Pin Name Description
1 NC No connection
2 GND Ground Pin
3 VEE Negative (-ve) power supply
4 IO Input/Output signal pin
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 73
DAC : IC - DAC0808 – Pin details
Pin number Pin Name Description
9 A5 Digital i/p bit-5
10 A6 Digital i/p bit-6
11 A7 Digital i/p bit-7
12 A8 Digital i/p bit-8 (Least Significant Bit)
13 VCC Positive (+ve) power supply
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 74
DAC : IC - DAC0808 – Features
Features of IC DAC0808
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 75
DAC : IC - DAC0808 – Features
Features of IC DAC0808
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 76
DAC : IC - DAC0808 – Applications
Conversion of Audio
Electrical measurements
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 77
ADC and DAC
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
ADC and DAC
Together, they are often used in digital systems to provide complete interface with analog sensors and
output devices for control systems such as those used in automotive engine controls:
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 79
Example of ADC/DAC conversion
In modern life, Analog to Digital Converter (ADC) and Digital to Analog Converter (DAC) are very important
components in electronic equipment.
Take the audio signal processing in Figure as an example, ADC converts the analog signal collected by audio
input equipment, such as a microphone, into a digital signal that can be processed by computer. The
computer may add sound effect such as echo and adjust the tempo and pitch of the music. DAC converts the
processed digital signal back into the analog signal that is used by audio output equipment such as a speaker.
Source: http://www.cmm.gov.mo/
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES 80
Unit 2 Outline & Course in Progress
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES
What is Pulse Width Modulation ?
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.
This on-off pattern can simulate voltages in between the full VCC of the board (e.g., 5 V on Uno, 3.3 V on a MKR
board) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal
spends off.
The duration of "on time" is called the pulse width. To get varying analog values, you change, or modulate, that
pulse width.
The Fading example demonstrates the use of analog output (PWM) to fade an LED. It is available in the File-
>Sketchbook->Examples->Analog menu of the Arduino software.
Once you get this example running, grab your arduino and shake it back and forth.
What you are doing here is essentially mapping time across the space.
To our eyes, the movement blurs each LED blink into a line. As the LED fades in and out, those little lines will
grow and shrink in length.
Control Pins EN, RST The pin and the button resets the microcontroller
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere,
magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna.
© Kalasalingam academy of research and education COURSE NAME : IOT – SENSORS AND DEVICES