Professional Documents
Culture Documents
A PROJECT REPORT
Submitted by
AMMU R (733117106002)
KANEESIYA S (733117106015)
PARAMESHWARI B (733117106023)
TAMILSELVI P (733117106038)
in
APRIL 2021
1
ANNA UNIVERSITY :: CHENNAI 600 025
BONAFIDE CERTIFICATE
under my supervision.
SIGNATURE SIGNATURE
Dr.K.POORANAPRIYA, M.E., Ph.D., Mr.L.BALACHANDAR, M.E.,
HEAD OF THE DEPARTMENT SUPERVISOR
Professor, Assistant Professor,
Department of ECE, Department of ECE,
Vidyaa Vikas College of Engineering Vidyaa Vikas College of
andTechnology, Engineering and Technology,
Tiruchengode - 637 214. Tiruchengode - 637 214.
2
ACKNOWLEDGEMENT
3
ABSTRACT
iii
CHAPTER TABLE OF CONTENTS PAGE
No. TITLE No.
ABSTRACT iii
LIST OF TABLES ix
LIST OF FIGURES x
LIST OF ABBREVIATIONS xi
1 INTRODUCTION 1
1.1 Intensive Care Unit 1
Internet of things(IoT) 1
Basic Definitions 2
State of the Art 3
Proposed System 3
System testing 3
Existing System 4
2 BLOCK DIAGRAM 5
3 CIRCUIT DIAGRAM 6
4 HARDWARE DETAILS 7
4.1 ARDUINO UNO CONTROLLER 7
4.1.1 Arduino 7
4.1.2 Background 8
4.1.3 Technical Specification 9
4.1.4 Pins 10
4.1.5 General Pin Functions 10
4.1.6 Special Pin Function 11
4.1.7 Communication 12
iv
4.3 TRANSFORMER 13
4.3.4 Classifications 17
4.8 MEMS 25
4.9 SWITCH 29
4.10 LCD 30
4.10.1Specifications 31
v
4.11 LED 34
4.11.1 Function 34
4.12 BUZZER 38
4.13 RELAY 39
4.14 GSM 41
4.14.9 AT Commands 46
5 SOFTWARE DETAILS
5.1 EMBEDDED C 52
vi
5.2 EMBEDDED SYSTEMS 53
PROGRAMMING
5.3 EMBEDDED SYSTEM ARE 54
5.10 MICROCONTROLLER Vs 59
MICROPROCESSOR
5.11 CROSS – COMPILER 61
5.12 SIMULATOR 61
5.13 EMULATOR 61
5.14 DEBUGGER 61
6 ADVANTAGES 62
CONCLUSION 63
APPENTIX – I 64
APPENTIX – II 70
REFERRENCE 71
vii
TABLE LIST OF TABLES PAGE
viii
FIGURE No. LIST OF FIGURES PAGE No.
TITLE
4.7 TRANSDUCER 22
4.12 BUZZER 38
4.13 RELAY 39
ix
LIST OF ABBREVIATIONS
MS Mobile Station
x
PSU Power Supply Unit
SS Switching System
xi
CHAPTER 1
INTRODUCTION
1.1 Intensive Care Unit
The similar name of Intensive Care Unit (ICU) is Critical Care Unit (CCU). It is
also familiar with some others name such as intensive treatment unit. ICU is a
distinct sector of a clinic/hospital that delivers rigorous treatment. Not all the
patients need intensive care. Medical scientist categorized them (patients) who
needs special treatment. Such categories include:
If the physiological regulatory systems of a patients are not stable
because of drug overdose.
Patients with Cardiovascular or organ failure disease.
After critical surgery such as open-heart surgery, single or multiple
organ replacement etc. Those patients are directly transfer to the
ICU unit.
If a patient suffering malfunction in several organs such as trauma
or septic shock.
Mother and baby throughout the childbirth process.
1.2 Internet of Things(IoT)
The Internet of Things is the connected network between devices (wearable,
portable and house-held devices etc.), which was first proposed by Prof. Aston
while performing the research related to Radio-frequency identification (RFID)
in 1999. The service composition is fully supported by IoT with various
applications. The communication among millions of devices (any type of
internet connected) are possible through IoT. The Three Layer Architecture
(most popular) is illustrated. The layers are: Perception, Network and
Application Layer. Sensors, Actuators, Proximity tags (RFID, NFC etc.) and
other embedded devices such as microcontrollers/microprocessors are connected
to the IoT system via Perception layer. Network layer establish the
communications between Things and users (human or consumers). User
1
interfaces/applications are demanded by Application layer. More details
specifications and applications domain of Internet of Things (IoT) .
1.3 BASIC DEFINITIONS
Internet of Things (IoT): A network of Internet connected devices
(electrical) able to interchange data between them using sensors and
actuators.
IoT device: Any type of electrical Internet connected device/s that can be
monitored and/or controlled through Internet from anywhere(remote
location).
IoT ecosystem: All the components that enable consumers, governments
and businesses to connect with their IoT devices, including remotes,
networks, dashboards, gateways, storage, analytics and security.
Entity: Mainly includes the users of IoT system such as consumers,
governments and businesses etc.
The Physical layer: The physical components (hardware) that makes an
Internet of Things (IoT) device which includes sensors, actuators and
networking gear.
The Network layer: The main duty of network layer is transmitting the
data collected from physical layer to IoT devices.
The Application layer: All the protocols and interfaces used by the
connected devices for identification and communication.
Dashboard: The dashboard is used for visualizing the information about
the Internet of Things ecosystem. It also used for controlling the IoT
ecosystem. It acts as a special type of remote control for IoT.
Analytics: Software systems that analyze the data generated by IoT
connected devices. The analysis can be used for a different purposes, such
as predictive maintenance.
Storage for IoT: The cloud storage/data bucket, where data from IoT
2
devices are stored temporary or permanently.
The Networks: The Internet communication layer that enables the entity
to communicate with their embedded devices, and enables devices to
communicate with each other.
3
task. In this regard, Computer Vision based human body movement system
is more accurate than measuring the body movements using low cost sensors
like (accelerometers). On the other hand, integration of vison based system with
low cost microcontroller is more complex than sensors based system. A sensors
(accelerometers) based human body movements measurement system, which
can be easily integrable with our proposed system.
4
CHAPTER 2
BLOCK DIAGRAM
POWER
LC
TEMPERATU D
RE SENSOR
BUZZER
RESPIRATO
RY
ARDUINO RELAY
SENSOR
ACCELEROMETER
INDICATI
ON
LIGHT
PANIC SWITCH
GS
M
5
CHAPTER 3
CIRCUIT DIAGRAM
6
CHAPTER 4
HARDWARE DETAILS
4.1.1 ARDUINO
7
4.1.2 BACKGROUND
In 2003, Massimo Banzi, with David Mellis, another IDII student, and
David Cuartielles, added support for the cheaper ATmega8 microcontroller to
Wiring. But instead of continuing the work on Wiring, they forked the project
and renamed it Arduino. Early arduino boards used the FTDI USB-to-serial
driver chip and an ATmega168. The Uno differed from all preceding boards by
featuring the ATmega328P microcontroller and an ATmega16U2 (Atmega8U2
up to version R2) programmed as a USB-to-serial converter.
8
4.1.3 TECHNICAL SPECIFICATIONS
9
4.1.4 PINS
LED: There is a built-in LED driven by digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
VIN: The input voltage to the Arduino/Genuino board when it's using
an external power source (as opposed to 5 volts from the USB
connection or other regulated power source). You can supply voltage
through this pin, or, if supplying voltage via the power jack, access it
through this pin.
5V: This pin outputs a regulated 5V from the regulator on the board.
The board can be supplied with power either from the DC power jack
(7 - 20V), the USB connector (5V), or the VIN pin of the board (7-
20V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage the board.
3V3: A 3.3 volt supply generated by the on-board regulator.
Maximum current draw is 50 mA.
GND: Ground pins.
10
IOREF: This pin on the Arduino/Genuino board provides the voltage
reference with which the microcontroller operates. A properly
configured shield can read the IOREF pin voltage and select the
appropriate power source or enable voltage translators on the outputs
to work with the 5V or 3.3V.
Reset: Typically used to add a reset button to shields which block the
one on the board.
Each of the 14 digital pins and 6 Analog pins on the Uno can be used as
an input or output, using pinMode(),digitalWrite(), and digitalRead() functions.
They operate at 5 volts. Each pin can provide or receive 20 mA as recommended
operating condition and has an internal pull-up resistor (disconnected by default)
of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on
any I/O pin to avoid permanent damage to the microcontroller.
The Uno has 6 analog inputs, labeled A0 through A5, each of which
provide 10 bits of resolution (i.e. 1024 different values). By default they
measure from ground to 5 volts, though is it possible to change the upper end of
their range using the AREF pin and the analog Reference() function.
Serial / UART: pins 0 (RX) and 1 (TX). Used to receive (RX) and
transmit (TX) TTL serial data. These pins are connected to the
corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
External Interrupts: 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 (Pulse Width Modulation): 3, 5, 6, 9, 10, and 11 Can provide 8-
bit PWM output with the analogWrite() function.
11
SPI (Serial Peripheral Interface): 10 (SS), 11 (MOSI), 12 (MISO), 13
(SCK). These pins support SPI communication using the SPI library.
TWI (Two Wire Interface) / I²C: A4 or SDA pin and A5 or SCL pin.
Support TWI communication using the Wire library.
AREF (Analog Reference): Reference voltage for the analog inputs.
4.1.7 COMMUNICATION
to software on the computer. The 16U2 firmware uses the standard USB COM
drivers, and no external driver is needed. However, on Windows, a .inf file is
required. The Arduino Software (IDE) includes a serial monitor which allows
simple textual data to be sent to and from the board. The RX and TX LEDs on
the board will flash when data is being transmitted via the USB-to-serial chip
and USB connection to the computer (but not for serial communication on pins
0 and 1). A Software Serial library allows serial communication on any of the
Uno's digital pins.
12
This setup has other implications. When the Uno is connected to either a
computer running Mac OS X or Linux, it resets each time a connection is made
to it from software (via USB). For the following half-second or so, the
bootloader is running on the Uno. While it is programmed to ignore malformed
data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened.
13
By adding a load to the secondary circuit, one can make current flow in
the transformer, thus transferring energy from one circuit to the other. The
secondary induced voltage VS is scaled from the primary VP by a factor ideally
equal to the ratio of the number of turns of wire in their respective windings:
14
4.3.1 BASIC PRINCIPLES
A current passing through the primary coil creates a magnetic field. The
primary and secondary coils are wrapped around a core of very high magnetic
permeability, such as iron; this ensures that most of the magnetic field lines
produced by the primary current are within the iron and pass through the
secondary coil as well as the primary coil.
The voltage induced across the secondary coil may be calculated from
Faraday's law of induction, which states that
15
Where VS is the instantaneous voltage, NS is the number of turns in the
secondary coil and Φ equals the total magnetic flux through one turn of the coil.
If the turns of the coil are oriented perpendicular to the magnetic field lines, the
flux is the product of the magnetic field strength B and the area A through which
it cuts. The area is constant, being equal to the cross-sectional area of the
transformer core, whereas the magnetic field varies with time according to the
excitation of the primary.
Since the same magnetic flux passes through both the primary and
secondary coils in an ideal transformer, the instantaneous voltage across the
primary winding equals
Taking the ratio of the two equations for VS and VP gives the basic
equation for stepping up or stepping down the voltage
16
4.3.3.1 DISTRIBUTION TRANSFORMER
Power transformers are used in electronic circuits and come in many diffe
rent types and
applications. Electronics or power transformers are sometimes considered
to be those with ratings of 300 volt-amperes and below. These transformers
normally provide power to the power supply of an electronic device, such as in
power amplifiers in audio receivers.
4.3.4 CLASSIFICATION
The many uses to which transformers are put lead them to be classified in a
number of different ways:
17
By frequency range: power-, audio-, or radio frequency;
By voltage class: from a few volts to hundreds of kilovolts;
By cooling type: air cooled, oil filled, fan cooled, or water cooled;
By application function: such as power supply, impedance matching,
output voltage and current stabilizer, or circuit isolation;
By end purpose: distribution, rectifier, arc furnace, amplifier output;
By winding turns ratio: step-up, step-down, isolating (near equal ratio),
variable.
This circuit can give +5V output at about 150 mA current, but it can be
increased to 1 A when good cooling is added to 7805 regulator chip. The circuit
has over overload and therminal protection.
18
The capacitors must have enough high voltage rating to safely handle the
input voltage feed to circuit. The circuit is very easy to build for example into a
piece of Vero board.
1. Unregulated voltage in
2. Ground
7805 regulator IC
100 uF electrolytic capacitor, at least 25V voltage rating
10 uF electrolytic capacitor, at least 6V voltage rating
100 nF ceramic or polyester capacitor
OUTPUT CURRENT
If you need more than 150 mA of output current, you can update the output
current up to 1A doing the following modifications:
Change the transformer from where you take the power to the circuit to a
model which can give as much current as you need from output
Put a heat sink to the 7805 regulator (so big that it does not overheat
because of the extra losses in the regulator)
19
OUTPUT VOLTAGES
If you need other voltages than +5V, you can modify the circuit by
replacing the 7805 chips with another regulator with different output voltage
from regulator 78xx chip family. The last numbers in the chip code tells the
output voltage. Remember that the input voltage must be at least 3V greater than
regulator output voltage to otherwise the regulator does not work well.
2. Adjustable sensitivity (you can use the blue potentiometer shown in the
picture);
4. Output Mode: Digital Switch Output (low level under working mode);
5. Mounting Hole;
2. Definition
3. Key Differences
4. Conclusion
5. Comparison Chart
Basis For
Sensor Transducer
Comparison
23
Basis For
Sensor Transducer
Comparison
6. Definition of Sensor
7. The sensor is a device that measures the physical quantity (i.e. Heat, light,
sound, etc.) into an easily readable signal (voltage, current etc.). It gives
accurate readings after calibration.
8. Examples – The mercury used in the thermometer converts the measurand
temperature into an expansion and contraction of the liquid which is
easily measured with the help of a calibrated glass tube. The
thermocouple also converts the temperature to an output voltage which is
measured by the thermometer.
9. The sensors have many applications in the electronics equipment. The few
of them are explained below.
10.The motion sensors are used in the home security system and the
automation door system.
11.The photo sensor senses the infrared or ultraviolet light.
12.The accelerometer sensor use in the mobile for detecting the screen
rotations.
24
4.7 TRANSDUCER
The transducer is a device that changes the physical attributes of the non-
electrical signal into an electrical signal which is easily measurable. The process
of energy conversion in the transducer is known as the transduction. The
transduction is completed into two steps. First by sensing the signal and the
strengthening it for further processing.
The transducer has three major components; they are the input device,
signal conditioning or processing device and an output device.
The input devices receive the measured quantity and transfer the proportional
analogue signal to the conditioning device. The conditioning device modified,
filtered, or attenuates the signal which is easily acceptable by the output devices.
The following are the key differences between the sensor and transducer.
1. The sensor senses the physical change across the surrounding whereas the
transducer transforms the one form of energy into another.
2. The sensor itself is the major component of the sensor, whereas the sensor
and the signal conditioning are the major elements of the sensor.
25
3. The primary function of the sensor is to sense the physical changes,
whereas the transducer converts the physical quantities into an electrical
signal.
4.8 MEMS
Of course, history teaches us that integration is the most cost effective and
high performance solution. So Analog Devices pursued an integrated approach
to MEMS where the sensor and signal conditioning electronics are ononechip.
Polysilicon springs suspend the MEMS structure above the substrate such
that the body of the sensor (also known as the proof mass) can move in the X
and Y axes. Acceleration causes deflection of the proof mass from its centre
position. Around the four sides of the square proof mass are 32 sets of radial
fingers.
These fingers are positioned between plates that are fixed to the substrate.
Each finger and pair of fixed plates make up a differential capacitor, and the
27
deflection of the proof mass is determined by measuring the differential
capacitance.
This sensing method has the ability of sensing both dynamic acceleration
(i.e. shock or vibration) and static acceleration (i.e. inclination or gravity).
Until recently, little work has been done to fully understand polysilicon's
mechanical properties. In addition, many materials mechanical properties
change in the microscopic world. Again, polysilicon is a good example. In the
macro world it is rarely used as a mechanical element. It is too brittle and fragile
28
to withstand all but small mechanical deflections. But in the
extremely small movements of MEMS structures (less than a few pm), it turns
out to be an almost ideal material.
Another roadblock for the MEMS designer has been the unavailability of
standard design software. Modern integrated circuits are rarely designed by
hand. Complex CAD and simulation software is used to help design and
optimise the designers concepts.
29
MEMS design software is still in its infancy, and most MEMS
manufacturers develop part or all of their CAD and simulation software to suit
their particular needs.
4.9 SWITCH
31
4.10.1 SPECIFICATIONS
32
4.10.2 USING THE LCD MODULE WITH AN 8051
MICROCONTROLLER
The LCD Module can easily be used with an 8051 microcontroller such as
the AT89C2051 included with the microcontroller beginner kit. The LCD
Module comes with a 16 pin connector. This can be plugged into the breadboard
as shown below.
The pins on the 16 pin connector of the LCD Module are defined below.
The table also shows how to connect each pin to the 2051 microcontroller. To
connect the LCD Module to a standard 40 pin 8051, use the pin names listed
below to find the correct pin number on the 8051 microcontroller. The example
programs below do not need to be modified to work with a 40 pin 8051.
Pin
Function Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
33
Selects command register when low; and data register
4 Register Select
when high
Low to write to the register; High to read from the
5 Read/write
register
Sends data to data pins when a high to low pulse is
6 Enable
given
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-
34
After you have built a basic 2051 configuration as shown above, you can
connect the LCD Module as shown in the table above. In addition, you need to
add the following connections.
Connect LCD Pin 3 to Vcc (5 Volts). Connect LCD Pin 8 to Ground.
Connect a 510 ohm resistor between LCD Pin 5 and ground. Connect a 2.2k
ohm resistor from LCD Pin 2 and Vcc. Connect a 2.2k ohm resistor from LCD
Pin 13 to Vcc.
4.11 LIGHT EMITTING DIODES (LEDS)
Circuit symbol:
4.11.1 FUNCTION
35
uncolored packages which may be diffused (milky) or clear (often described as
'water clear'). The colored packages are also available as diffused (the standard
type) or transparent.
36
CALCULATING AN LED RESISTOR VALUE
An LED must have a resistor connected in series to limit the current
through the LED; otherwise it will burn out almost instantly.
R = (VS - VL) / I
VS = supply voltage
VL = LED voltage (usually 2V, but 4V for blue and white LEDs)
I = LED current (e.g. 10mA = 0.01A, or 20mA = 0.02A)
So R = (VS - VL) / I
37
connected directly to a supply, usually 9 - 12V, and no series resistor is required.
Their flash frequency is fixed so their use is limited and you may prefer to build
your own circuit to flash an ordinary LED, for example our Flashing LED
project which uses a 555 astable circuit.
R = (VS - VL) / I
VS=supplyvoltage
VL = LED voltage (usually 2V, but 4V for blue and white LEDs)
I = LED current (e.g. 10mA = 0.01A, or 20mA = 0.02A)
Make sure the LED current you choose is less than the maximum permitted and
convert the current to amps (A) so the calculation will give the resistor value in
ohms ( ).
If the calculated value is not available choose the nearest standard resistor value
which is greater, so that the current will be a little less than you chose. In fact
you may wish to choose a greater resistor value to reduce the current (to increase
battery life for example) but this will make the LED less bright.
4.12 BUZZER
39
beepers include alarm devices, timers and confirmation of user input such as a
mouse click or keystroke.
This novel buzzer circuit uses a relay in series with a small audio
transformer and speaker. When the switch is pressed, the relay will operate via
the transformer primary and closed relay contact. As soon as the relay operates
the normally closed contact will open, removing power from the relay, the
contacts close and the sequence repeats, all very quickly...so fast that the pulse
of current causes fluctuations in the transformer primary, and hence secondary.
The speakers tone is thus proportional to relay operating frequency. The
capacitor C can be used to "tune" the note. The nominal value is 0.001uF,
increasing capacitance lowers the buzzers tone.
4.13 RELAY
A relay is an electrical switch that opens and closes under the control of
another electrical circuit. In the original form, the switch is operated by an
electromagnet to open or close one or many sets of contacts. It was invented by
Joseph Henry in 1835. Because a relay is able to control an output circuit of
higher power than the input circuit, it can be considered, in a broad sense, to be
40
a form of an electrical amplifier.
41
4.14 GSM
4.14.1 GSM MODEM
Applications
Features
43
4.14.3 GSM FREQUENCIES
The rarer 400 and 450 MHz frequency bands are assigned in some
countries where these frequencies were previously used for first-
generation systems.
GSM-900 uses 890–915 MHz to send information from the mobile station
to the base station (uplink) and 935–960 MHz for the other direction (downlink),
providing 124 RF channels (channel numbers 1 to 124) spaced at 200 kHz.
Duplex spacing of 45 MHz is used.
In some countries the GSM-900 band has been extended to cover a larger
frequency range. This 'extended GSM', E-GSM, uses 880–915 MHz (uplink)
and 925–960 MHz (downlink), adding 50 channels (channel numbers 975 to
1023 and 0) to the original GSM-900 band. Time division multiplexing is used
to allow eight full-rate or sixteen half-rate speech channels per radio frequency
channel.
There are eight radio timeslots (giving eight burst periods) grouped into
what is called a TDMA frame. Half rate channels use alternate frames in the
same timeslot. The channel data rate for all 8 channels is 270.833 kbit/s, and the
frame duration is 4.615 ms. The transmission power in the handset is limited to a
maximum of 2 watts in GSM850/900 and 1 watt in GSM1800/1900.
44
4.14.4 COMPONENTS OF A GSM NETWORK
Subcriber Equipment
Base Station Controller (BSC) - The network element which provides all
the control functions and physical links between the MSC and BTS. The BSC
provides functions such as handover, cell configuration data, and control of
radio frequency (RF) power levels in Base Transceiver Stations.
Base Transceiver Station (BTS) - The network element which handles the
radio interface to the mobile station. The BTS is the radio equipment
(transceivers and antennas) needed to service each cell in the network.
45
4.14.7 OPERATION AND SUPPORT SYSTEM (OSS)
46
All radio-related functions are performed in the Base Station System
(BSS), which consist of Base Station Controllers (BSCs), and the base
Transceiver Stations (BTSs).
BSC provides all the control function and physical links between the
MSC and BTS. It is a high-capability switch that provides functions such as
handover, cell configuration data, and control of Radio Frequency (RF) power
levels in base transceiver stations. A number of BSCs are served by an MSC.
Operation and Maintenance Center (OMC) is connected to all equipment
in the switching system and to the BSC [Albert treytl, et al, 2003]. The
implementation of OMC is called the Operation and Support System (OSS). The
OSS is the functional entity from which the network operates monitors and
controls the system.
The purpose of OSS is to offer the customer cost-effective support for
centralized, region, and local operational and maintenance activities that are
required for a GSM network. An important function of OSS is to provide a
network overview and support the maintenance activities of different operation
and maintenance organizations.
4.14.9 AT COMMANDS
AT commands are used to exchange the information with the mobile
telephone and PC or microcontroller.
Uses of AT Commands
o It configures the mobile telephone and PC.
o It requests the information about the current configuration or the
operational status of the mobile phone.
o Test availability and request the range of valid parameters, when
applications, for an AT command.
Modes of Operation
The modem can be operated in any one of three operations.
47
OFF-LINE COMMAND MODE - The modem is placed in off-
line command mode when first powered up and is ready for
entry of AT commands.
ON-LINE DATA MODE - This allows “normal” operation of
the mobile, exchanging data with the remote modem.
ON-LINE COMMAND MODE - We can switch to the on-line
command mode when we want send AT command while still
remaining connected the remote modem.
The operation of AT commands can be done in common mode, there are
four types of command we can issue
A set command to adjust the modem’s operating parameters.
An execute command which directs action without the need of any
parameters.
A read command to view the current command settings.
A test command to view the available command parameters.
All these AT commands can be split into three categories
Basic AT commands.
S parameter AT commands.
Extended AT commands.
Some Example of AT Commands
RDY will be displayed when the modem is connected to COM port 1 and
hyper terminal is initiated.
AT (Attention command)
It determines the presence of a mobile.
COMMAND: AT
OUTPUT : OK
Selecting a Sms Format
To select SMS format.
Test command:
48
AT+ CMGF=<mode>
<mode>: 0 - Pdu format.
1 - Text format.
Command : AT+CMGF=?
Response : OK.
For text format,
Command : AT+CMGF=1
Response : OK.
49
To Read a Sms
+CMGR - Read message
It returns message with location value <index> from preferred message
storage to the mobile.
COMMAND: 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', then the
status in the storage is changed to 'received read'.
When a SMS is received, a message will be displayed as
+CMTI:”SM”, 1
To read that SMS
COMMAND : AT+ CMGR= 2
OUTPUT : OK
To Delete a Sms
It deletes a message from preferred message storage <mem1> location
<index>.
COMMAND : AT +CMCD=<index>
<index> - integer value in the range of location number supported by the
associated memory.
COMMAND : AT+CMGD = 2
OUTPUT : OK (deletes the message at the index)
These are some of the examples of AT commands that are used for the
communication between the microcontroller or PC and the mobile telephone.
50
Subcriber Identity Module
One of the key features of GSM is the Subscriber Identity Module (SIM),
commonly known as a SIM card. The SIM is a detachable smart card containing
the user's subscription information and phone book. This allows the user to
retain his or her information after switching handsets. Alternatively, the user can
also change operators while retaining the handset simply by changing the SIM.
Some operators will block this by allowing the phone to use only a single SIM,
or only a SIM issued by them; this practice is known as SIM locking, and is
illegal in some countries.
4.14.10 SMS TECHNOLOGY
The SMS (Short Message Service) [Bernard J. Bennington, 1998] is used
to send the energy meter reading to the host computer when requested. SMS is
essentially similar to paging, SMS message do not require the mobile phone to
be active within range, as they will be held for a number of days until the phone
is active and within range. SMS message are transmitted within the same cell or
to anyone with roaming capability. They can also be sent to digital phones from
a web site equipped with a PC Link or from one digital phone to another.
An SMS gateway is a web site that lets you enter an SMS message to
someone within the served by that gateway or acts as an international gateway
for users with roaming capability. The SMS is a store and forward service. In
other words, Short messages are not sent directly from sender to recipient, but
via an SMS center. Each mobile telephone network that supports SMS has one
or more messaging centers to handle and manage the short message. The SMS
features confirmation of message delivery.
51
Short message can be sent and received simultaneously with GSM voice,
data and fax calls. This is possible because whereas voice, data and fax calls
take over a dedicated radio channels for the duration of calls, short message
travel over and above the radio channel using the signaling path. As such, user
of SMS rarely, if ever, gets a busy or engaged signal as they can do during peak
network usage times.
Types of sending multiple short messages are available. They are
SMS concatenation (stringing several short messages together),
SMS compression (getting more than 160 characters of information
within a single short message) have been defined and incorporated in the
GSM SMS standard.
52
CHAPTER 5
SOFTWARE DETAILS
5.1 EMBEDDED C
Looking around, we find ourselves to be surrounded by various types
of embedded systems. Be it a digital camera or a mobile phone or a washing
machine, all of them has some kind of processor functioning inside it.
Associated with each processor is the embedded software. If hardware forms the
body of an embedded system, embedded processor acts as the brain, and
embedded software forms its soul. It is the embedded software which primarily
governs the functioning of embedded systems.
During infancy years of microprocessor based systems, programs were
developed using assemblers and fused into the EPROMs. There used to be no
mechanism to find what the program was doing. LEDs, switches, etc. were used
to check correct execution of the program. Some ‘very fortunate’ developers had
In-circuit Simulators (ICEs), but they were too costly and were not quite reliable
as well.
As time progressed, use of microprocessor-specific assembly-only as the
programming language reduced and embedded systems moved onto C as the
embedded programming language of choice. C is the most widely used
programming language for embedded processors/controllers. Assembly is also
used but mainly to implement those portions of the code where very high timing
accuracy, code size efficiency, etc. are prime requirements.
Initially C was developed by Kernighan and Ritchie to fit into the space of
8K and to write (portable) operating systems. Originally it was implemented on
UNIX operating systems.
53
As it was intended for operating systems development, it can manipulate
memory addresses. Also, it allowed programmers to write very compact codes.
This has given it the reputation as the language of choice for hackers too.As
assembly language programs are specific to a processor, assembly language
didn’t offer portability across systems. To overcome this disadvantage, several
high level languages, including C, came up. Some other languages like PLM,
Modula-2, Pascal, etc. also came but couldn’t find wide acceptance.
Amongst those, C got wide acceptance for not only embedded systems,
but also for desktop applications. Even though C might have lost its sheen as
mainstream language for general purpose applications, it still is having a strong-
hold in embedded programming. Due to the wide acceptance of C in the
embedded systems, various kinds of support tools like compilers & cross-
compilers, ICE, etc. came up and all this facilitated development of embedded
systems using C. Subsequent sections will discuss what is Embedded C, features
of C language, similarities and difference between C and embedded C, and
features of embedded C programming.
54
Embedded systems are more tied to the hardware.
Two salient features of Embedded Programming are code speed and code
size. Code speed is governed by the processing power, timing constraints,
whereas code size is governed by available program memory and use of
programming language. Goal of embedded system programming is to get
maximum features in minimum space and minimum time.
5.3 EMBEDDED SYSTEM ARE PROGRAMMED USING DIFFERENT
TYPE OF LANGUAGES
Machine Code
Low level language, i.e., assembly
High level language like C, C++, Java, Ada, etc.
Application level language like Visual Basic, scripts, Access, etc.
Assembly language maps mnemonic words with the binary machine
codes that the processor uses to code the instructions. Assembly language seems
to be an obvious choice for programming embedded devices. However, use of
assembly language is restricted to developing efficient codes in terms of size and
speed. Also, assembly codes lead to higher software development costs and code
portability is not there.
Developing small codes are not much of a problem, but large
programs/projects become increasingly difficult to manage in assembly
language.
Finding good assembly programmers has also become difficult
nowadays. Hence high level languages are preferred for embedded systems
programming.
55
5.4 USE OF C IN EMBEDDED SYSTEM IS DRIVEN BY
FOLLOWING ADVANTAGES
It is small and reasonably simpler to learn, understand, program and debug.
C Compilers are available for almost all embedded devices in use today, and
there is a large pool of experienced C programmers.
Unlike assembly, C has advantage of processor-independence and is not
specific to any particular microprocessor/ microcontroller or any system.
This makes it convenient for a user to develop programs that can run on
most of the systems.
As C combines functionality of assembly language and features of high level
languages, C is treated as a ‘middle-level computer language’ or ‘high level
assembly language’
It is fairly efficient
It supports access to I/O and provides ease of management of large
embedded projects.
Many of these advantages are offered by other languages also, but what
sets C apart from others like Pascal, FORTRAN, etc. is the fact that it is a
middle level language; it provides direct hardware control without sacrificing
benefits of high level languages. Compared to other high level languages, C
offers more flexibility because C is relatively small, structured language; it
supports low-level bit-wise data manipulation.
Compared to assembly language, C Code written is more reliable and
scalable, more portable between different platforms (with some changes).
Moreover, programs developed in C are much easier to understand, maintain
and debug. Also, as they can be developed more quickly, codes written in C
offers better productivity.
56
C is based on the philosophy ‘programmers know what they are doing’;
only the intentions are to be stated explicitly. It is easier to write good code in C
& convert it to an efficient assembly code (using high quality compilers) rather
than writing an efficient code in assembly itself. Benefits of assembly language
programming over C are negligible when we compare the ease with which C
programs are developed by programmers.
Objected oriented language, C++ is not apt for developing efficient
programs in resource constrained environments like embedded devices. Virtual
functions & exception handling of C++ are some specific features that are not
efficient in terms of space and speed in embedded systems. Sometimes C++ is
used only with very few features, very much as C.
Ada, also an object-oriented language, is different than C++. Originally
designed by the U.S. DOD, it didn’t gain popularity despite being accepted as an
international standard twice (Ada83 and Ada95). However, Ada language has
many features that would simplify embedded software development. Java is
another language used for embedded systems programming. It primarily finds
usage in high-end mobile phones as it offers portability across systems and is
also useful for browsing applications. Java programs require Java Virtual
Machine (JVM), which consume lot of resources. Hence it is not used for
smaller embedded devices.
Dynamic C and B# are some proprietary languages which are also being
used in embedded applications.
Efficient embedded C programs must be kept small and efficient; they
must be optimized for code speed and code size. Good understanding of
processor architecture embedded C programming and debugging tools facilitate
this.
57
5.5 DIFFERENCE BETWEEN C AND EMBEDDED C
Though C and embedded C appear different and are used in different
contexts, they have more similarities than the differences. Most of the constructs
are same; the difference lies in their applications.
C is used for desktop computers, while embedded C is for microcontroller
based applications. Accordingly, C has the luxury to use resources of a desktop
PC like memory, OS, etc. While programming on desktop systems, we need not
bother about memory. However, embedded C has to use with the limited
resources (RAM, ROM, I/Os) on an embedded processor. Thus, program code
must fit into the available program memory. If code exceeds the limit, the
system is likely to crash.
Compilers for C (ANSI C) typically generate OS dependant
executables. Embedded C requires compilers to create files to be downloaded to
the microcontrollers/microprocessors where it needs to run. Embedded
compilers give access to all resources which is not provided in compilers for
desktop computer applications.
Embedded systems often have the real-time constraints, which is usually
not there with desktop computer applications. Embedded systems often do not
have a console, which is available in case of desktop applications. So, what
basically is different while programming with embedded C is the mindset; for
embedded applications, we need to optimally use the resources, make the
program code efficient
58
5.6 EMBEDDED SYSTEM AND MICROCONTROLLER
59
Military Application
Medical Instruments
Toy industries
Blue Tooth
Electronic sensors
Home Appliances etc
5.8 ROLE OF EMBEDDED SYSTEMS
Embedded systems are compact, smart, efficient, and economical and user
friendly, they are closed systems and respond to the real world situation very
fast, closed system means, everything required for a specific application is
embedded on the chip and hence, they do not call for external requirement for
their functioning.
5.9 SEGMENTS OF EMBEDDED SYSTEMS
Embedded systems basically consists of the following four segments
Embedded Controllers (8-bit,16-bit,32-bit,64-bit,128-bit,..)
Embedded software’s (RTOS)
Embedded Memories (DRAM, SRAM, EPROM, Flashetc)
Embedded Boards
5.10 MICROCONTROLLER VERSUS MICROPROCESSORS
Microcontrollers differ from a microprocessor in many ways, first and the
most important is its functionality. In order for a microprocessor to be used,
other components for receiving and sending data must be added to it, In short
that means that microprocessor is the very heart of the computer.
On the other hand, microcontroller is designed to be all of that in one, No other
external components are needed for its application because all necessary
peripherals are already built into, thus, we save the time and space needed to
construct device.
60
The difference can be highlighted as follows:
MICROPROCESSORS MICROCONTROLLER
Access time for memory and I/O Less access time for inbuilt
devices are more memory and I/O devices
Single memory map for data and Separate memory Map for data
code and code
61
5.11 CROSS-COMPILER
5.12 SIMULATOR
5.13 EMULATOR
5.14 DEBUGGER
62
CHAPTER 6
ADVANTAGES
Wireless communication
Real time sms notification
Pre – detection and control
Remote monitoring
Prevention
63
CONCLUSION
Many patients died in ICU unit due to the careless of in- charge personal. In
traditional system is not able to provides constant monitoring facilities. Our
proposed system described in this paper allows doctors or nurses, as well as
hospital in-charge personal allows them to monitor the patient in ICU unit in
real time, which improves the efficiency and service quality. There is a huge
opportunity to modify this system as a wearable device, that allows us to
monitor the older people or babies remotely from any place.
64
APPENDIX - I
PROGRAM CODING
#include <SoftwareSerial.h>
//#include "dht.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
SoftwareSerial mySerial(3,2);
//dht DHT;
//int humty;
//int temp;
//#de
fine dht_apin A1
int temp_level = A0;
int res_level = A2;
int mems_level = A1;
int swt = A3;
int buzzer= 6;
int relay= 7;
int flag1 = 0;
int flag2 = 0;
int flag3 = 0;
int flag4 = 0;
int flag5 = 0;
int
temperature,temperature_level,respitarory,respitarory_level,aclero,aclero_level,
button;
void setup()
{
65
pinMode(swt, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(relay, OUTPUT);
//digitalWrite(buzzer, LOW);
digitalWrite(relay, LOW);
Serial.begin(9600);
mySerial.begin(9600);
delay(100);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0, 0);
lcd.write(" PATIENT ");
lcd.setCursor(0, 1);
lcd.write("MONITORING SYSM ");
delay(2000);
lcd.clear();
}
void loop()
{
//DHT.read11(dht_apin);
//humty = (DHT.humidity);
//temp = (DHT.temperature);
temperature = analogRead(temp_level);
respitarory = analogRead(res_level);
aclero = analogRead(mems_level);
button = digitalRead(swt);
temperature_level=(temperature/2);
66
respitarory_level=(respitarory/20);
aclero_level=(aclero/5);
lcd.setCursor(0,0);
lcd.write("TMP:");
lcd.print(temperature_level);
lcd.setCursor(8,0);
lcd.write("RES:");
lcd.print(respitarory_level);
lcd.setCursor(0,1);
lcd.write("MNT:");
lcd.print(aclero_level);
lcd.setCursor(8,1);
lcd.write("SWT:");
if(temperature_level >= 40 && flag1 == 0)
{
//digitalWrite(buzzer, HIGH);
//digitalWrite(relay, HIGH);
mySerial.print("7603974520,HIGH TEMPERATURE,SMS\r\n");
delay(2000);
flag1 = 1 ;
}
else if(temperature_level <= 40)
{
//digitalWrite(buzzer, LOW);
//digitalWrite(relay, LOW);
flag1 = 0 ;
}
if(respitarory_level <= 40 && flag2 == 0)
{
67
//digitalWrite(buzzer, HIGH);
//digitalWrite(relay, HIGH);
mySerial.print("7603974520,ABNORMAL RESIPIRATORY,SMS\r\n");
delay(2000);
flag2 = 1;
}
else if(respitarory_level>= 40)
{
//digitalWrite(buzzer, LOW);
//digitalWrite(relay, LOW);
flag2 = 0 ;
}
//else
if(aclero_level <= 80 || aclero_level >= 85 && flag3 == 0)
{
// digitalWrite(buzzer, HIGH);
//digitalWrite(relay, HIGH);
mySerial.print("7603974520,DETECT BODY
MOVEMENT,SMS\r\n");
delay(2000);
flag3 = 1;
}
else if(aclero_level >= 75 && aclero_level <= 85)
{
//digitalWrite(buzzer, LOW);
//digitalWrite(relay, LOW);
flag3 = 0;
}
//else
68
if( button == LOW && flag4 == 0)
{
//digitalWrite(buzzer, HIGH);
// digitalWrite(relay, HIGH);
lcd.setCursor(12,1);
lcd.write("ON ");
mySerial.print("7603974520,ALERT.NEED HELP,SMS\r\n");
delay(2000);
flag4 = 1;
}
else if(button == HIGH )
{
lcd.setCursor(12,1);
lcd.write("OFF");
//digitalWrite(buzzer, LOW);
//digitalWrite(relay, LOW);
flag4 = 0 ;
}
// else
if((temperature_level >= 40 || respitarory_level <= 40 || aclero_level <= 75
|| aclero_level >= 85 || button == LOW) && flag5 == 0)
{
//digitalWrite(buzzer, HIGH);
digitalWrite(relay, HIGH);
delay(3000);
flag5 = 1 ;
}
else //if((temp <= 40 || humty <= 50 || co2 <= 150 || ch4 <= 100) &&
flag5 == 1)
69
{
digitalWrite(buzzer, LOW);
digitalWrite(relay, LOW);
flag5 = 0 ;
}
}
70
APPENDIX II
71
REFERENCE
1. Bhilare.R and Mali.S, “Iot based smart home with real time e-metering
using e-controller,” 2015 India Council International Conference
(INDICON), IEEE.
2. Congress on Information and Communication Technologies.
3. Dohr.A, Modre-Opsrian.R, Drobics.M, Hayn.D, and Schreier.G, “The
internet of things for ambient assisted living,” 2010 Seventh International
Conference on Information Technology.
4. E. C.-W. Lau, “Simple Bus Tracking System,” Journal of Advanced
Computer Science and Technology Research, vol. 3, no. 1, 2013.
5. (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom).
6. Jain.P.N and Agarkar.T.P, “An embedded, gsm based, multi- parameter,
realtime patient monitoring system and control; an implementation for icu
patients,” 2012 World Congress on Information and Communication
Technologies.
7. Jassas.M.S, Qasem, and Mahmoud.Q.H, “A smart system connecting e-
health sensors and the cloud,” 2015 IEEE 28th Canadian Conference on
Electrical and Computer Engineering (CCECE).
8. Kumar.K.M and Venkatesan.R.S, “A Design Approach To Smart Health
Monitoring Using Android Mobile Devices,” 2014 IEEE International
Conference on Advanced Communications, Control and Computing
Technologies.
9. Kumar.R and Rajasekaran.M.P, “An IoT based patient monitoring system
using raspberry pi,” 2016 International Conference on Computing
Technologies and Intelligent Data Engineering (ICCTIDE’16).
10. Malhi.K, Mukhopadhyay.S.C, Schnepper.J, Haefke.M, and Ewald.H, “A
zigbee-based wearable physiological parameters monitoring system,”
72
IEEE Sensors Journal, vol. 12, no. 3, pp. 423–430, March 2012.
73