Sms based patient report from remote place1


Published on

1 Like
  • hello sur:
    can i get the source code ?
    best kinds o regards : brave
    Are you sure you want to  Yes  No
    Your message goes here
  • how can i get e base paper of this project?give me the rply
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Sms based patient report from remote place1

  1. 1. SMS BASED PATIENT REPORT FROM REMOTE PLACE CHAPTER-1 INTRODUCTION The project deals with the design and development of hardware and software fortemperature and heartbeat measurement of a patient over LCD The data which are recorded continuously in this project are Heartbeat of the patient. Thedigital value read is sent to the microcontroller. The microcontroller temporarily stores thisvalue. The heartbeat pulses can be seen by the doctor at regular intervals in LCD to know thepatient condition.1.1. OBJECTIVE The project intends to interface the microcontroller with the LCD and Heart beatmonitoring system and send the information like heartbeat pulses of the patient to the doctor’swork station on LCD. The project uses the LCD, Heartbeat sensor and Embedded Systems todesign this application. The main objective of this project is to design a system that continuouslymonitors the heartbeat of the patient and if they are likely to exceed the normal values, thesystem immediately sends a message to the doctor’s LCD. This project is a device that collects data from the sensors, codes the data intoa format that can be understood by the controlling section. This system also collects informationfrom the master device and implements commands that are directed by the master.
  2. 2. SMS BASED PATIENT REPORT FROM REMOTE PLACE1.2 BACK GROUND OF THE PROJECT The software application and the hardware implementation help themicrocontroller read the output of the sensors and send these values to the doctor’s mobilewhenever he sends a request to the controlling unit. The measure of efficiency is based on howfast the microcontroller can read the sensor output values and send a message to the doctor’smobile whenever these parameters exceed the normal values. The system is totally designedusing LCD and embedded systems technology. The Controlling unit has an application program to allow themicrocontroller read the sensor output values and send them to the user mobile whenever hesends a request to the controlling unit. The performance of the design is maintained bycontrolling unit. CHAPTER-2 PROJECT DESCRIPTION
  3. 3. SMS BASED PATIENT REPORT FROM REMOTE PLACE2.1 BLOCK DIAGRAM The block diagram of the design is as shown in Fig 3.1. It consists of power supply unit,microcontroller, GSM modem, Serial communication unit, sensor module. The brief descriptionof each unit is explained as follows. Fig: Block diagram for Heartbeat Monitoring System2.2 CIRCUIT DIAGRAM
  5. 5. SMS BASED PATIENT REPORT FROM REMOTE PLACE The working of the project goes like this: The temperature and heartbeat of the patientwill be monitored continuously and the status of the patient will be monitored and sent to thedoctor wherever he may be. Thus, the two values, the temperature and the heartbeat pulse will be sent to the doctorwho knows the entire health conditions of the patient. Thus, to send this data, we are using thewireless technology, GSM. When the monitoring system sends a message to the doctor’s mobile,even this system should have a device which can send or receive the messages from/to thedoctor. The device we are using is the GSM modem. The modem is exactly similar to our mobilephones. Even the modem requires a SIM card to communicate with the outside world. Themodem will be interfaced with the microcontroller through serial interface. The data which are monitored continuously in this project are Temperature and Heartbeatof the patient. The analog quantities are taken and converted into corresponding digital valuesusing a single channel ADC. This converted digital value is sent to the microcontroller. Themicrocontroller temporarily stores this value. The doctor can read the temperature and heartbeat value whenever he wishes to. Thedoctor can take care of the patient’s condition wherever he may be. The doctor has to sendpredefined messages to the modem to retrieve the data. The modem receives the predefinedmessages and intimates the same to the microcontroller. Now, it is the job of the microcontrollerto read the value, process it and send the requested value to the doctor’s mobile. The user canread the updated data whenever he reads the predefined messages to the modem. These valuescan also be displayed on the LCD. CHAPTER 3 MICROCONTROLLER
  6. 6. SMS BASED PATIENT REPORT FROM REMOTE PLACE3.1. A brief history of the 8051 family: In 1981, Intel Corporation introduced an 8-bit microcontroller called the 8051. Thismicrocontroller had 128 bytes of RAM,4K bytes of on- chip ROM, two timers, one serial port,and four ports(each 8-bit wide) all on a single chip. At the time it is also referred to as a “systemon chip.” This is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at atime. Data larger than 8 bits has to be broken into 8 bit pieces to be processed by the CPU. The8051 has a total of four I/O ports, each 8-bit wide. The 8051 became widely popular after Intel allowed other manufactures to make andmarket any flavors of the 8051 they please with the condition that they remain code-compatiblewith the 8051. This led to many versions of the 8051 with different speeds and amounts of on-chip ROM marketed by more than half a dozen manufacturers. It is important to note thatalthough there are different flavors of the 8051 in terms of speed and amount of on-chip ROM,they are all compatible with the original 8051 as far as the instructions are concerned. Thismeans that if you write your program for one, it will run on any of them regardless of themanufacturer. “The 8051 is the original member of the 8051 family. Intel refers to it as MCS-51.” The Microcontroller AT89c51 is from Atmel Corporation. It has a wide collection of 8051chips, as shown below. The AT89C51 is a popular and inexpensive chip used in many smallprojects. It has 4K bytes of flash ROM. Notice that AT89C51-12PC, where “C” before the 51stands for CMOS, which has low power consumption, “12” indicates 12MHz, “P” is for plasticDIP package, and another “C” is for commercial.3.2 FEATURESCompatible with MCS-51 Products8K Bytes of In-System Reprogrammable Flash Memory
  7. 7. SMS BASED PATIENT REPORT FROM REMOTE PLACEFully Static Operation: 0 Hz to 33 MHzThree-level Program Memory Lock256 x 8-bit Internal RAM32 Programmable I/O LinesThree 16-bit Timer/CountersEight Interrupt SourcesProgrammable Serial ChannelLow-power Idle and Power-down Modes4.0V to 5.5V Operating RangeFull Duplex UART Serial ChannelInterrupt Recovery from Power-down ModeWatchdog TimerDual Data PointerPower-off FlagFast Programming TimeFlexible ISP Programming (Byte and Page Mode3.3 PIN DIAGRAM:
  8. 8. SMS BASED PATIENT REPORT FROM REMOTE PLACE FIG PIN DIAGRAM OF 89S52 IC3.4 PIN DESCRIPTIONVCCSupply voltage.GNDGround.Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin cansink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance inputs. Port 0 can also be configured to be the multiplexed low order address/data busduring accesses to external program and data memory. In this mode, P0 has internal pull-ups.Port 0 also receives the code bytes during Flash programming and outputs the code bytes duringprogram verification.External pull-ups are required during program verification.
  9. 9. SMS BASED PATIENT REPORT FROM REMOTE PLACEPort 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 outputbuffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled highby the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally beingpulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receivesthe low-order address bytes during Flash programming and verification.Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 outputbuffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled highby the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally beingpulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-orderaddress byte during fetches from external program memory and during accesses to external datamemory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses stronginternal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bitaddresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2also receives the high-order address bits and some control signals during Flash programming andverification.Port 3
  10. 10. SMS BASED PATIENT REPORT FROM REMOTE PLACE Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 outputbuffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled highby the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally beingpulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions ofvarious special features of the AT89S52, as shown in the following table. Port 3 also receivessome control signals for Flash programming and verification.RST Reset input. A high on this pin for two machine cycles while the oscillator isrunning resets the device. This pin drives High for 96 oscillator periods after the Watchdog timesout. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In thedefault state of bit DISRTO, the RESET HIGH out feature is enabled. ALE/PROG AddressLatch Enable (ALE) is an output pulse for latching the low byte of the address during accesses toexternal memory. This pin is also the program pulse input (PROG) during Flash programming.In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may beused for external timing or clocking purposes. Note, however, that one ALE pulse is skippedduring each access to external data memory. If desired, ALE operation can be disabled by settingbit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVCinstruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect ifthe microcontroller is in external execution mode.PSEN
  11. 11. SMS BASED PATIENT REPORT FROM REMOTE PLACE Program Store Enable (PSEN) is the read strobe to external program memory.When the AT89S52 is executing code from external program memory, PSEN is activated twiceeach machine cycle, except that two PSEN activations are skipped during each access to externaldata memory.EA/VPP External Access Enable. EA must be strapped to GND in order to enable the deviceto fetch code from external program memory locations starting at 0000H up to FFFFH. Note,however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should bestrapped to VCC for internal program executions. This pin also receives the 12-voltprogramming enable voltage(VPP) during Flash programming.XTAL1Input to the inverting oscillator amplifier and input to theInternal clock operating circuit.XTAL2 Output from the inverting oscillator amplifier. CHAPTER 4 POWER SUPPLYAll digital circuits require regulated power supply. In this article we are going to learn how to geta regulated positive supply from the mains supply.
  12. 12. SMS BASED PATIENT REPORT FROM REMOTE PLACEFigure shows the basic block diagram of a fixed regulated power supply. Let us go through eachblock.4.1 TRANSFORMERA transformer consists of two coils also called as “WINDINGS” namely PRIMARY &SECONDARY. They are linked together through inductively coupled electrical conductors alsocalled as CORE. A changing current in the primary causes a change in the Magnetic Field in thecore & this in turn induces an alternating voltage in the secondary coil. If load is applied to thesecondary then an alternating current will flow through the load. If we consider an idealcondition then all the energy from the primary circuit will be transferred to the secondary circuitthrough the magnetic field.So
  13. 13. SMS BASED PATIENT REPORT FROM REMOTE PLACEThe secondary voltage of the transformer depends on the number of turns in the Primary as well as in thesecondary.4.2 RECTIFIERA rectifier is a device that converts an AC signal into DC signal. For rectification purpose we usea diode, a diode is a device that allows current to pass only in one direction i.e. when the anodeof the diode is positive with respect to the cathode also called as forward biased condition &blocks current in the reversed biased condition.Rectifier can be classified as follows:1) Half Wave rectifier.This is the simplest type of rectifier as you can see in the diagram a half wave rectifier consistsof only one diode. When an AC signal is applied to it during the positive half cycle the diode isforward biased & current flows through it. But during the negative half cycle diode is reversebiased & no current flows through it. Since only one half of the input reaches the output, it isvery inefficient to be used in power supplies. 2) Full wave rectifier.
  14. 14. SMS BASED PATIENT REPORT FROM REMOTE PLACEHalf wave rectifier is quite simple but it is very inefficient, for greater efficiency we would liketo use both the half cycles of the AC signal. This can be achieved by using a center tappedtransformer i.e. we would have to double the size of secondary winding & provide connection tothe center. So during the positive half cycle diode D1 conducts & D2 is in reverse biasedcondition. During the negative half cycle diode D2 conducts & D1 is reverse biased. Thus we getboth the half cycles across the load.One of the disadvantages of Full Wave Rectifier design is the necessity of using a center tappedtransformer, thus increasing the size & cost of the circuit. This can be avoided by using the FullWave Bridge Rectifier.3) Bridge Rectifier.
  15. 15. SMS BASED PATIENT REPORT FROM REMOTE PLACEAs the name suggests it converts the full wave i.e. both the positive & the negative half cycleinto DC thus it is much more efficient than Half Wave Rectifier & that too without using a centertapped transformer thus much more cost effective than Full Wave Rectifier. Full Bridge WaveRectifier consists of four diodes namely D1, D2, D3 and D4. During the positive half cyclediodes D1 & D4 conduct whereas in the negative half cycle diodes D2 & D3 conduct thus thediodes keep switching the transformer connections so we get positive half cycles in the output.If we use a center tapped transformer for a bridge rectifier we can get both positive & negativehalf cycles which can thus be used for generating fixed positive & fixed negative voltages.4.3 VOLTAGE REGULATORA Voltage regulator is a device which converts varying input voltage into a constant regulatedoutput voltage. Voltage regulator can be of two types1) Linear Voltage Regulator Also called as Resistive Voltage regulator because they dissipate the excessive voltageresistively as heat.2) Switching Regulators. They regulate the output voltage by switching the Current ON/OFF very rapidly. Since theiroutput is either ON or OFF it dissipates very low power thus achieving higher efficiency ascompared to linear voltage regulators. But they are more complex & generate high noise due to
  16. 16. SMS BASED PATIENT REPORT FROM REMOTE PLACEtheir switching action. For low level of output power switching regulators tend to be costly butfor higher output wattage they are much cheaper than linear regulators.The most commonly available Linear Positive Voltage Regulators are the 78XX series where theXX indicates the output voltage. And 79XX series is for Negative Voltage Regulators.After filtering the rectifier output the signal is given to a voltage regulator. The maximum inputvoltage that can be applied at the input is 35V.Normally there is a 2-3 Volts drop across theregulator so the input voltage should be at least 2-3 Volts higher than the output voltage. If theinput voltage gets below the Vmin of the regulator due to the ripple voltage or due to any otherreason the voltage regulator will not be able to produce the correct regulated voltage.3 Circuit diagram: Fig 2.3. Circuit Diagram of power supply IC 7805:7805 is an integrated three-terminal positive fixed linear voltage regulator. It supports an inputvoltage of 10 volts to 35 volts and output voltage of 5 volts. It has a current rating of 1 ampalthough lower current models are available. Its output voltage is fixed at 5.0V. The 7805 also
  17. 17. SMS BASED PATIENT REPORT FROM REMOTE PLACEhas a built-in current limiter as a safety feature. 7805 is manufactured by many companies,including National Semiconductors and Fairchild Semiconductors.The 7805 will automatically reduce output current if it gets too hot.The last two digits representthe voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series of regulators isdesigned to work in complement with the 79xx series of negative voltage regulators in systemsthat provide both positive and negative regulated voltages, since the 78xx series cant regulatenegative voltages in such a system.The 7805 & 78 is one of the most common and well-known of the 78xx series regulators, as itssmall component count and medium-power regulated 5V make it useful for powering TTLdevices. Table. Specifications of IC7805 SPECIFICATIONS IC 7805 Vout 5V Vein - Vout Difference 5V - 20V Operation Ambient Temp 0 - 125°C Output Imax 1A
  18. 18. SMS BASED PATIENT REPORT FROM REMOTE PLACE CHAPTER-5 SENSORS The sensors used in this project are Heartbeat and Temperature sensor. Theoutput of temperature sensor is given to the ADC so as to convert the analog value into digitaldata and then give it to the microcontroller. The Heartbeat sensor used is basically a LED andLDR arrangement.5.1 HERT BEAT SENSOR
  19. 19. SMS BASED PATIENT REPORT FROM REMOTE PLACELED and LDR arrangement The Heartbeat sensor used in this project is basically a LED and LDR arrangement.The LED used in this arrangement is a high intensity LED. Heart beat is sensed by using a high intensity type LED and LDR. The finger isplaced between the LED and LDR. As sensor, a photo diode or a photo transistor can be used.The skin may be illuminated with visible (red) using transmitted or reflected light for detection.The very small changes in reflectivity or in transmittance caused by the varying blood content ofhuman tissue are almost invisible. Various noise sources may produce disturbance signals withamplitudes equal or even higher than the amplitude of the pulse signal. Valid pulse measurementtherefore requires extensive preprocessing of the raw signal. The setup described here uses a red LED for transmitted light illumination anda LDR as detector. With only slight changes in the preamplifier circuit the same hardware andsoftware could be used with other illumination and detection concepts. These values are sent tothe ADC for conversion of analog to digital and then sent to the microcontroller.5.2 LM35 TEMPERATURE SENSOR
  20. 20. SMS BASED PATIENT REPORT FROM REMOTE PLACE LM35 converts temperature value into electrical signals. LM35 series sensors areprecision integrated-circuit temperature sensors whose output voltage is linearly proportional tothe Celsius temperature. The LM35 requires no external calibration since it is internallycalibrated. . The LM35 does not require any external calibration or trimming to provide typicalaccuracies of ±1⁄4°C at room temperature and ±3⁄4°C over a full −55 to +150°C temperaturerange.The LM35’s low output impedance, linear output, and precise inherent calibration makeinterfacing to readout or control circuitry especially easy. It can be used with single powersupplies, or with plus and minus supplies. As it draws only 60 μA from its supply, it has verylow self-heating, less than 0.1°C in still air.5.2.1 FEATURES  Calibrated directly in ° Celsius (Centigrade)  Linear + 10.0 mV/°C scale factor  0.5°C accuracy guaranteed (at +25°C)  Rated for full −55° to +150°C range  Suitable for remote applications  Low cost due to wafer-level trimming  Operates from 4 to 30 volts  Less than 60 μA current drain  Low self-heating, 0.08°C in still air  Nonlinearity only ±1⁄4°C typical  Low impedance output, 0.1 W for 1 mA load
  21. 21. SMS BASED PATIENT REPORT FROM REMOTE PLACEThe characteristic of this LM35 sensor is:For each degree of centigrade temperature it outputs 10milli volts. CHAPTER-6 ANALOG TO DIGITAL CONVERTER Analog-to-digital converters are among the most widely used devices for dataacquisition. Digital systems use binary values, but in the physical world everything is continuousi.e., analog values. Temperature, pressure (wind or liquid), humidity and velocity are thephysical analog quantities. These physical quantities are to be converted into digital values forfurther processing. One such device to convert these physical quantities into electrical signals issensor. Sensors for temperature, pressure, humidity, light and many other natural quantitiesproduce an output that is voltage or current.
  22. 22. SMS BASED PATIENT REPORT FROM REMOTE PLACE Thus, an analog-to-digital converter is needed to convert these electricalsignals into digital values so that the microcontroller can read and process them. An ADC has ann-bit resolution where n can be 8,10,12,16 or even 24 bits. The higher resolution ADC provides asmaller step size, where step size is the smallest change that can be detected by an ADC. Inaddition to resolution, conversion time is another major factor in judging an ADC. Conversiontime is defined as the time it takes the ADC to convert the analog input to a digital number.6.1 PIN DIAGRAMADC0804: The ADC chip that is used in this project is ADC0804. The ADC0804 IC is an8-bit parallel ADC in the family of the ADC0800 series from National Semiconductor. It workswith +5 volts and has a resolution of 8 bits. In the ADC0804, the conversion time variesdepending on the clocking signals applied to the CLK IN pin, but it cannot be faster than 110µs.6.2 PIN DESCRIPTIONCS (Chip select)Chip select is an active low input used to activate the ADC0804 chip. To access the ADC0804,this pin must be low.RD (read)
  23. 23. SMS BASED PATIENT REPORT FROM REMOTE PLACEThis is an input signal and is active low. ADC converts the analog input to its binary equivalentand holds it in an internal register. RD is used to get the data out of ADC0804 chip. When CS=0,if a high-to-low pulse is applied to the RD pin, the 8-bit digital output shows up at the D0-D7data pins.WR (write)This is an active low input used to inform the ADC0804 to start the conversion process.If CS=0 when WR makes a low-to-high transition, the ADC0804 starts converting the analoginput value Vin to an 8-bit digital value. The amount of time it takes to convert varies dependingon the CLK IN and CLK R values.CLK IN and CLK R CLK IN is an input pin connected to an external clock source when an external clock isused for timing. However, the 804 has an internal clock generator. To use the internal clockgenerator of the ADC0804, the CLK IN and CLK R are connected to a capacitor and a resistor.In that case, the clock frequency is determined by the equation:f = 1/ (1.1RC)Typical values are R=10K ohms and C= 150 pf. Substituting in the above equation, thefrequency is calculated as 606 kHz. Thus, the conversion time is 110µs.INTRThis is an output pin and is active low. It is a normally high pin and when the conversion isfinished, it goes low to signal the CPU that the converted data is ready to be picked up. AfterINTR goes low, the CS pin is made low i.e., CS=0 and send a high-to-low pulse to the RD pin toget the data out of the ADC0804 chip.
  24. 24. SMS BASED PATIENT REPORT FROM REMOTE PLACEVin(+) and Vin(-)These are the differential analog inputs where Vin=Vin(+) – Vin(-). The Vin(-) pin is connectedto ground and the Vin(+) pin is used as the analog input to be converted to digital.VccThis is the +5 volt power supply. It is also used as a reference voltage when the Vref/2 input (pin9) is open.Vref/2Pin 9 is an input voltage used for the reference voltage. If this pin is open, the analog inputvoltage for the ADC0804 is in the range of 0 to 5 volts.Vref/2 is used to implement analog inputvoltages other than 0.5V. i.e., if the analog input range needs to be 0 to 4 volts, Vref/2 isconnected to 2 volts.D0-D7 D0-D7 (D7 is the MSB) are the digital data output pins since ADC0804 is aparallel ADC chip. To calculate the output voltage, the below equation is used: Dout = Vin/ (step size)where Dout = digital data output pins (in decimal) and Vin = analog input valueAnalog ground and Digital ground These are the input pins providing the ground for both the analog signal and thedigital signal. Analog ground is connected to the ground of the analog Vin while digital groundis connected to the ground of the Vcc pin.Clock source for ADC0804:
  25. 25. SMS BASED PATIENT REPORT FROM REMOTE PLACE The speed at which an analog input is converted to the digital output depends on thespeed of the CLK input. According to the ADC0804 datasheets, the typical operating frequencyis approximately 640 kHz at 5 volts.ADC interface with Microcontroller:
  26. 26. SMS BASED PATIENT REPORT FROM REMOTE PLACE CHAPTER-7 LIQUID CRYSTAL DISPLAYLCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs (sevensegment LEDs or other multi segment LEDs) because of the following reasons: 1. The declining prices of LCDs. 2. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which are limited to numbers and a few characters. 3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying the data. 4. Ease of programming for characters and graphics.7.1 LCD SCREENLCD screen consists of two lines with 16 characters each. Each character consists of 5x7 dotmatrix. Contrast on display depends on the power supply voltage and whether messages aredisplayed in one or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked asVee. Trimmer potentiometer is usually used for that purpose. Some versions of displays have
  27. 27. SMS BASED PATIENT REPORT FROM REMOTE PLACEbuilt in backlight (blue or green diodes). When used during operating, a resistor for currentlimitation should be used (like with any LE diode).LCD ConnectionDepending on how many lines are used for connection to the microcontroller, there are 8-bit and4-bit LCD modes. The appropriate mode is determined at the beginning of the process in a phasecalled “initialization”. In the first case, the data are transferred through outputs D0-D7 as it hasbeen already explained. In case of 4-bit LED mode, for the sake of saving valuable I/O pins ofthe microcontroller, there are only 4 higher bits (D4-D7) used for communication, while othermay be left unconnected.Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that normallywould be sent through lines D4-D7), four lower bits are sent afterwards. With the help ofinitialization, LCD will correctly connect and interpret each data received.
  28. 28. SMS BASED PATIENT REPORT FROM REMOTE PLACEBesides, with regards to the fact that data are rarely read from LCD (data mainly are transferredfrom microcontroller to LCD) one more I/O pin may be saved by simple connecting R/W pin tothe Ground. Such saving has its price.Even though message displaying will be normally performed, it will not be possible to read frombusy flag since it is not possible to read from display.7.2 LCD INTERFACING WITH 8051
  29. 29. SMS BASED PATIENT REPORT FROM REMOTE PLACE CHAPTER-8 RS-232 AND MAX-2328.1 RS 232: RS-232 is simple, universal, well understood and supported but it has someserious shortcomings as a data interface. The standards to 256kbps or less and line lengthsof 15M (50 ft) or less but today we see high speed ports on our home PC running very highspeeds and with high quality cable maxim distance has increased greatly. The rule ofthumb for the length a data cable depends on speed of the data, quality of the cable. . Sub-D15 Male Sub-D15 FemaleThis is a standard 9 to 25 pin cable layout for async data on a PC AT serial cable Description Signal 9-pin DTE 25-pin DCE Source DTE or DCE Carrier Detect CD 1 8 from Modem Receive Data RD 2 3 from Modem Transmit Data TD 3 2 from Terminal/Computer Data Terminal Ready DTR 4 20 from Terminal/Computer Signal Ground SG 5 7 from Modem Data Set Ready DSR 6 6 from Modem Request to Send RTS 7 4 from Terminal/Computer Clear to Send CTS 8 5 from Modem Ring Indicator RI 9 22 from Modem
  31. 31. SMS BASED PATIENT REPORT FROM REMOTE PLACE The MAX232 device is a dual driver/receiver that includes a capacitive voltagegenerator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-232inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a typicalhysteresis of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOS input levels intoEIA-232 levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas .8.2.1 FEATURES:• Operates With Single 5-V Power Supply• Lin Bi CMOS Technology• Two Drivers and Two Receivers• 30-V Input Levels• Low Supply Current . . . 8 mA Typical• Meets or Exceeds TIA/EIA-232-F and ITU• Recommendation V.288.2.2 APPLICATIONS:• TIA/EIA-232-F• Battery-Powered Systems• Terminals• Modems• Computers• ESD Protection Exceeds 2000 V Per• MIL-STD-883, Method 3015• Package Options Include Plastic• Small-Outline (D, DW) Packages and• Standard Plastic (N) DIPs
  32. 32. SMS BASED PATIENT REPORT FROM REMOTE PLACEAbsolute maximum ratings• Input supply voltage range, VCC : – 0.3 V to 6 V• Positive output supply voltage range: VS+ VCC – 0.3 V to 15 V• Negative output supply voltage range: VS––0.3 V to –15 V• Input voltage range, VI: Driver:–0.3 V to VCC + 0.3 V• Receiver: 30 V• Output voltage range, VO: T1OUT, T2OUT VS –0.3 V to VS+ + 0.3 V• R1OUT, R2OUT : –0.3 V to VCC + 0.3 V• Short-circuit duration: T1OUT, T2OUT: Unlimited• Package thermal impedance, D package :113°C/W• DW package : 105°C/W• N package : 78°C/W• Storage temperature range, Tstg : –65°C to 150°C• Lead temperature 1,6 mm (1/16 inch) from case for 10 seconds: 260C Stresses beyond those listed under “absolute maximum ratings” may cause permanentdamage to the device. These are stress ratings only, and functional operation of the device at
  33. 33. SMS BASED PATIENT REPORT FROM REMOTE PLACEthese or any other conditions beyond those indicated under “recommended operating conditions”is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affectdevice reliability. NOTE 1: All voltage values are with respectto network ground terminal.2. The package thermal impedance is calculated in accordance withJESD 51, except for through-hole packages, which use a trace length of zero description8.2.3. MAX 232 Interfacing with RS232 and 89C51 microcontroller: The MAX232 device is a dual driver/receiver that includes a capacitive voltagegenerator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver convertsEIA-232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V anda typical hysterics of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOSinput levels into EIA-232 levels. The driver, receiver, and voltage-generator functions areavailable as cells in the Texas. CHAPTER-9 GSM MODEM
  34. 34. SMS BASED PATIENT REPORT FROM REMOTE PLACE9.1 THEORYUnlike mobile phones, a GSM modem doesn’t have a keypad and display to interact with. It justaccepts certain commands through a serial interface and acknowledges for those. Thesecommands are called as AT commands. There are a list of AT commands to instruct the modemto perform its functions. Every command starts with "AT". That’s why they are called as ATcommands. AT stands for attention. SMS Related AT Commands
  35. 35. SMS BASED PATIENT REPORT FROM REMOTE PLACEAT It is used to test the connection. It is used to instruct the modem to operate in text mode. AT+CMGF=0AT+CMGF=1 will instruct the modem to operate in PDU mode. It is used to send a text message. It accepts the recipient mobileAT+CMGS="mobile number. As soon as this command is accepted the modem waits for thenumber" message content. The text message has to be sent sequentially and terminated by the char 0x1A. It is used to store a message in the memory. After execution it returnsAT+CMGW="mobile an index for the message stored. Eg: AT+CMGW=1 . Here 1 is thenumber" index for the saved message. Later this index is used to process the message like deleting it or forwarding to the recipient number. It is used to delete a message from the storage. The index of the storedAT+CMGD=2 message is used to delete it. Above command deletes the message with index 2.In our simple project, the program waits for the mobile number to be entered through thekeyboard. When a ten digit mobile number is provided, the program instructs the modem to sendthe text message using a sequence of AT commandsTesting your GSM modem • The GSM modem can be tested by connecting it with a PC. The modem is equipped with a RS232 cable. Just use a Serial to USB converter and connect it with the PC. • Now you can proceed with sending the commands to the modem using any serial communication program like Hyperterminal, minicom etc. Ensure the serial paramters are configured to 8N1 and the baudrate is set to 9600bps. • For each command you send the modem acknowledges with a message. Example: Just try sending "AT" to the modem. It sends back a result code "OK" which states that the modem is responding. If it’s not working fine, it sends "ERROR". APPLICATIONS1. All the parameters can be viewed on the mobile phone.
  36. 36. SMS BASED PATIENT REPORT FROM REMOTE PLACE2. Most reliable.3. Cost effective.4. Supports innumerable sensors to the system. RESULTS AND CONCLUSION Results Assemble the circuit on the PCB as shown in Fig 5.1. After assembling the circuit on thePCB, check it for proper connections before switching on the power supply.Conclusion
  37. 37. SMS BASED PATIENT REPORT FROM REMOTE PLACE The implementation of Heartbeat Monitoring System using GSM is done successfully. Thecommunication is properly done without any interference between different modules in the design.Design is done to meet all the specifications and requirements. Software tools like Keil UvisionSimulator, Proload to dump the source code into the microcontroller, Orcad Lite for the schematicdiagram have been used to develop the software code before realizing the hardware. The performance of the system is more efficient. Continuously reading the output fromthe sensors and pass the data to the doctor’s mobile whenever the read values exceed the normalvalues or whenever the doctor sends a request to the controlling unit is the main job carried outby the microcontroller. The mechanism is controlled by the microcontroller. Circuit is implemented in Orcad and implemented on the microcontroller board. The performancehas been verified both in software simulator and hardware design. The total circuit is completely verifiedfunctionally and is following the application software.It can be concluded that the design implemented in the present work provide portability, flexibility andthe data transmission is also done with low power consumption. REFRENCES AND BIBLOGRAPHY  Muhammad Ali Mazidi , Janice Gillispie Mazidi, Rolin D. Mckinlay.Second edition, “THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM”  K. J. Ayala. Third edition, “The 8051 MICROCONTROLLER”  General information about electronic voting machine
  38. 38. SMS BASED PATIENT REPORT FROM REMOTE PLACE  Tutorial on microcontroller:  Tutorial on LCD: APPENDIXKeil Compiler: Keil compiler is software used where the machine language code is written and compiled.After compilation, the machine source code is converted into hex code which is to be dumpedinto the microcontroller for further processing. Keil compiler also supports C language code.
  39. 39. SMS BASED PATIENT REPORT FROM REMOTE PLACEFig Compilation of source Code
  40. 40. SMS BASED PATIENT REPORT FROM REMOTE PLACEFig Run the compiled programProload: Proload is software which accepts only hex files. Once the machine code is convertedinto hex code, that hex code has to be dumped into the microcontroller and this is done by theProload. Proload is a programmer which itself contains a microcontroller in it other than the onewhich is to be programmed. This microcontroller has a program in it written in such a way that itaccepts the hex file from the Keil compiler and dumps this hex file into the microcontrollerwhich is to be programmed. As the Proload programmer kit requires power supply to beoperated, this power supply is given from the power supply circuit designed above. It should benoted that this programmer kit contains a power supply section in the board itself but in order toswitch on that power supply, a source is required. Thus this is accomplished from the powersupply board with an output of 12volts.
  41. 41. SMS BASED PATIENT REPORT FROM REMOTE PLACEFig Atmel AT89C2051 Device programmerFeatures • Supports major Atmel 89 series devices • Auto Identify connected hardware and devices • Error checking and verification in-built • Lock of programs in chip supported to prevent program copying • 20 and 40 pin ZIF socket on-board • Auto Erase before writing and Auto Verify after writing • Informative status bar and access to latest programmed file • Simple and Easy to use • Works on 57600 speedDescription It is simple to use and low cost, yet powerful flash microcontroller programmer for theAtmel 89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and BlankCheck. All fuse and lock bits are programmable. This programmer has intelligent onboardfirmware and connects to the serial port. It can be used with any type of computer and requiresno special hardware. All that is needed is a serial communication ports which all computershave.
  42. 42. SMS BASED PATIENT REPORT FROM REMOTE PLACE All devices have signature bytes that the programmer reads to automatically identify thechip. No need to select the device type, just plug it in and go! All devices also have a number oflock bits to provide various levels of software and programming protection. These lock bits arefully programmable using this programmer. Lock bits are useful to protect the program to beread back from microcontroller only allowing erase to reprogram the microcontroller. Theprogrammer connects to a host computer using a standard RS232 serial port. All theprogramming intelligence is built into the programmer so you do not need any special hardwareto run it. Programmer comes with window based software for easy programming of the devices.Programming SoftwareComputer side software called Proload V4.1 is executed that accepts the Intel HEX format filegenerated from compiler to be sent to target microcontroller. It auto detects the hardware
  43. 43. SMS BASED PATIENT REPORT FROM REMOTE PLACEconnected to the serial port. It also auto detects the chip inserted and bytes used. Software isdeveloped in Delphi 7 and requires no overhead of any external DLL.Fig Writing the programs bytes onto the microcontrollerProject source codeMain code:#include<reg51.h>
  44. 44. SMS BASED PATIENT REPORT FROM REMOTE PLACE#include"lcddisplay.h"#include"UART.h"#include"eeprom.h"#include<string.h>sbit temp = P2^2;sbit panic = P2^3;sbit finger = P2^7;//void long_delay();unsigned char mobilenum1[10];unsigned char rec[20];unsigned char str[10],mobilenum[11];code unsigned char str1[]={"OK"};unsigned char l,s,n,a,b,i,count,j,jjj,hb=68;void main(){temp=panic=finger=1;lcd_int();USART_int();
  45. 45. SMS BASED PATIENT REPORT FROM REMOTE PLACElcdcmd(0x84);msgdisplay(" welcome " );delay(1000);lcdcmd(0x01);msgdisplay("searching for");lcdcmd(0xc0);msgdisplay("GSM modem");delay(100);send_to_modem("ate0"); //to avoid echo signals,enter(); send_to_modem("at"); // TO CHECKING GSM MODEM... enter(); for(s=0;s<5;s++) // Here we are waiting for data whitch is sending by GSM modem { // to checking wether the GSM modem connected to system or while(RI==0); // not. str[s]=SBUF; RI=0; } /*str[s]=0; lcdcmd(0x01);
  46. 46. SMS BASED PATIENT REPORT FROM REMOTE PLACE msgdisplay1(str); long_delay(); n=strcmp(str3,str1); if(n) goto again; // GSM modem if those are matching then followingmessages else {*/ // are displaying on LCD. lcdcmd(0x01); msgdisplay("SYSTEM"); lcdcmd(0xc3); msgdisplay("CONNECTED");// } send_to_modem("at+cmgf=1"); enter(); send_to_modem("at+cmgd=1"); enter(); send_to_modem("at+cmgd=2"); enter(); send_to_modem("at+cmgd=3"); enter();
  47. 47. SMS BASED PATIENT REPORT FROM REMOTE PLACERI=0; lcdcmd(0x01); msgdisplay(mobilenum);st:delay(2500); while(RI==1) { RI=0; delay(100); } lcdcmd(0x01); msgdisplay("patient "); lcdcmd(0xc0); msgdisplay("monitoring systm"); while(RI==1);while(1)
  48. 48. SMS BASED PATIENT REPORT FROM REMOTE PLACE {hb=hb+1;if(hb==80) hb=69; if(finger==0) { delay(500); if((finger==0)&&(hb>79)) { lcdcmd(0x1); msgdisplay(" high heartbeat"); send_to_modem("at+cmgs="); ch_send_to_modem("); send_to_modem(mobilenum); ch_send_to_modem("); enter(); send_to_modem("emergency alert for patient xyz.."); ch_send_to_modem(0x1a);
  49. 49. SMS BASED PATIENT REPORT FROM REMOTE PLACE enter(); while(RI==0); a=SBUF; RI=0; if(a==13) { lcdcmd(0x01); msgdisplay("message sent"); goto st; }} else { lcdcmd(0x01);msgdisplay("heart beat: "); lcddata((hb/10)+48); lcddata((hb%10)+48); delay(500); while(finger==0); } goto st; }
  50. 50. SMS BASED PATIENT REPORT FROM REMOTE PLACE if(temp==0){ resend: lcdcmd(0x01); msgdisplay("over temp"); lcdcmd(0xc3); msgdisplay("sending msg"); send_to_modem("at+cmgs="); ch_send_to_modem("); send_to_modem(mobilenum); ch_send_to_modem("); enter(); send_to_modem("abnormal temerature from room1 "); ch_send_to_modem(0x1a); enter(); while(RI==0); a=SBUF; RI=0; while(RI==0); b=SBUF; RI=0; if(a==13)
  51. 51. SMS BASED PATIENT REPORT FROM REMOTE PLACE { lcdcmd(0x01); msgdisplay("message sent "); goto st; } else { delay(2000); goto resend; } }if(panic==0) { resend1: lcdcmd(0x01); msgdisplay("emergency alert from room1"); lcdcmd(0xc3); msgdisplay("sending msg"); send_to_modem("at+cmgs="); ch_send_to_modem("); send_to_modem(mobilenum); ch_send_to_modem(");
  52. 52. SMS BASED PATIENT REPORT FROM REMOTE PLACE enter(); send_to_modem("emergency alert "); ch_send_to_modem(0x1a); enter(); while(RI==0); a=SBUF; RI=0; if(a==13) { lcdcmd(0x01); msgdisplay("message sent"); goto st; } else { delay(2000); goto resend1; }} }
  53. 53. SMS BASED PATIENT REPORT FROM REMOTE PLACE } } }} LCD CODE:#include<reg51.h>#define lcd_data P2#define lcd_cont() ((lcd_en=1),(delay(3)),(lcd_en=0))
  54. 54. SMS BASED PATIENT REPORT FROM REMOTE PLACE sbit lcd_rs = P2^1; sbit lcd_en = P2^0;void lcd_init(void);void lcdcmd(unsigned char value);void lcddata(unsigned char value);void msgdisplay(unsigned char b[]);void delay(unsigned int value);void lcd_init(void){lcdcmd(0x02);lcdcmd(0x02);lcdcmd(0x02);lcdcmd(0x28);lcdcmd(0x28);lcdcmd(0x28);lcdcmd(0x0c);lcdcmd(0x06);lcdcmd(0x01);}void lcdcmd(unsigned char value) // LCD COMMAND { lcd_data=value&(0xf0); lcd_rs=0;
  55. 55. SMS BASED PATIENT REPORT FROM REMOTE PLACE lcd_cont(); lcd_data=((value<<4)&(0xf0)); lcd_rs=0; lcd_cont();void lcddata(unsigned char value) { lcd_data=value&(0xf0); lcd_rs=1; lcd_cont(); delay(3); lcd_data=((value<<4)&(0xf0)); lcd_rs=1; lcd_cont(); delay(3); }void msgdisplay(unsigned char b[]) {unsigned char s,count=0;for(s=0;b[s]!=0;s++){ lcddata(b[s]);}
  56. 56. SMS BASED PATIENT REPORT FROM REMOTE PLACE}void delay(unsigned int value){ unsigned int x,y; for(x=0;x<100;x++) for(y=0;y<value;y++);}SERIAL COMMUNICATION CODE:#include<reg51.h>void UART_init();void send_to_modem(char*);void enter();void send(char);void ch_send_to_modem(char*);void UART_init(){ SCON = 0x50; TMOD = 0x20; TH1 = 0xFD; TR1 = 1;}void send_to_modem(char *s)
  57. 57. SMS BASED PATIENT REPORT FROM REMOTE PLACE{ while(*s != 0) { send(*s); s++; }}void ch_send_to_modem(char *s){ while(*s != 0) { send(*s); s++; } send(r); send(n);}void send(char x){ SBUF = x; while(TI == 0); TI = 0;}