Sei sulla pagina 1di 55

What is blood pressure?

When your heart beats, it pumps blood round your body to give it the energy and oxygen it
needs. As the blood moves, it pushes against the sides of the blood vessels. The strength of this
pushing is your blood pressure. If your blood pressure is too high, it puts extra strain on your
arteries (and your heart) and this may lead to heart attacks and strokes.

Blood pressure is typically recorded as two numbers, written as a ratio like this:
Systolic
The top number, which is also the higher of the two numbers, measures the pressure in the
arteries

when

the

heart

beats

(when

the

heart

muscle

contracts).

Diastolic
The bottom number, which is also the lower of the two numbers, measures the pressure in the
arteries between heartbeats (when the heart muscle is resting between beats and refilling with
blood).
his chart reflects blood pressure categories defined by the American Heart Association.
Blood

Pressure Systolic

Diastolic

Category

mm Hg (upper #)

Normal

less than 120

and

less than 80

Prehypertension

120 139

or

80 89

140 159

or

90 99

160 or higher

or

100 or higher

Higher than 180

or

Higher than 110

High

Blood

Pressure

(Hypertension) Stage 1
High

Blood

Pressure

(Hypertension) Stage 2
Hypertensive

Crisis

(Emergency care needed)

mm Hg (lower #)

How is high blood pressure diagnosed?


Your healthcare providers will want to get an accurate picture of your blood pressure and chart
what happens over time. Starting at age 20, the American Heart Association recommends a blood
pressure screening at your regular healthcare visit or once every 2 years, if your blood pressure is
less

than

120/80

mm

Hg.

Your blood pressure rises with each heartbeat and falls when your heart relaxes between beats.
While BP can change from minute to minute with changes in posture, exercise, stress or sleep, it
should normally be less than 120/80 mm Hg (less than 120 systolic AND less than 80 diastolic)
for an adult age 20 or over. About one in three U.S. adults has high blood pressure.
.
A single high reading does not necessarily mean that you have high blood pressure. However, if
readings stay at 140/90 mm Hg or above (systolic 140 or above OR diastolic 90 or above) over
time, your doctor will likely want you to begin a treatment program. Such a program almost
always includes lifestyle changes and often prescription medication for those with readings of
140/90 or higher.
If, while monitoring your blood pressure, you get a systolic reading of 180 mm Hg or higher OR
a diastolic reading of 110 mm HG or higher, wait a couple of minutes and take it again. If the
reading is still at or above that level, you should seek immediate emergency medical treatment
for a hypertensive crisis. If you can't access the emergency medical services (EMS), have
someone drive you to the hospital right away.
Even if your blood pressure is normal, you should consider making lifestyle modifications
to prevent the development of HBP and improve your heart health.
Which number is more important, top (systolic) or bottom (diastolic)?
Typically more attention is given to the top number (the systolic blood pressure) as a major risk
factor for cardiovascular disease for people over 50 years old. In most people, systolic blood
pressure rises steadily with age due to increasing stiffness of large arteries, long-term build-up of
plaque, and increased incidence of cardiac and vascular disease.

Pulse oximeter
Pulse oximetry is a simple, relatively cheap and non-invasive technique to monitor oxygenation.
It monitors the percentage of haemoglobin that is oxygen-saturated. Oxygen saturation should
always be above 95%, although in those with long-standing respiratory disease or cyanotic
congenital heart disease, it may be lower, corresponding to disease severity. The oxyhaemoglobin
dissociation curve becomes sharply steep below about 90%, reflecting the more rapid
desaturation that occurs with diminishing oxygen partial pressure (PaO 2).On most machines the
default low oxygen saturation alarm setting is 90%.
Pulse oximetry does not provide information on the oxygen content of the blood nor ventilation
and thus care is needed in the presence of anaemia and in patients developing respiratory failure
due to carbon dioxide retention, for example.
Principles of pulse oximetry
Oximeters work by the principles of spectrophotometry: the relative absorption of red (absorbed
by deoxygenated blood) and infrared (absorbed by oxygenated blood) light of the systolic
component of the absorption waveform correlates to arterial blood oxygen saturations.
Measurements of relative light absorption are made multiple times every second and these are
processed by the machine to give a new reading every 0.5-1 second that averages out the
readings over the last three seconds.
Two light-emitting diodes, red and infrared, are positioned so that they are opposite their
respective detectors through 5-10 mm of tissue. Probes are usually positioned on the fingertip,
although earlobes and forehead are sometimes used as alternatives. One study has suggested that
the ear lobe is not a reliable site to measure oxygen saturations.Probes tend to use 'wrap' or 'clip'
style sensors.

Uses
Central cyanosis, the traditional clinical sign of hypoxaemia, is an insensitive marker occurring
only at 75-80% saturation. Consequently, pulse oximetry has a wide range of applications
including:

Individual pulse oximetry readings - can be invaluable in clinical situations where


hypoxaemia may be a factor - for example, in a confused elderly person.

Continuous recording - can be used during anaesthesia or sedation, or to assess


hypoxaemia during sleep studies to diagnose obstructive sleep apnoea. Peri-operative
monitoring has not, however, been shown to improve surgical outcomes.

Pulse oximetry can replace blood gas analysis in many clinical situations unless PaCO 2or
acid-base state is needed. It is cheaper, easier to perform, less painful and can be more
accurate where the patient is conscious (hyperventilation at the prospect of pain raises
PaO2).

Pulse oximetry allows accurate use of O 2 and avoids wastage. For example, in patients
with respiratory failure, rather than limit the use of O2 to maintain hypoxic ventilatory drive,
it can be adjusted to a saturation of ~90% which is clinically acceptable.

Neonatal care - the safety limits for oxygen saturations are higher and narrower (95-97%)
compared to those for adults. Pulse oximetry is not yet a standard of care in the screening of
neonates for asymptomatic congenital heart disease but may become so. It appears to be
significantly more reliable than clinical methods alone, as shown by recent studies.

Intrapartum fetal monitoring - there has been some interest in the use of fetal pulse
oximetry in combination with routine cardiotocography (CTG) monitoring, although its use
does not reduce the operative delivery rate.

Using an oximeter

Resting readings should be taken for at least five minutes.

Poor perfusion (due to cold or hypotension) is the main cause of an inadequate pulse
wave. A sharp waveform with a dicrotic notch indicates good perfusion whilst a sine wavelike waveform suggests poor perfusion.

If a finger probe is used, the hand should be rested on the chest at the level of the heart
rather than the affixed digit held in the air (as patients commonly do) in order to minimise
motion artefact.

Checking that the displayed heart rate correlates to a manually checked heart rate (within
5 beats per minute) generally rules out significant motion artefact.

Emitters and detectors must oppose one another and light should not reach the detector
except through the tissue. Ensure the digit is inserted fully into the probe and that flexible
probes are attached correctly. Appropriately sized probes should be used for children and
infants.

Oximeter accuracy should be checked by obtaining at least one simultaneous blood gas,
although this rarely happens. Oximeters may correct average oximeter bias based on pooled
data but this does not eliminate the possibility of larger individual biases.

How Does a Pulse Oximeter Work?


A finger pulse oximeter functions by shining light through your finger. The sensors detect how
much oxygen is in your blood based on the way the light passes through your finger. Pulse
oximetry is the technology calculating the results to display a number on the oximeters screen
that tells you the percent of oxygen in your blood. A finger pulse oximeter also measures your
pulse rate.

Sources of error

Pulse oximetry cannot differentiate between different forms of haemoglobin.


Carboxyhaemoglobin is registered as 90% oxygenated haemoglobin and 10% desaturated
haemoglobin, thereby causing an overestimation of true saturation levels.

Significant venous pulsation such as occurs in tricuspid incompetence and venous


congestion.

Environmental interference: vibration at 0.5-3.5 Hz, excessive movement and perhaps


high level of ambient light, including infrared heat lamps.

Cold hands - warm extremity if local poor perfusion.

Nail polish should be removed, as it may cause false readings.

Intravascular dyes, such as methylthioninium chloride, may also temporarily falsely


reduce saturation readings.

Improving an oximeter signal

Warm and rub skin

Apply a topical vasodilator - eg, glyceryl trinitrate (GTN) cream

Try an alternative probe site

Try a different probe

Try a different machine

The GSM Network:


The GSM network was designed keeping in mind the voice activities of the user and its
main purpose was to provide voice connectivity like Public Switched Telephone Networks but
with mobility. So Call Processing activities were the major criteria to decide and fix the
implementation standards of GSM. The data communication was of secondary importance to this
network but to support this also, designers have considered the circuit switching itself the
mechanism for transmitting data packet.
The Mobile Station (MS) directly interacts with one of the Base Transceiver Stations,
which in turn interacts with a Base Station Controllers (BSC). BTS and BSC combined together
forms the BSS. More than one BTSs are connected with one BSC. The BSC further interacts
with Mobile Station Controller (MSC) which is the heart of the GSM network. MSC further
gives connectivity to the PSTN and other PLMNs. MSC is also responsible to interact with
HLR and VLR, which form the Permanent and Temporary data bases for all the subscribers
static and dynamic information.
4.5 GSM Architecture:

Handset

HLR/
VLR

UM
A-bis

BSC

MSC

SS7
PSTN

BTS

X.25
OMC
(Operation & Maintenance
Center)
Operation
Terminal

SIM
card
Mobile
station

Radio
sub-system

Network sub-system

Data Terminal

PSTN

FIG 4.2 GSM ARCHITECTURE.


The words, Mobile Station (MS) or Mobile Equipment (ME) are used for mobile
terminals supporting GSM services. A call from a GSM mobile station to the PSTN is called a
mobile originated call (MOC) or outgoing call, and a call from a fixed network to a GSM
mobile station is called a mobile terminated call (MTC) or incoming call. In this document,
the word product refers to any product supporting the AT commands interface.
Multiple Access and Channel Structure:
Since radio spectrum is a limited resource shared by all users, a method must be devised
to divide up the bandwidth among as many users as possible. The method chosen by GSM is a
combination of Time- and Frequency-Division Multiple Access (TDMA/FDMA). The FDMA
part involves the division by frequency of the (maximum) 25 MHz bandwidth into 124 carrier
frequencies spaced 200 kHz apart. One or more carrier frequencies are assigned to each base
station. Each of these carrier frequencies is then divided in time, using a TDMA scheme. The
fundamental unit of time in this TDMA scheme is called a burst period and it lasts 15/26 ms (or
approx. 0.577 ms). Eight burst periods are grouped into a TDMA frame (120/26 ms, or approx.

4.615 ms), which forms the basic unit for the definition of logical channels. One physical
channel is one burst period per TDMA frame.
Channels are defined by the number and position of their corresponding burst periods. All
these definitions are cyclic, and the entire pattern repeats approximately every 3 hours. Channels
can be divided into dedicated channels, which are allocated to a mobile station, and common
channels, which are used by mobile stations in idle mode.
Traffic Channels:
A traffic channel (TCH) is used to carry speech and data traffic. Traffic channels are
defined using a 26-frame multiframe, or group of 26 TDMA frames. The length of a 26-frame
multi frame is 120 ms, which is how the length of a burst period is defined (120 ms divided by
26 frames divided by 8 burst periods per frame). Out of the 26 frames, 24 are used for traffic, 1 is
used for the Slow Associated Control Channel (SACCH) and 1 is currently unused.
In addition to these full-rate TCHs, there are also half-rate TCHs defined, although they
are not yet implemented. Half-rate TCHs will effectively double the capacity of a system once
half-rate speech coders are specified (i.e., speech coding at around 7 kbps, instead of 13 kbps).
Eighth-rate TCHs are also specified, and are used for signalling. In the recommendations, they
are called Stand-alone Dedicated Control Channels (SDCCH).

FIGURE 4.3: ORGANIZATION OF BURSTS, TDMA FRAMES, AND MULTIFRAMES FOR


SPEECH AND DATA

Control Channels:
Common channels can be accessed both by idle mode and dedicated mode mobiles. The
common channels are used by idle mode mobiles to exchange the signalling information required
to change to dedicated mode. Mobiles already in dedicated mode monitor the surrounding base
stations for handover and other information. The common channels are defined within a 51frame multiframe, so that dedicated mobiles using the 26-frame multiframe TCH structure can
still monitor control channels.
The common channels include:
Broadcast Control Channel (BCCH):
Continually broadcasts, on the downlink, information including base station: identity,
frequency allocations, and frequency-hopping sequences.
Frequency Correction Channel (FCCH) and Synchronisation Channel (SCH):
Used to synchronise the mobile to the time slot structure of a cell by defining the
boundaries of burst periods, and the time slot numbering. Every cell in a GSM network
broadcasts exactly one FCCH and one SCH, which are by definition on time slot number 0
(within a TDMA frame).
Random Access Channel (RACH):
Slotted Aloha channel used by the mobile to request access to the network.
Access Grant Channel (AGCH):
Used to allocate an SDCCH to a mobile for signalling (in order to obtain a dedicated
channel), following a request on the RACH.
Power Control:
There are five classes of mobile stations defined, according to their peak transmitter
power, rated at 20, 8, 5, 2, and 0.8 watts. To minimize co-channel interference and to conserve
power, both the mobiles and the Base Transceiver Stations operate at the lowest power level that
will maintain an acceptable signal quality. Power levels can be stepped up or down in steps of 2
dB from the peak power for the class down to a minimum of 13 dBm (20 milliwatts).
The mobile station measures the signal strength or signal quality (based on the Bit Error
Ratio), and passes the information to the Base Station Controller, which ultimately decides if and

when the power level should be changed. Power control should be handled carefully, since there
is the possibility of instability. This arises from having mobiles in co-channel cells alternatingly
increase their power in response to increased co-channel.
Network Aspects:
Ensuring the transmission of voice or data of a given quality over the radio link is only
part of the function of a cellular mobile network. A GSM mobile can seamlessly roam nationally
and internationally, which requires that registration, authentication, call routing and location
updating functions exist and are standardized in GSM networks. In addition, the fact that the
geographical area covered by the network is divided into cells necessitates the implementation of
a handover mechanism. These functions are performed by the Network Subsystem, mainly using
the Mobile Application Part (MAP) built on top of the Signalling System No. 7 protocol.

FIGURE.4.4: SIGNALLING PROTOCOL STRUCTURE IN GSM


The signalling protocol in GSM is structured into three general layers [1], [19],
depending on the interface, as shown in Figure 3. Layer 1 is the physical layer, which uses the
channel structures discussed above over the air interface. Layer 2 is the data link layer. Across
the Um interface, the data link layer is a modified version of the LAPD protocol used in ISDN,
called LAPDm. Across the A interface, the Message Transfer Part layer 2 of Signalling System
Number 7 is used. Layer 3 of the GSM signalling protocol is itself divided into 3 sublayers.
Mobility Management (MM):
Mobility Management handles the control functions required for mobility e.g.

Authentication

Assignment of TMSI

Management of subscriber location

Radio Resource Management (RR):


The role of the RR management layer is to establish and release stable connection
between mobile stations (MS) and an MSC for the duration of a call, and to maintain it despite
user movements. The following functions are performed by the MSC

Call selection

Handover

Allocation and take-down of point-to-point channels

Monitoring and forwarding of radio connections

Introduction of encryption

Change in transmission mode

Connection Management (CM):


Connection Management is used to setup, maintain and take down call connections; it is
comprised of three subgroups:

Call Control (CC):- Manages call connections.

Supplementary Service Support (SS):- Handles special services.

Short Message Service Support (SMS):- Transfers brief texts.

GSM

Protocol

Stacks:
FIG.4.5: GSM PROTOCOL STACKS

Protocols on the Um interface:


Layer 1: Physical layer.
Layer 2: Here the LAP-Dm protocol is used (similar to ISDN LAP-D). LAP-Dm has the
following functions:

Connectionless transfer on point-to-multipoint signalling channels.

Connection-oriented transfer with retention of the transmission sequence, error


detection and error correction.

Layer 3: Contains the following sub layers which control signalling channel functions
(BCH, CCCH and DCCH).
GSM Radio Interface:
GSM Radio interface uses the base FDMA+TDMA technologies along with an optional
Slow Frequency Hopping. The specs are the specifications are mentioned below.

124 radio carriers, inter carrier spacing 200 kHz.

890 to 915 MHz mobile to base UPLINK

935 to 960 MHz base to mobile - DOWNLINK

8 channels/carrier

GSM Modem:
Our GSM modem is one of the most exciting and innovative electronic products ever
developed. With it you can stay in contact with your office, your home, emergency services, and
others, wherever service is provided.
General:
Our modem utilizes the GSM standard for cellular technology. GSM is a newer radio
frequency (RF) technology than the current FM technology that has been used for radio
communications for decades. The GSM standard has been established for use in the European
community and elsewhere. Your modem is actually a low power radio transmitter and receiver. It
sends out and receives radio frequency energy. When you use your modem, the cellular system
handling your calls controls both the radio frequency and the power level of your cellular
modem.

Efficient Modem Operation:


For our modem to operate at the lowest power level, consistent with satisfactory call
quality: If your modem has an extendible antenna, extend it fully. Some models allow you to
place a call with the antenna retracted. However your modem operates more efficiently with the
antenna fully extended. Do not hold the antenna when the modem is IN USE. Holding the
antenna affects call quality and may cause the modem to operate at a higher power level than
needed.
Antenna Care and Replacement:
Do not use the modem with a damaged antenna. If a damaged antenna comes into contact
with the skin, a minor burn may result. Replace a damaged antenna immediately. Consult your
manual to see if you may change the antenna yourself. If so, use only a manufacturer-approved

antenna. Otherwise, have your antenna repaired by a qualified technician. Use only the supplied
or approved antenna. Unauthorized antennas, modifications or attachments could damage the
modem and may contravene local RF emission regulations or invalidate type approval.
Driving:
Check the laws and regulations on the use of cellular devices in the area where you drive.
Always obey them. Also, when using your modem while driving, please: give full attention to
driving, pull off the road and park before making or answering a call if driving conditions so
allow. When applications are prepared for mobile use they should fulfil road-safety instructions
of the current law!
Electronic Devices:
Most electronic equipment, for example in hospitals and motor vehicles is shielded from
RF energy. However RF energy may affect some malfunctioning or improperly shielded
electronic equipment.
Vehicle Electronic Equipment:
Check your vehicle manufacturers representative to determine if any on board electronic
equipment is adequately shielded from RF energy.

Transmitters:
Performance is critical in three areas: in-channel, out-of-channel, and out-of band
In-channel measurements determine the link quality seen by the user in question:
Phase error and mean frequency error
Mean transmitted RF carrier power
Transmitted RF carrier power versus time
Out-of-channel measurements determine how much interference the user causes other
GSM users:

Spectrum due to modulation and wide band noise

Spectrum due to switching

TX and RX band spurious


Out-of-band measurements determine how much interference the user causes other users

of the radio spectrum (military, aviation, and police):


Other spurious (cross band and wideband)
Receivers:
Performance is critical in the following area: sensitivity. Sensitivity measurements
determine the link quality seen by the user in low signal level conditions:
Static reference sensitivity level
Origins of Measurements:
GSM transmitter and receiver measurements originate from the following ETSI 3GPP
standards:

3GPP TS 05.05.V8.12.0: Radio access network; radio transmission and reception

3GPP TS 11.21 V8.6.0: Base station system (BSS) equipment specification; radio
aspects.
It is worth noting that these specifications were written for the purposes of full type

approval and they are extensive. It is not practical to make the whole suite of measurements in
most application areas. For example, in manufacturing where throughput and cost are key
drivers, it is necessary to use a subset of the measurements defined in the specifications above.
Optimization is key, the objective should be to test sufficiently to prove correct assembly,
perform correct calibration and assure correct field operation, but with a minimum of expense. It
is not necessary to type approve infrastructure component shipped. This application note aims to
help the reader to interpret the standards and apply tests appropriately. The standards can be
difficult to understand, and independent parties might interpret them differently. Agilent
Technologies uses the standards as a basis from which to design measurement algorithms
Attention commands:
GSM engines are referred to as following term:

1) ME (Mobile Equipment);
2) MS (Mobile Station);
3) TA (Terminal Adapter);
4) DCE (Data Communication Equipment) or facsimile DCE(FAX modem, FAX board);
In application, controlling device controls the GSM engine by sending AT Command via its
serial interface. The controlling device at the other end of the serial line is referred to as
following term:
1) TE (Terminal Equipment);
2) DTE (Data Terminal Equipment) or plainly the application which is running on an
embedded system;

AT Command syntax
The "AT" or "at" prefix must be set at the beginning of each command line. To terminate a
command line enter <CR>.
Commands

are

usually

followed

by

response

that

includes.<CR><LF><response><CR><LF>
Throughout this document, only the responses are presented, <CR><LF> are omitted
intentionally.
The AT command set implemented by SIM300 is a combination of GSM07.05, GSM07.07 and
ITU-T recommendation V.25ter and the AT commands developed by SIMCOM.
Note: Only enter AT command through serial port after SIM300 is power on and Unsolicited
Result Code RDY is received from serial port. And if unsolicited result codeSCKS: 0
returned it indicates SIM card isnt present. If autobauding is enabled, the Unsolicited Result
Codes RDY and so on are not indicated when you start up the MEExtended Syntax
These commands can operate in several modes, as following table:
Table 1: Types of AT commands and AT+<x>=?

The

responses Test command

returns

mobile
the

parameters
ranges

set

equipment
list
and
with

of
value
the

corresponding

Write

command or by internal
Read command

AT+<x>?

processes.
This command returns the
currently set value of the

Write command

AT+<x>=<>

parameter or parameters.
This command sets the
user-definable

Execution command

AT+<x>

parameter

values.
The execution command
reads
parameters

non-variable
affected

by

internal processes in the


GSM engine
Combining AT commands on the same command line
You can enter several AT commands on the same line. In this case, you do not need to type the
AT or at prefix before every command. Instead, you only need type AT or or at the
beginning of the command line. Please note to use a semicolon as command delimiter.
The command line buffer can accept a maximum of 256 characters. If the characters entered
exceeded this number then none of the command will executed and TA will returns ERROR.
1.4.5 Entering successive AT commands on separate lines
When you need to enter a series of AT commands on separate lines, please note that you need to
wait the final response (for example OK, CME error, CMS error) of last AT command you
entered before you enter the next AT command.
1.5 Supported character sets

The SIM300 AT command interface defaults to the IRA character set. The SIM300 supports the
following character sets:
GSM format
UCS2

HEX
IRA
PCCP437
PCDN
8859_1
The character set can be set and interrogated using the AT+CSCS command (GSM 07.07). The
character set is defined in GSM specification 07.05.
Overview of AT Commands According to GSM07.05
AT+CMGF
SELECT SMS MESSAGE FORMAT
AT+CMGF Select SMS Message Format AT+CMGF Select SMS Message Format
Read Command
Response
AT+CMGF?

+CMGF: <mode>
OK
Parameters

Test Command

see write command


Response

AT+CMGF=?

+CMGF: list of supported <mode>s

Write Command

OK
Response

AT+CMGF=[<mode>]

TA sets parameter to denote which input


and output format of messages to use.
OK
Parameters
0 PDU mode
1 text mode

ATE

SET COMMAND ECHO MODE

ATE Set command echo mode ATE Set command echo mode
Write command
Response
ATE[<value>]

This setting determines whether or not


the TA echoes characters received from
TE during command state.
OK
Parameter
0 Echo mode off
1 Echo mode on

AT+CMGD Delete SMS message AT+CMGD Delete SMS message


Read Command
Response
AT+CMGD=?

+CMGD<Range of SMS on SIM card


can be deleted>

Write Command

OK
Response

AT+CMGD=<index>

TA deletes message from preferred


message

storage

<mem1>

location

<index>.
OK
If error is related to ME functionality:
+CMS ERROR <err>
Parameters
<index> integer type; value in the range
of location numbers supported by the
associated memory
AT+CMGDA Delete All SMS AT+ CMGDA Delete All SMS
Test Command
Response:
AT+ CMGDA=?

+CMGDA:

listed

of

supported <type> s
OK
+CMS ERROR: NUM

Parameters
see write command
Write Command

Response:

AT+CMGDA=<type>

OK
+CMS ERROR: NUM
Parameters
1) If text mode:
DEL READ delete all read
messages
DEL UNREAD delete all
unread messages
DEL SENT delete all sent
SMS
DEL UNSENT delete all
unsent SMS
DEL

INBOX

delete

received SMS
DEL ALL delete all SMS
3) if PDU mode :
1 delete all read messages
2 delete all unread messages
3 delete all sent SMS
4 delete all unsent SMS
5 delete all received SMS
6 delete all SMS

all

AT+CMGR Read SMS message AT+CMGR Read SMS message


Test Command
Response
AT+CMGR=?
Write Command

OK
Parameters

AT+CMGR=<index>[,<mode>]

<index> integer type; value in the range


of location numbers supported by the
associated memory
<mode> 0 normal
1 not change status of the specified
SMS record
Response
TA returns SMS message with location
value <index> from message storage
<mem1> to the TE. If status of the
message is 'received unread', status in
the storage changes to 'received read'.
1) If text mode (+CMGF=1) and
command successful:
for SMS-DELIVER:
+CMGR:<stat>,<oa>,
[<alpha>],<scts>[,<tooa>,<fo>,<pid>,<
dcs>,<sca>,<tosca>,<length>]<CR><L
F><data>
for SMS-SUBMIT:
+CMGR:<stat>,<da>,[<alpha>]
[,<toda>,<fo>,<pid>,<dcs>,
[<vp>],<sca>,<tosca>,<length>]<CR>
<LF><data>
for SMS-STATUS-REPORTs:
+CMGR:

<stat>,<fo>,<mr>,[<ra>],

[<tora>],<scts>,<dt>,<st>

for SMS-COMMANDs:
+CMGR:<stat>,<fo>,<ct>[,<pid>,
[<mn>],[<da>],
[<toda>],<length><CR><LF><cdata>]

AT+CMGS Send SMS message


Test Command
Response
AT+CMGS=?

ONEWIRE PROTOCAL FOR TEMPERATURE SENSOR DS1820


1-Wire is a device communications bus system designed by Dallas Semiconductor Corp. that
provides low-speed data, signaling, and power over a single signal.[1] 1-Wire is similar in concept
to IC, but with lower data rates and longer range. It is typically used to communicate with small
inexpensive devices such as digital thermometers and weather instruments. A network of 1-Wire
devices with an associated master device is called a MicroLan.
One distinctive feature of the bus is the possibility to use only two wires: data and ground. To
accomplish this, 1-wire devices include an 800 pF capacitor to store charge, and power the
device during periods where the data line is used for data.
Dependent on function, native 1-wire devices are available as single components in integrated
circuit and TO92 packaging, and in some cases a portable form called an iButton that resembles
a watch battery. Manufacturers also produce products that are more complex than a single
component, and use the 1-wire bus to communicate.
A 1-Wire device may be just one of many components on a circuit board within a product, but
are also found in isolation within devices such as a temperature sensor probe, or attached to a
device being monitored. Some laboratory systems and other data acquisition and control systems
connect to 1-Wire devices using cords with modular connectors or with CAT-5 cable, with the
devices themselves mounted in a socket, incorporated in a small PCB, or attached to the object
being monitored. In such systems, RJ11 (6P2C or 6P4C modular plugs, commonly used for
telephones) are popular.
Systems of sensors and actuators can be built by wiring together 1-Wire components, each
including all of the logic needed to operate on the 1-Wire bus. Examples include temperature
loggers, timers, voltage and current sensors, battery monitors, and memory. These can be
connected to a PC using a bus converter. USB, RS-232 serial, and parallel port interfaces are
popular solutions for connecting the MicroLan to the host PC. MicroLans also interface to
microcontrollers, such as the Arduino, Parallax BASIC Stamp, Parallax Propeller, PICAXE, the
Microchip PIC family and RENESAS family.

The iButton (also known as the Dallas Key) is a mechanical packaging standard that places a 1Wire component inside a small stainless steel "button" similar to a disk-shaped battery. iButtons
are connected to 1-Wire bus systems by means of sockets with contacts which touch the "lid" and
"base" of the canister. iButtons are used as Akbil smart tickets for the Public transport in
Istanbul. Alternatively, the connection can be semi-permanent with a different socket type; the
iButton clips into it, but is easily removed.
The Java Ring, a ring-mounted iButton with a Java Virtual Machine compatible with the Java
Card 2.0 specification within, was given to attendees of the JavaOne 1998 conference.[2]
Each 1-Wire chip has a unique code buried within it. This feature makes the chips, especially in
an iButton package, ideal for use as a key to open a lock, arm and deactivate burglar alarms,
authenticate computer system users, operate time clock systems, and other similar uses.
Use of the bus
In any MicroLan, there is always exactly one master in overall charge, which may be a PC or a
microcontroller. The master initiates activity on the bus, simplifying the avoidance of collisions
on the bus. Protocols are built into the software to detect collisions. After a collision, the master
tries again to effect the required communication.
The Dallas 1-Wire network is physically implemented as an open drain master device connected
to one or more open drain slaves [3] . A single pull-up resistor is common to all devices and acts to
pull the bus up to 3 or 5 volts, and may provide power to the slave devices. Communication
occurs when a master or slave asserts the bus lowthat is, connects the pull up resistor to
ground through its output MOSFET. Specific 1-Wire driver and bridge chips are also available.
Data rates of 16.3 kbit/s can be achieved. There is also an overdrive mode which speeds up the
communication by a factor of 10.
The master starts a transmission with a "reset" pulse, which pulls the wire to 0 volts for 480 s.
This resets every slave device on the bus, probably by depriving them all of power. After that,
any slave device, if present, shows that it exists with a "presence" pulse: it holds the wire to
ground for at least 60 s after the master releases the bus.

To send a "1", the bus master software sends a very brief (1 - 15 s) low pulse. To send a "0", the
software sends a 60 s low pulse. The falling (negative) edge of the pulse is used to start a
monostable multivibrator in the slave device. The multivibrator in the slave clocks to read the
data line about 30 s after the falling edge. The slave's multivibrator unavoidably has analog
tolerances that affect its timing accuracy, which is why the output pulses have to be 60 s long,
and the starting pulse can't be longer than 15 s.
If a parallel port is inconvenient or the operating system interferes with the timing, a UART
running at 100 kbit/s with a few resistors and special software can produce and sense acceptable
1-wire pulses. Serial or USB "bridge" chips are also available that handle the timing and
waveform requirements of the 1-Wire bus, and are particularly useful in utilizing long (greater
than 100 m) cables effectively. Up to 300 meter long buses consisting of simple twistedpair
telephone cable has been tested by the manufacturer. It will however require adjustment of pullup resistances from say 5k to 1 k.
When receiving data, the master sends a 1-15 s 0 volt pulse to start each bit. If the transmitting
slave unit wants to send a "1", it does nothing, and the wire goes immediately up to the pulled-up
voltage. If the transmitting slave wants to send a "0", it pulls the data line to ground for 60 s.
The basic sequence is a reset pulse followed by an 8-bit command, and then data is sent or
received in groups of 8-bits.
When a sequence of data is being transferred, errors can be detected with an 8-bit CRC (weak
data protection).
Many devices can share the same bus. Each device on the bus has a unique 64-bit serial number.
The least significant byte of the serial number is an 8-bit number that tells the type of the device.
The most significant byte is a standard (for the 1-wire bus) 8-bit CRC.[4]
There are several standard broadcast commands, and commands addressed to particular devices.
The master can send a selection command, and then the address of a particular device, and then
the next command is executed only by the selected device.

The bus also has an algorithm to recover the address of every device on the bus. Since the
address includes the device type and a CRC, recovering the address roster also produces a
reliable inventory of the devices on the bus. The 64-bit address space is searched as a binary tree,
allowing up to 75 devices to be found per second.
To find the devices, the master broadcasts an enumeration command, and then an address,
"listening" after each bit of an address. If a slave has all the address bits so far, it returns a 0. The
master uses this simple behavior to search systematically for valid sequences of address bits. The
process is much faster than a brute force search of all possible 64-bit numbers because as soon as
an invalid bit is detected, all subsequent address bits are known to be invalid. An enumeration of
10 or 15 devices finishes very quickly.
The location of devices on the bus is sometimes significant. For these situations, the
manufacturer has a special device that either passes through the bus or switches it off. Software
can therefore explore sequential
Example communication with a device
The following signals were generated by an FPGA, which was the master for the communication
with a DS2432 (EEPROM) chip, and measured with a logic analyzer. High on the 1-wire output
means that the output of the FPGA is in tri-state mode and the 1-wire device can pull down the
bus. Low means that the FPGA pulls down the bus. The 1-wire input is the measured bus signal.
On input sample time high, the FPGA samples the input for detecting the device response and
receiving bits.

MAX232
The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals
suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver
and typically converts the RX, TX, CTS and RTS signals.
The drivers provide RS-232 voltage level outputs (approx. 7.5 V) from a single + 5 V supply
via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-232
in devices that otherwise do not need any voltages outside the 0 V to + 5 V range, as power
supply design does not need to be made more complicated just for driving the RS-232 in this
case.
The receivers reduce RS-232 inputs (which may be as high as 25 V), to standard 5 V TTL
levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V.

The later MAX232A is backwards compatible with the original MAX232 but may operate at
higher baud rates and can use smaller external capacitors 0.1 F in place of the 1.0 F
capacitors used with the original device.[1]
The newer MAX3232 is also backwards compatible, but operates at a broader voltage range,
from 3 to 5.5 V. [2]
[edit] Voltage levels
It is helpful to understand what occurs to the voltage levels. When a MAX232 IC receives a TTL
level to convert, it changes a TTL Logic 0 to between +3 and +15 V, and changes TTL Logic 1 to
between -3 to -15 V, and vice versa for converting from RS232 to TTL. This can be confusing
when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite
from the RS232 Control Line voltages at the same logic state. To clarify the matter, see the table
below. For more information see RS-232 Voltage Levels.

RS232 Line Type & Logic Level


Data Transmission (Rx/Tx) Logic 0
Data Transmission (Rx/Tx) Logic 1
Control Signals (RTS/CTS/DTR/DSR) Logic 0
Control Signals (RTS/CTS/DTR/DSR) Logic 1

RS232 Voltage
+3 V to +15 V
-3 V to -15 V
-3 V to -15 V
+3 V to +15 V

TTL Voltage to/from MAX232


0V
5V
5V
0V

SERIAL COMMUNICATION
n telecommunication and computer science, the concept of serial communication is the process
of sending data one bit at a time, sequentially, over a communication channel or computer bus.
This is in contrast to parallel communication, where several bits are sent as a whole, on a link
with several parallel channels. Serial communication is used for all long-haul communication
and most computer networks, where the cost of cable and synchronization difficulties make
parallel communication impractical. Serial computer buses are becoming more common even at

shorter distances, as improved signal integrity and transmission speeds in newer serial
technologies have begun to outweigh the parallel bus's advantage of simplicity (no need for
serializer and deserializer, or SerDes) and to outstrip its disadvantages (clock skew, interconnect
density).
Serial versus parallel
The communication links across which computersor parts of computerstalk to one another
may be either serial or parallel. A parallel link transmits several streams of data (perhaps
representing particular bits of a stream of bytes) along multiple channels (wires, printed circuit
tracks, optical fibres, etc.); a serial link transmits a single stream of data.
At first sight it would seem that a serial link must be inferior to a parallel one, because it can
transmit less data on each clock tick. However, it is often the case that serial links can be clocked
considerably faster than parallel links, and achieve a higher data rate. A number of factors allow
serial to be clocked at a greater rate:

Clock skew between different channels is not an issue (for unclocked asynchronous serial
communication links)

A serial connection requires fewer interconnecting cables (e.g. wires/fibres) and hence
occupies less space. The extra space allows for better isolation of the channel from its
surroundings

Crosstalk is less of an issue, because there are fewer conductors in proximity.

In many cases, serial is a better option because it is cheaper to implement. Many ICs have serial
interfaces, as opposed to parallel ones, so that they have fewer pins and are therefore less
expensive.
In telecommunications, RS-232 (Recommended Standard 232) is the traditional name for a series
of standards for serial binary single-ended data and control signals connecting between a DTE
(Data Terminal Equipment) and a DCE (Data Circuit-terminating Equipment). It is commonly

used in computer serial ports. The standard defines the electrical characteristics and timing of
signals, the meaning of signals, and the physical size and pinout of connectors. The current
version of the standard is TIA-232-F Interface Between Data Terminal Equipment and Data
Circuit-Terminating Equipment Employing Serial Binary Data Interchange, issued in 1997
Scope of the standard
The Electronic Industries Association (EIA) standard RS-232-C[1] as of 1969 defines:

Electrical signal characteristics such as voltage levels, signaling rate, timing and slewrate of signals, voltage withstand level, short-circuit behavior, and maximum load
capacitance.

Interface mechanical characteristics, pluggable connectors and pin identification.

Functions of each circuit in the interface connector.

Standard subsets of interface circuits for selected telecom applications.

The standard does not define such elements as

character encoding (for example, ASCII, Baudot code or EBCDIC)

the framing of characters in the data stream (bits per character, start/stop bits, parity)

protocols for error detection or algorithms for data compression

bit rates for transmission, although the standard says it is intended for bit rates lower than
20,000 bits per second. Many modern devices support speeds of 115,200 bit/s and above

power supply to external devices.

Details of character format and transmission bit rate are controlled by the serial port hardware,
often a single integrated circuit called a UART that converts data from parallel to asynchronous
start-stop serial form. Details of voltage levels, slew rate, and short-circuit behavior are typically
controlled by a line driver that converts from the UART's logic levels to RS-232 compatible

signal levels, and a receiver that converts from RS-232 compatible signal levels to the UART's
logic levels.
History
RS-232 was first introduced in 1962. [2] The original DTEs were electromechanical
teletypewriters and the original DCEs were (usually) modems. When electronic terminals (smart
and dumb) began to be used, they were often designed to be interchangeable with teletypes, and
so supported RS-232. The C revision of the standard was issued in 1969 in part to accommodate
the electrical characteristics of these devices.
Since application to devices such as computers, printers, test instruments, and so on was not
considered by the standard, designers implementing an RS-232 compatible interface on their
equipment often interpreted the requirements idiosyncratically. Common problems were nonstandard pin assignment of circuits on connectors, and incorrect or missing control signals. The
lack of adherence to the standards produced a thriving industry of breakout boxes, patch boxes,
test equipment, books, and other aids for the connection of disparate equipment. A common
deviation from the standard was to drive the signals at a reduced voltage: the standard requires
the transmitter to use +12 V and 12 V, but requires the receiver to distinguish voltages as low as
+3 V and -3 V. Some manufacturers therefore built transmitters that supplied +5 V and -5 V and
labeled them as "RS-232 compatible."
Later personal computers (and other devices) started to make use of the standard so that they
could connect to existing equipment. For many years, an RS-232-compatible port was a standard
feature for serial communications, such as modem connections, on many computers. It remained
in widespread use into the late 1990s. In personal computer peripherals it has largely been
supplanted by other interface standards, such as USB. RS-232 is still used to connect older
designs of peripherals, industrial equipment (such as PLCs), console ports and special purpose
equipment such as a cash drawer for a cash register.
The standard has been renamed several times during its history as the sponsoring organization
changed its name, and has been variously known as EIA RS-232, EIA 232, and most recently as
TIA 232. The standard continued to be revised and updated by the Electronic Industries Alliance

and since 1988 by the Telecommunications Industry Association (TIA).[3] Revision C was issued
in a document dated August 1969. Revision D was issued in 1986. The current revision is TIA232-F Interface Between Data Terminal Equipment and Data Circuit-Terminating Equipment
Employing Serial Binary Data Interchange, issued in 1997. Changes since Revision C have been
in timing and details intended to improve harmonization with the CCITT standard V.24, but
equipment built to the current standard will interoperate with older versions.
Limitations of the standard
Because the application of RS-232 has extended far beyond the original purpose of
interconnecting a terminal with a modem, successor standards have been developed to address
the limitations. Issues with the RS-232 standard include:[4]

The large voltage swings and requirement for positive and negative supplies increases
power consumption of the interface and complicates power supply design. The voltage
swing requirement also limits the upper speed of a compatible interface.

Single-ended signaling referred to a common signal ground limits the noise immunity and
transmission distance.

Multi-drop connection among more than two devices is not defined. While multi-drop
"work-arounds" have been devised, they have limitations in speed and compatibility.

Asymmetrical definitions of the two ends of the link make the assignment of the role of a
newly developed device problematic; the designer must decide on either a DTE-like or
DCE-like interface and which connector pin assignments to use.

The handshaking and control lines of the interface are intended for the setup and
takedown of a dial-up communication circuit; in particular, the use of handshake lines for
flow control is not reliably implemented in many devices.

No method is specified for sending power to a device. While a small amount of current
can be extracted from the DTR and RTS lines, this is only suitable for low power devices
such as mice.

The 25-way connector recommended in the standard is large compared to current


practice.

Standard details
In RS-232, user data is sent as a time-series of bits. Both synchronous and asynchronous
transmissions are supported by the standard. In addition to the data circuits, the standard defines
a number of control circuits used to manage the connection between the DTE and DCE. Each
data or control circuit only operates in one direction, that is, signaling from a DTE to the
attached DCE or the reverse. Since transmit data and receive data are separate circuits, the
interface can operate in a full duplex manner, supporting concurrent data flow in both directions.
The standard does not define character framing within the data stream, or character encoding.
Voltage levels

Diagrammatic oscilloscope trace of voltage levels for an uppercase ASCII "K" character (0x4b)
with 1 start bit, 8 data bits, 1 stop bit
The RS-232 standard defines the voltage levels that correspond to logical one and logical zero
levels for the data transmission and the control signal lines. Valid signals are plus or minus 3 to
15 volts; the 3 V range near zero volts is not a valid RS-232 level. The standard specifies a
maximum open-circuit voltage of 25 volts: signal levels of 5 V, 10 V, 12 V, and 15 V are all
commonly seen depending on the power supplies available within a device. RS-232 drivers and
receivers must be able to withstand indefinite short circuit to ground or to any voltage level up to
25 volts. The slew rate, or how fast the signal changes between levels, is also controlled.
For data transmission lines (TxD, RxD and their secondary channel equivalents) logic one is
defined as a negative voltage, the signal condition is called marking, and has the functional
significance. Logic zero is positive and the signal condition is termed spacing. Control signals
are logically inverted with respect to what one sees on the data transmission lines. When one of

these signals is active, the voltage on the line will be between +3 to +15 volts. The inactive state
for these signals is the opposite voltage condition, between 3 and 15 volts. Examples of
control lines include request to send (RTS), clear to send (CTS), data terminal ready (DTR), and
data set ready (DSR).
Because the voltage levels are higher than logic levels typically used by integrated circuits,
special intervening driver circuits are required to translate logic levels. These also protect the
device's internal circuitry from short circuits or transients that may appear on the RS-232
interface, and provide sufficient current to comply with the slew rate requirements for data
transmission.
Because both ends of the RS-232 circuit depend on the ground pin being zero volts, problems
will occur when connecting machinery and computers where the voltage between the ground pin
on one end, and the ground pin on the other is not zero. This may also cause a hazardous ground
loop. Use of a common ground limits RS-232 to applications with relatively short cables. If the
two devices are far enough apart or on separate power systems, the local ground connections at
either end of the cable will have differing voltages; this difference will reduce the noise margin
of the signals. Balanced, differential, serial connections such as USB, RS-422 and RS-485 can
tolerate larger ground voltage differences because of the differential signaling.[6]
Unused interface signals terminated to ground will have an undefined logic state. Where it is
necessary to permanently set a control signal to a defined state, it must be connected to a voltage
source that asserts the logic 1 or logic 0 level. Some devices provide test voltages on their
interface connectors for this purpose.
Connectors
RS-232 devices may be classified as Data Terminal Equipment (DTE) or Data Communication
Equipment (DCE); this defines at each device which wires will be sending and receiving each
signal. The standard recommended but did not make mandatory the D-subminiature 25 pin
connector. In general and according to the standard, terminals and computers have male
connectors with DTE pin functions, and modems have female connectors with DCE pin
functions. Other devices may have any combination of connector gender and pin definitions.

Many terminals were manufactured with female terminals but were sold with a cable with male
connectors at each end; the terminal with its cable satisfied the recommendations in the standard.
Presence of a 25 pin D-sub connector does not necessarily indicate an RS-232-C compliant
interface. For example, on the original IBM PC, a male D-sub was an RS-232-C DTE port (with
a non-standard current loop interface on reserved pins), but the female D-sub connector was used
for a parallel Centronics printer port. Some personal computers put non-standard voltages or
signals on some pins of their serial ports.
The standard specifies 20 different signal connections. Since most devices use only a few
signals, smaller connectors can often be used.

BATTERY
Batteries are an excellent emergency power source, but require some basic information to
use properly. They are electrochemical devices. They have plates, usually metallic, and either a
solution or a moist compound between the plates. A chemical reaction takes place in the battery
when it is discharged that produces a flow of electrons out one plate on the negative side and into
another plate on the positive side.
Here we are using dry lead/acid battery. It has plates of lead in sulphuric acid solution in
water. One of the sets of lead plates is coated with lead dioxide. As such a battery discharges it
creates two chemical reactions, one at the anode that ends up with an excess of electrons, and
one at the cathode that ends up short electrons. If a wire is connected between the two, the excess
electrons from the anode will travel through the wire as a current to the cathode where they are
needed to complete the electron deficient reaction there.
Dry lead acid battery of 12V/1.3A is used as source of power for the whole robot unit.
For digital circuitry 5 volts needed is derived from 12v battery using regulator IC7805.
LCD 16x2

Liquid crystal display is very important device in embedded system. It offers high flexibility to
user as he can display the required data on it. But due to lack of proper approach to LCD
interfacing many of them fail. Many people consider LCD interfacing a complex job but
according to me LCD interfacing is very easy task, you just need to have a logical approach. This
page is to help the enthusiast who wants to interface LCD with through understanding. Copy and
Paste technique may not work when an embedded system engineer wants to apply LCD
interfacing in real world projects.
You will be knowing about the booster rockets on space shuttle. Without these booster rockets
the space shuttle would not launch in geosynchronous orbit. Similarly to understand LCD
interfacing you need to have booster rockets attached! To get it done right you must have general
idea how to approach any given LCD.This page will help you develop logical approach towards
LCD interfacing.
First thing to begin with is to know what LCD driver/controller is used in LCD.Yes, your LCD is
dumb it does not know to talk with your microcontroller. LCD driver is a link between the
microcontroller and LCD. You can refer the datasheet of LCD to know the LCD driver for e.g.
JHD 162A is name of LCD having driver HD44780U.You have to interface the LCD according
to the driver specification. To understand the algorithm of LCD interfacing user must have
datasheet of both LCD and LCD driver. Many people ignore the datasheets and end up in
troubles. If you want to interface LCD successfully you must have datasheets.
Why people ignore datasheets? Most of us do not like to read 100 pages of datasheet. But for a
accurate technical specification datasheets are must. I will show you a technique to manipulate a
datasheet within minutes.
First thing to find out in datasheet is the features viz. operating voltage, type of interface,
maximum speed for interface in MHz, size of display data RAM, number of pixels, bits per
pixel, number of row and columns. You must have the pin diagram of LCD.Pin diagram of LCD
driver can be omitted.

Study the type of communication protocol whether it is parallel or serial interface. Check how
LCD discriminates data bytes and command bytes, which pins on LCD are used for
communication. Study Interface timing diagram given in the datasheet.
From datasheet of LCD driver find out whether hardware reset is required at startup, what is the
time of reset pulse, is it active low and which pins of LCD are to be toggled.
Major task in LCD interfacing is the initialization sequence. In LCD initialization you have to
send command bytes to LCD. Here you set the interface mode, display mode, address counter
increment direction, set contrast of LCD, horizontal or vertical addressing mode, color format.
This sequence is given in respective LCD driver datasheet. Studying the function set of LCD lets
you know the definition of command bytes. It varies from one LCD to another. If you are able to
initialize the LCD properly 90% of your job is done.
Next step after initialization is to send data bytes to required display data RAM memory location.
Firstly set the address location using address set command byte and than send data bytes using
the DDRAM write command. To address specific location in display data RAM one must have
the knowledge of how the address counter is incremented.
LCD INTERFACING:
The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or
other which are compatible with HD44580. In this, we will discuss about character based LCDs,
their interfacing with various microcontrollers, various interfaces (8-bit/4-bit), programming,
special stuff and tricks you can do with these simple looking LCDs which can give a new look to
your application.
Pin Description:
The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs
which have only 1 controller and support at most of 80 characters, whereas LCDs supporting
more than 80 characters make use of 2 HD44780 controllers. Most LCDs with 1 controller has
14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra in both for back-light LED
connections). Pin description is shown in the table below.

Character LCD type HD44780 Pin diagram

Character LCD pins with 1 Controller

Character LCD pins with 2 Controller

DDRAM-Display data RAM:

Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its
extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM (DDRAM) that
is not used for display can be used as general data RAM. So whatever you send on the DDRAM
is actually displayed on the LCD. For LCDs like 1x16, only 16 characters are visible, so
whatever you write after 16 chars is written in DDRAM but is not visible to the user.
Figures below will show you the DDRAM addresses of 1 Line, 2 Line and 4 Line LCDs.

DDRAM Address for 1 Line LCD

DDRAM Address for 2 Line LCD

DDRAM Address for 4 Line LCD


CGROM - Character Generator ROM
Now you might be thinking that when you send an ASCII value to DDRAM, how the character is
displayed on LCD? So the answer is CGROM. The character generator ROM generates 5 x 8 dot
or 5 x 10 dot character patterns from 8-bit character codes. It can generate 208 5 x 8 dot
character patterns and 32 5 x 10 dot character patterns. User defined character patterns are also
available by mask-programmed ROM.

CGRAM - Character Generator RAM

CGRAM area is used to create custom characters in LCD. In the character generator RAM, the
user can rewrite character patterns by program. For 5 x 8 dots, eight character patterns can be
written, and for 5 x 10 dots, four character patterns can be written.
BF - Busy Flag
Busy Flag is a status indicator flag for LCD. When we send a command or data to the LCD for
processing, this flag is set (i.e. BF =1) and as soon as the instruction is executed successfully this
flag is cleared (BF = 0). This is helpful in producing and exact amount of delay. To read Busy
Flag, the condition RS = 0 and R/W = 1 must be met and The MSB of the LCD data bus (D7) act
as busy flag. When BF = 1 means LCD is busy and will not accept next command or data and BF
= 0 means LCD is ready for the next command or data to process.
Instruction Register (IR) and Data Register (DR)
There are two 8-bit registers in HD44780 controller Instruction and Data register. Instruction
register corresponds to the register where you send commands to LCD e.g. LCD shift command,
LCD clear, LCD address etc. and Data register is used for storing data
, which is to be displayed on LCD when send the enable signal of the LCD is asserted, the data
on the pins is latched in to the data register and data is then moved automatically to the DDRAM
and

hence

is

displayed

on

the

LCD?

Data Register is not only used for sending data to DDRAM but also for CGRAM, the address
where you want to send the data, is decided by the instruction you send to LCD.
Commands and Instruction set
Only the instruction register (IR) and the data register (DR) of the LCD can be controlled by the
MCU. Before starting the internal operation of the LCD, control information is temporarily
stored into these registers to allow interfacing with various MCUs, which operate at different
speeds, or various peripheral control devices. The internal operation of the LCD is determined by
signals sent from the MCU. These signals, which include register selection signal (RS),
read/write signal (R/W), and the data bus (DB0 to DB7), make up the LCD instructions (table
below). There are four categories of instructions that:

Designate LCD functions, such as display format, data length, etc.

Set internal RAM addresses

Perform data transfer with internal RAM

Perform miscellaneous functions

Table: Command and Instruction set for LCD type HD44780

Although looking at the table you can make your own commands and test them. Below is a brief
list of useful commands which are used frequently while working on the LCD.

Frequently used commands and instructions for LCD


LCD Initialization
Before using the LCD for display purpose, LCD has to be initialized either by the internal reset
circuit or sending set of commands to initialize the LCD. It is the user who has to decide whether

an LCD has to be initialized by instructions or by internal reset circuit. we will discuss both ways
of initialization one by one.

Initialization by internal Reset Circuit


An internal reset circuit automatically initializes the HD44780U when the power is turned on.
The following instructions are executed during the initialization. The busy flag (BF) is kept in
the busy state until the initialization ends (BF = 1). The busy state lasts for 10 ms after VCC rises
to 4.5 V.

Display clear

Function
DL

set:
=

1;
=

8-bit
0;

interface
1-line

data
display

F = 0; 5 x 8 dot character font

Display

on/off

control:

0;

Display

off

0;

Cursor

off

B = 0; Blinking off

Entry
I/D

mode
=

1;

S = 0; No shift

Power Supply condition for Internal Reset circuit

Increment

set:
by

Figure 7 shows the test conditions which are to be met for internal reset circuit to be active.

Now the problem with the internal reset circuit is, it is highly dependent on power supply, to
meet this critical power supply conditions is not hard but are difficult to achieve when you are
making a simple application. So usually the second method i.e. Initialization by instruction is
used and is recommended most of the time.
Initialization by instructions
Initializing LCD with instructions is really simple. Given below is a flowchart that describes the
step to follow, to initialize the LCD.

Flow chart for LCD initialization


As you can see from the flow chart, the LCD is initialized in the following sequence.
1)

Send

command

0x30

2)
Send

command

8-bit

8-bit

Delay

5)

Send

command

8-bit

Delay
Send

Function

set
Display

see

interface
20ms

0x30

6)

interface
20ms

0x30

4)

8)

Using

Delay

3)

7)

interface
20ms

Table

4
Clear

for

more

information
command

9)

Set

entry

mode

command

explained

below

The first 3 commands are usually not required but are recommended when you are using 4-bit
interface. So you can program the LCD starting from step 7 when working with 8-bit interface.
Function set command depends on what kind of LCD you are using and what kind of interface
you are using.

LCD interfacing with Microcontrollers-4bit mode


In 4-bit mode the data is sent in nibbles, first we send the higher nibble and then the lower nibble.
To enable the 4-bit mode of LCD, we need to follow special sequence of initialization that tells the
LCD controller that user has selected 4-bit mode of operation. We call this special sequence as
resetting the LCD. Following is the reset sequence of LCD.

Wait for about 20mS

Send the first init value (0x30)

Wait for about 10mS

Send second init value (0x30)

Wait for about 1mS

Send third init value (0x30)

Wait for 1mS

Select bus width (0x30 - for 8-bit and 0x20 for 4-bit)

Wait for 1mS

The busy flag will only be valid after the above reset sequence. Usually we do not use busy flag
in 4-bit mode as we have to write code for reading two nibbles from the LCD. Instead we simply
put a certain amount of delay usually 300 to 600uS. This delay might vary depending on the
LCD you are using, as you might have a different crystal frequency on which LCD controller is
running. So it actually depends on the LCD module you are using. So if you feel any problem
running the LCD, simply try to increase the delay. This usually works.
LCD connections in 4-bit Mode

Above is the connection diagram of LCD in 4-bit mode, where we only need 6 pins to interface
an LCD. D4-D7 are the data pins connection and Enable and Register select are for LCD control
pins. We are not using Read/Write (RW) Pin of the LCD, as we are only writing on the LCD so
we have made it grounded permanently. If you want to use it. Then you may connect it on your
controller but that will only increase another pin and does not make any big difference.

Potentiometer RV1 is used to control the LCD contrast. The unwanted data pins of LCD i.e. D0D3 are connected to ground.
PCB DESIGN

PCB design starts right from the selection of the laminates .The two main types of base
laminate are epoxy glass and phenolic paper laminates are generally used for simple circuits.
Though it is very cheap and can easily be drilled, phenolic paper has poor electrical
characteristics and it absorbs more moisture than epoxy glass. Epoxy glass has higher
mechanical

strength.

The important properties that have to be considered for selecting the PCB substrate are
the dielectric strength, insulation resistance, water absorption property, coefficient of thermal
expansion, shear strength, hardness, dimensional stability etc.
5.2.1 PCB Fabrication
The fabrication of a PCB includes four steps.
a) Preparing the PCB pattern.
b) Transferring the pattern onto the PCB.
c) Developing the PCB.
d) Finishing (i.e.) drilling, cutting, smoothing, turning etc.

Pattern designing is the primary step in fabricating a PCB. In this step, all interconnection
between the components in the given circuit are converted into PCB tracks. Several factors such
as positioning the diameter of holes, the area that each component would occupy, the type of end
terminal should be considered.

5.2.2

Transferring

the

PCB

Pattern

The copper side of the PCB should be thoroughly cleaned with the help of alcoholic spirit or
petrol. It must be completely free from dust and other contaminants.
The mirror image of the pattern must be carbon copied and to the laminate the complete
pattern may now be made each resistant with the help of paint and thin brush.

5.2.3 Developing

In this developing all excessive copper is removed from the board and only the
printed pattern is left behind. About 100ml of tap water should be heated to 75 C and 30.5
grams of FeCl3 added to it, the mixture should be thoroughly stirred and a few drops of HCl may
be added to speed up the process.
The board with its copper side facing upward should be placed in a flat bottomed plastic
tray and the aqueous solution of FeCl 2 poured in the etching process would take 40 to 60 min to
complete.
After etching the board it should be washed under running water and then
held against light .the printed pattern should be clearly visible. The paint should be removed with
the help of thinner.

5.2.4 Finishing Touches


After the etching is completed, hole of suitable diameter should be drilled, then the PCB
may be tin plated using an ordinary 35 Watts soldering rod along with the solder core, the copper
side may be given a coat of varnish to prevent oxidation.
5.2.5 Drilling
Drills for PCB use usually come with either a set of collects of various sizes or a 3-Jaw
chuck. For accuracy however 3-jaw chunks arent brilliant and small drill below 1 mm from
grooves in the jaws preventing good grips.
5.2.6 Soldering
Begin the construction by soldering the resistors followed by the capacitors and the LEDs
diodes and IC sockets. Dont try soldering an IC directly unless you trust your skill in soldering.
All components should be soldered as shown in the figure. Now connect the switch and then
solder/screw if on the PCB using multiple washers or spaces. Soldering it directly will only
reduce its height above other components and hamper in its easy fixation in the cabinet. Now
connect the battery lead.
5.2.7 Assembling
The circuit can be enclosed in any kind of cabinet. Before fitting the PCB suitable holes
must be drilled in the cabinet for the switch, LED and buzzer. Note that a rotary switch can be
used instead of a slide type.
Switch on the circuit to be desired range. It will automatically start its timing cycles. To
be sure that it is working properly watch the LED flash. The components are selected to trigger
the alarm a few minutes before the set limit.

Potrebbero piacerti anche