Chapter 5 Hardware Interfacing

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Chapter 5

hardware interfacing
Prepared : Norhaniza Azreen Bt Mohamed Mokhtar
DEM
1
LCD
( liquid crystal display )
Lcd
 The model described here is for its low price and
great capabilities most frequently used in practice.

 It is based on the HD44780 microcontroller


(Hitachi) and can display messages in two lines
with 16 characters each.

 It can display all the letters of alphabet, Greek


letters, punctuation marks, mathematical symbols
etc. It is also possible to display symbols made up
by the user.

 Other useful features include automatic message


shift (left and right), cursor appearance, LED
backlight etc

3
Lcd ( liquid crystal display )
✗ The 2x16 character, parallel interface LCD is a
famous device used in embedded system to display
information.
✗ It can be used to display numerical information, text
message and also special symbol. It can display all
the letters of alphabet, Greek letters, punctuation
marks, mathematical symbols etc. It is also possible
to display symbols made up by the user.

✗ LCD can control by using either 8 pins (8-bit


interface) or 4 pins (4-bit interface), depending on
the I/O pins that we have. For learning purposes, we
would recommend 8-bit interface which is relatively
easy.

4
LCD Screen
✗ An LCD screen can display two
lines with 16 characters each.
Every character consists of 5x8
or 5x11 dot matrix.

5
LCD Memory

LCD display contains three memory blocks:

 DDRAM Display Data RAM;


 CGRAM Character Generator RAM; and
 CGROM Character Generator ROM.

6
 DDRAM Memory (Data Display Random Access Memory)
✗ In this case, displaying starts from
the first field of the first line
because the initial address is 00
hex. If more than 16 characters are
sent, then all of them will be
✗ DDRAM memory is used for storing memorized, but only the first
characters to be displayed. The size sixteen characters will be visible.
of this memory is capable of storing
80 characters.
✗ All characters sent through lines D0-
D7 will be displayed in the message
format we are used to- from left to
right.

7
 CGROM Memory (Character Graphics Random Access Memory)
✗ CGROM memory contains a standard character
map with all characters that can be displayed on
the screen. Each character is assigned to one
memory location
✗ The addresses of CGROM memory locations match
the characters of ASCII.
✗ If the program being currently executed encounters
a command ‘send character P to port’ then the
binary value 0101 0000 appears on the port. This
value is the ASCII equivalent to the character P.
✗ It is then written to an LCD, which results in
displaying the symbol from the 0101 0000 location
of CGROM. In other words, the character ‘P’ is
displayed.
✗ This applies to all letters of alphabet (capitals and
small), but not to numbers
8
9
 CGRAM Memory (Character Graphics Read only Memory)
✗ CGRAM stands for Character Generator
RAM. Character LCDs include a fixed
CGROM to define the bulk of the
characters they display. The CGRAM
definitions can be used to make small
animations, bar graphs, and similar
small graphic or sprite images.
✗ Memory registers are 8 bits wide, but
only 5 lower bits are used. Logic one (1)
in every register represents a dimmed
dot, while 8 locations grouped together
represent one character.

10
2
Analog to Digital Converters
(ADC)
digital to analog converters
(DAC)
adc

ADC (Analog to Digital Converter) is an


electronic device that converts a
continuous analog input signal to discrete
digital number (binary)

12
Analog Digital
Real world signals that contain noise Discrete in time and value
Continuous in time Binary digits that contain values 0 or
1

13
Why ADC is Important?
✗ All microcontrollers store information using digital
logic
✗ Compress information to digital form for efficient
storage
✗ Medium for storing digital data is more robust
✗ Digital data transfer is more efficient
✗ Digital data is easily reproducible
✗ Provides a link between real-world signals and data
storage
14
ADC Application
Cell phones Images and videos Digital
Cell phones operate on the Images and videos captured Oscilloscope
digital voice signal. using camera is stored in any
Digital Oscilloscope also
Originally the voice is in digital device, is also
contains ADC for converting
analog form, which is converted into digital form
Analog signal into a digital
converted through ADC using ADC.
signal for display purposes
before feeding to the cell
& different other features.
phone transmitter.

Microcontroller. Air conditioner


Air conditioner contains temperature
Microcontroller. convert an
sensors for maintaining the room
analog signal such as
temperature. This temperature is
voltage to a digital form so
converted into digital form using ADC
that it can be read and
so that onboard controller can read &
processed by
adjust the cooling effect.
a microcontroller

15
dac
✗ A digital to analog converter (DAC) is a device that
converts digital numbers (binary) into an analog
voltage or current output.

16
dac Application
Audio Amplifier Audio Video. Digital
Amplifier contains DAC that converts Video. Digital video players used DAC
the audio signal stored in digital device to play any digital video using an analog
into an analog signal. The signal can be monitor. These video players convert
modified by the amplifier by varying its the digital signal from the digital source
gain converted into analog signal. file into an analog

Digital Potentiometer Digital Motor Control


Potentiometer. Almost all digital Motor Control. In various electronic projects,
potentiometer are based on the string DAC motor is embedded with a microcontroller.
architecture. The microcontroller generates a digital
signal to vary the speed of the motor which
is converted into an analog signal using
a DAC

17
18
3
Dc motor
What is dc motor ?
✗ A DC motor is any of a class of rotary electrical motors that converts direct current
electrical energy into mechanical energy.

✗ The most common types rely on the forces produced by magnetic fields. Nearly all types
of DC motors have some internal mechanism, either electromechanical or electronic, to
periodically change the direction of current in part of the motor

✗ DC motors were the first form of motor widely used, as they could be powered from
existing direct-current lighting power distribution systems.

✗ DC motor's speed can be controlled over a wide range, using either a variable supply
voltage or by changing the strength of current in its field windings.

✗ DC motors are currently used in propulsion of electric vehicles, elevator and hoists, and in
drives for steel rolling mills.

20
PRINCIPLE OF DC MOTOR
✗ A machine that converts dc power
into mechanical energy is known as
dc motor. Its operation is based on
the principle that when a current
carrying conductor is placed in a
magnetic field, the conductor
experiences a mechanical force. The
direction of the force is given by
Fleming’s left-hand rule.

21
application

22
4
Electromagnetic Relay
Purpose of relay

✗ Relays are switches that open and close


circuits electromechanically or electronically.
Relays control one electrical circuit by opening
and closing contacts in another circuit. As relay
diagrams show, when a relay contact is
normally open (NO), there is an open contact
when the relay is not energized.

24
Electromagnetic Relay

25
Electromagnetic Relay Operation
✗ An electromagnetic relay is a
magnetic switch. It uses
electromagnetism to switch
contacts.
✗ A relay will usually have
only one coil but may have
any number of different
contacts.

26
Thanks!
Any questions?

27

You might also like