56
Networking Based Patient Monitoring System INTRODUCTION Electronics & Telecommunication Department Page 1

Networking Based Patient Monitoring System Project Report

Embed Size (px)

Citation preview

Page 1: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

INTRODUCTION

Electronics & Telecommunication Department Page 1

Page 2: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.1 INTRODUCTION:-

Patient monitor or "multiparameter monitor" or also referred to as "physiological monitor" is a clinical use electronic machine designed to display and minimally interpret, a person's vital signs. Some monitors can warn of pending fatal cardiac conditions before visible signs are noticeable to clinical staff .The parameters (or measurements) usually consist of Pulse Oximetry (measurement of the saturated percentage of Oxygen in the blood referred to as SPO2), ECG (electro-Cardiograph of the P-QRS-T wave of the heart w/wo pacemaker), Blood pressure (either invasively through an inserted blood Pressure-to-transducer assembly or non-invasively with an Inflatable blood pressure cuff) ,and temperature (usually Skin temperature through an adhesive pad. There are more parameters such as cardiac output, CO2 measurement (referred to as ETCO2

or end-tidal carbondioxide), respiration (through ECG channel or via ETCO2, when it is called AWRR or Airway Respiratory Rate), anaesthetic gas measurement, etc.

Patient monitors can be broadly categorized as standalone or multiparameter. Standalone monitors continue to be used in developing countries like India mainly due to cost restraints and also because they are easy to manufacture and maintain.In developed part of the world, multiparameter monitors have supplanted them, in some cases because of statutory requirements (for example the us FDA) and also because if a clinician requires to monitor one channel then other channels are also needed to complement the data and get a complete picture of the patient's vital situation.

Example: “ECG+SPO2+respiration”,”SPO2+NIBP”,”ECG+SPO2+resporecg+SPO2+resp+NIBP+temp+pressure with or without ETCO2”.

Companies are working to integrate the physiological data from the isolated patient monitoring networks into the Emerging hospital digital charting systems using hl7. This Newer method of charting patient data reduces the likelihood of human documentation error and will eventually reduce overall paper consumption.

Electronics & Telecommunication Department Page 2

Page 3: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

ABSTRACT

Electronics & Telecommunication Department Page 3

Page 4: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.2 ABSTRACT:-

Networking based patient monitoring system is used to monitor the different parameters of patients remotely and simultaneously. In this system the doctor can monitor different parameters of many patients by sitting in his room. Parameters of each patient are recorded with the help of a microcontroller.

In our system we are going to use RS485 based networking system. It uses one master and three slave system which are connected to each other using RS485 protocol. Master unit consists of a microcontroller, serial communication cable to PC, RS485 communication module. The Slave unit consists of a microcontroller, sensors and RS485 communication cable. The slave unit reads the analog values from sensors and stores them into memory. When master sends a command for data then that particular slave has to send these values to the master. The master then sends these values to PC. The serial communication of the master with the computer is achieved by means of RS232 protocol.A visual basic program is used to display these values on screen. This program also stores these values on hard disk for future analysis.

This project provides real-time update of the patient’s health to the doctor. It reduces the frequent visits of the doctors to the patient in person.This project helps in conserving paper and thus saving very important trees. In our project, the number of patients can be increased depending upon the number of drivers allowed by RS485 protocol.

Thus the project provides the facility of virtual supervision for the doctors. This kind of monitoring system can be applied to the private rooms, semi-private rooms as well as general wards.

Electronics & Telecommunication Department Page 4

Page 5: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.3 COMPARISON WITH CURRENT SCENARIO:-

Fig 1.1

Fig 1.2 Sonography instrument

Electronics & Telecommunication Department Page 5

Page 6: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

The pictures Fig 1.1 and Fig1.2 show the current bedside monitors available in the hospitals. These bedside monitors are local the room in which they are installed. Here the doctor or the central nurse who is incharge of the ward has to visit every patient to check his/her health status and verify the parameter values.

The current scenario can be represented in a more simplified manner with the help of following sketch.

Fig 1.3

As shown in the sketch various sensors are connected to the patient’s body. The parameter values obtained from the sensors are shown on the bedside monitors. But these monitors are local to the room only and hence arises a need for remote monitoring.

1.4 NEED OF MONITORING:-

In unstable physiological regulatory systems, for example in the case of a drug overdose or anaesthesia.

In a life threatening condition, for example where there are indications of a heart attack.

Electronics & Telecommunication Department Page 6

Page 7: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

CONCEPTUAL DIAGRAM

Electronics & Telecommunication Department Page 7

Page 8: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.5 CONCEPTUAL DIAGRAM:-

Fig 1.4

The previous sketch can be replaced by the conceptual diagram shown above. Here instead of displaying the parameter values on the bedside monitors, they are given to the remote master who takes the responsibility of displaying the values on the doctor’s computer.Also the networking between master and slave is shown. For convinience only one slave is shown.

Electronics & Telecommunication Department Page 8

Page 9: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

SPECIFICATIONS

Electronics & Telecommunication Department Page 9

Page 10: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.6 SPECIFICATIONS OF THE PROJECT:- POWER SUPPLY SPECIFICATIONS: 230V AC mains

Regulated power supply using voltage regulator LM7805

Diodes for bridge rectifier 1N4007

SLAVE SPECIFICATIONS: Microcontroller 16F877A

SENSORS: Temperature Sensor : LM35

Bottle Level Sensor: Tx- bright LED, Rx-

Heart rate sensor:

MASTER SPECIFICATIONS: Microcontroller 16F877A RS232 protocol for serial communication with PC MAX 232 used to convert RS232 voltage levels to TTL and vice-versa

NETWORKING SPECIFICATIONS: RS485 networking protocol IC 75176 used to convert RS485 voltage levels to TTL and vice-versa Termination resistances of 120ohm and 870ohm

SOFTWARE SPECIFICATION:

Visual Basic 6

Electronics & Telecommunication Department Page 10

Page 11: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

BLOCK DIAGRAM

Electronics & Telecommunication Department Page 11

Page 12: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.7 BLOCK DIAGRAM:-

Fig 1.5

The figure represents block diagram of the project. It clearly indicates the data acquisition and the networking part.

Electronics & Telecommunication Department Page 12

Page 13: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

BLOCK DIAGRAM

DESCRIPTION

Electronics & Telecommunication Department Page 13

Page 14: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.8 BLOCK DIAGRAM DESCRIPTION:-

1.8.1 MICROCONTROLLER:-

Fig 1.6

The microcontroller used is PIC16F877A.

Features:-

High performance RISC processor.

Uses Harvard architecture.

Register files/data memory can be accesed directly or indirectly.

It has built in power- on- reset.

It has built in 10 bit ADC.

It can control upto 10 interrupt sources.

Contains built in serial peripheral interface.

It has two ports to drive output.

It has brown out reset.

Electronics & Telecommunication Department Page 14

Page 15: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.8.2 RS485 PROTOCOL:-

RS-485 is a telecommunications standard for binary serial communications between devices. It is the protocol or specifications that need to be followed to allow devices that implement this standard to speak to each other.This protocol is an updated version of the original serial protocol known as RS232. While the original RS-232 standard allowed for the connection of two devices through a serial link, RS-485 allows for serial connections between more than 2 devices on a networked system.

Default, all the senders on the RS485 bus are in tri-state with high impedance. In higher level protocols, one of the nodes is defined as a master who sends queries or commands over the RS485 bus.All other nodes receive these data. Depending on the information in the sent data, zero or more nodes on the line respond to the master. There are other implementations of RS485 networks where every node can start a data session on its own. This is comparable with the way ethernet networks function.

With such an implementation of a RS485 network it is necessary that there is error detection implemented in the higher level protocol to detect the data corruption and resend the information at a later time.There is no need for the senders to explicitly turn the RS485 driver on or off. RS485 drivers automatically return to their high impedance tri-state within a few microseconds after the data has been sent. Therefore it is not needed to have delays between the data packets on the RS485 bus.

RS485 is used as the electrical layer for many well known interface standards, including Profibus and Modbus. Therefore RS485 will be in use for many years in the future.

The graph below shows potentials of the '+' and '−' pins of an EIA-485 line during transmission of

one byte (0xD3) of data using anasynchronous start-stop method.

Fig 1.7

Electronics & Telecommunication Department Page 15

Page 16: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

COMPARISON OF VARIOUS PROTOCOL STANDARDS:-

Electronics & Telecommunication Department Page 16

Page 17: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

DESIGN AND INTERFACING

Electronics & Telecommunication Department Page 17

Page 18: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.9 DESIGN CONSIDERATIONS AND INTERFACING DETAILS:-

1.9.1 POWER SUPPLY:-

The basic step in the designing of any system is to design the power supply required for that system.The steps involved in the designing power supply are

i. Determine the total current that the system sinks from the supply.

ii. Determine the voltage rating required for the different components.

Fig 1.8

a) Transformer Selection:-

Minimum input required for LM7805 IC is given by the equation below.

Vin =Vreg + drop out voltage across LM7805 IC

= 5V + 2V

= 7V

The drop across diodes in the bridge rectifier is 1.4V

Minimum secondary voltage required is = 1.4 + 7 = 8.4V

Hence, unregulated power supply design is for 9V.

Electronics & Telecommunication Department Page 18

Page 19: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Vr (ripple voltage) = 10% of output voltage = 0.9V

Frequency = 50Hz

Time Period =1/50 = 20ms

b) Diode Design :-

PIV = Vm

Vm = 9V

Hence we select diode 1N4007

PIV = 100V, If = 1A

Reasons for choosing bridge rectifier:-

The TUF is increased to 0.812 as compared to the full wave rectifier.

The PIV across each diode is Vm and not 2Vm as in case of two diode rectifier.

Output of bridge rectifier is not pure DC. It contains some AC ripples in it. To remove these ripples we have used a capacitor as a filter, which smoothens the output voltage. We choose capacitor as a filter as it is cost effective, readily available and portable.Selection of capacitance depends on the current rating of the supply and selection of voltage rating for capacitor on the secondary voltage of the transformer.

c) Regulator Selection:-

PIC16F877A requires a supply of +5V. The sensors also require the same voltage supply.The sink current of the system is not more than 200mA.

Hence we select regulator IC LM7805.

Input voltage range: – 8V to 35V

Drop out voltage: – 2V

Output rating: – 5V

Electronics & Telecommunication Department Page 19

Page 20: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.9.2 SERIAL COMMUNICATION:-

DB-9 connector female

Fig 1.9

DB-9 connector male

Fig 2.0

Electronics & Telecommunication Department Page 20

Page 21: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

RS232 Protocol:-

The RS-232 interface is the Electronic Industries Association (EIA) standard for the interchange of serial binary data between two devices. It was initially developed by the EIA to standardize the connection of computers with telephone line modems.The standard allows as many as 20 signals to be defined, but gives complete freedom to the user.Three wires are sufficient: send data, receive data, and signal ground. The remaining lines can be hardwired on or off permanently. The signal transmission is bipolar, requiring two voltages, from 5 to 25 volts, of opposite polarity.

Communication Standards:-

The industry custom is to use an asynchronous word consisting of: a start bit, seven or eight data bits, an optional parity bit and one or two stop bits. The baud rate at which the word sent is device-dependent. The baud rate is usually 150 times an integer power of 2, ranging from 0 to 7 (150, 300, 600... 19,200). Below 150 baud, many system-unique rates are used. The standard RS-232-C connector has 25 pins, 21 pins which are used in the complete standard. Many of the modem signals are not needed when a computer terminal is connected directly to a computer. Specifying compliance to RS-232 only establishes that the signal levels in two devices will be compatible and that if both devices use the suggested connector, they may be able to be connected. Compliance to RS-232 does not imply that the devices will be able to communicate or even acknowledge each other's presence.

Electrical Characteristics:-

The RS-232-C specifies the signaling rate between the DTE and DCE, and a digital signal is used on all interchange circuits. The RS-232 standard specifies that logic "1" is to be sent as a voltage in the range -15 to -5 V and that logic "0" is to sent as a voltage in the range +5 to +15 V. The standard specifies that voltages of at least 3 V in amplitude will always be recognized correctly at the receiver according to their polarity, so that appreciable attenuation along the line can be tolerated. The transfer rate is rated > 20 kbps and a distance of < 15m. Greater distance and data rates are possible with good design, but it is reasonable to assume that these limits apply in practice as well as in theory.The load impedance of the terminator side of the interface must be between 3000 and 7000 ohms, and not more than 2500pF.

Electronics & Telecommunication Department Page 21

Page 22: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Working:-

Data is transmitted and received on pins 2 & 3 respectively Data Set Ready (DSR) is an indication for the data set that it is ON.Similarly DTR indicates to the data set that the DTE is ON. Data Carrier Detect (DCD) indicates that a good carrier is being received from the remote modem.Pins 4 (RST-Request to send from transmitting computer) and 5 (CTS- Clear to send from the data set) are used for handshaking purposes. In most aynchronous situations the RTS and CTS are continuously ON throughout the communication session.The DTE transmits when it sees CTS up. When the station has finished it’s transmission, it drops RTS and modem drops CTS and carrier together.

Typical Waveform:-

Fig 2.1

Waveform Explanation:-The bit by bit serial transmission is as shown above.The transmission starts with a “start” bit followed by 8 data bits (LSB to MSB) and ending with a “stop” bit.

Electronics & Telecommunication Department Page 22

Page 23: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

MAX232:-

Communication between PC and microcontroller is done using IC MAX232. It is a TTL to RS232 level converter. It converts +5V signal to +/-9V signal. The serial signals provided on these pins by the microcontroller are TTL signal levels and must be boosted and inverted through a suitable converter to comply with RS232 standard.A standard serial interfacing for a PC, MAX232 requires negative logic i.e. logic’1’ is -3V to -25V.

Connection Diagram:-

Fig 2.2

Pin Description:-

i. Vcc (Pin16):- Power supply pin for the device, +5V.

ii. V+ (Pin 2):- Positive supply for TIA/EIA-232-E drivers.

iii. V- (Pin 6):- Negative supply for TIA/EIA-232-E drivers.

Electronics & Telecommunication Department Page 23

Page 24: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

iv. C1+, C1-, C2+, C2- (Pins 1, 3, 4, 5 ):- External capacitor connection pins.

v. T1I, T2I (Pins 11, 10):-Driver input pins are TTL/CMOS compatible.Inputs of unused drivers may be left open, an internal active pull-up resistor (500kW min, typically 5MW) pulls input HIGH.Output will be low for open inputs.

vi. T1O, T2O (Pins 14, 7):-Driver output pins conform to TIA/EIA-232-E levels.

vii. R1I, R2I (Pins 13, 8):-Receiver input pins accept TIA/EIA-232-E input voltages ( + 25V). Receivers feature a noise filter and guaranteed hysteresis of 100mV.Unused receiver input pins may be left open.Internal input resistor 4.7kW pulls input low, providing a failsafe high output.

viii. R1O, R2O (Pins 12, 9):- Receiver output pins are TTL/CMOS compatible.Receiver output high voltage is specified for both CMOS and TTL load conditions.

ix. GND (Pin 15):- Ground pin.

Features:- Single +5V power supply. Low power Icc 3.0 mA maximum. Receiver noise filter. Package efficiency: - 2 drivers and 2 receivers. Available in plastic DIP, narrow and wide SOIC package.

Electronics & Telecommunication Department Page 24

Page 25: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

1.9.3 LCD INTERFACING:-

A typical LCD (Liquid Crystal Display) is as shown below

Fig 2.3In recent years LCD is finding widespread use replacing LED. This is due to the following reasons. Declining prices of LCD. Ability to display numbers, characters, and graphics. This is in contrast to LEDs, which are

limited to numbers and few characters. Ease of programming for character and graphics.

LCD connection diagram:-

Fig 2.4

Electronics & Telecommunication Department Page 25

Page 26: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Various terminals for LCD and the connections required are as shown in Fig 2.4. The trim pot for intensity variation of LCD is shown. With the help of this trim pot we can vary the brightness and intensity of LCD.

In our project we are using the LCD for debugging purpose. The LCDs can be connected to either of the slaves and the readings of the sensors and those being displayed on screen can be verified. Main advantage of using LCD is that the application becomes very user friendly and it serves as a very good debugging tool.

LCD Pin Description:-

Pin Symbol I/O Description1 Vss -- Ground2 Vcc -- +5V Power Supply3 Vee -- Power supply to

control contrast4 RS

(Register Select)I RS=0 to select

command registerRS=1 to select data

register5 R/W

(Read/Write)I R/W=0 for write

R/W=1 for read6 E I Enable7 DB0 I/O Data pin8 DB1 I/O Data pin9 DB2 I/O Data pin10 DB3 I/O Data pin11 DB4 I/O Data pin12 DB5 I/O Data pin13 DB6 I/O Data pin14 DB7 I/O Data pin

D0-D7:-The 8 bit data pins, D0 to D7, are used to send information to the LCD or read the content of the LCD internal registers. To display letters and numbers, we send ASCII codes for the letters, A-Z and numbers 0-9 to these pins while making RS=1.

Electronics & Telecommunication Department Page 26

Page 27: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

There are also instruction command codes that can be sent to clear the display or force the cursor to the home position or blink the cursor.

Following table lists the instruction command codes.

CODE (HEX) Command to LCD instruction register

1 Clear display screen

2 Return home

4 Decrement cursor

6 Increment cursor

5 Shift display left

7 Shift display right

8 Display off, cursor off

A Display off, cursor on

C Display on, cursor off

E Display on, cursor on

F Display on, cursor blinking

10 Shift cursor position to left

14 Shift cursor position to right

18 Shift entire display to left

1C Shift entire display to right

80 Force cursor to the beginning of first line

C0 Force cursor to the beginning of second line

38 Two lines and 5x7 matrix

Electronics & Telecommunication Department Page 27

Page 28: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

By using the table, programming is done and the generated code is sent to the LCD. Note that we must put along delay between issuing data or command to the LCD. However a much better way is to monitor the busy flag before issuing a command or data to the LCD.

Following fig shows interfacing with the microcontroller.

8

Fig 2.5

1.9.4 SN75176B:-

The SN65176B and SN75176B differential bus transceivers are integrated circuits designed for bidirectional data communication on multipoint bus transmission lines.They are designed for balanced transmission lines and meet ANSI Standards TIA/EIA-422-B and TIA/EIA-485-A. They also meet ITU recommendations V.11 and X.27.The SN65176B and SN75176B combine a 3-state differential line driver and a differential input line receiver, both of which operate from a single 5-V power supply. The driver and receiver have active-high and active-low enables, respectively, that can be connected together externally to function as a direction control. The driver differential outputs and the receiver differential inputs are connected internally to form differential input/output (I/O) bus ports that are designed to offer minimum loading to the bus when the driver is disabled or VCC = 0.The driver is designed for up to 60 mA of sink or source current. The driver features positive and negative current limiting and thermal shutdown for protection from line-fault conditions. Thermal shutdown is designed to occur at a junction temperature of approximately 150oC. The receiver features a minimum input impedance of 12 k, an input sensitivity of 200 mV.

Electronics & Telecommunication Department Page 28

33

40

PIC16F877

29

30

31

D0 Vcc

D7 LCD Vee

Vss RS

R/W E

1kPot

Page 29: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Features:- Bidirectional Transceivers Meet or Exceed the Requirements of ANSI Standards TIA/EIA-422-B and TIA/EIA-485-A

and ITU Recommendations V.11 and X.27 Designed for Multipoint Transmission on Long Bus Lines in Noisy Environments 3-State Driver and Receiver Outputs Individual Driver and Receiver Enables Wide Positive and Negative Input/Output Bus Voltage Ranges Driver Output Capability . . . ±60 mA Max Thermal Shutdown Protection Driver Positive and Negative Current Limiting Receiver Input Impedance . . . 12 k Min Receiver Input Sensitivity . . . ±200 mV Receiver Input Hysteresis . . . 50 mV Typ Operate From Single 5-V Supply

Connection Diagram:-

Fig 2.6

Electronics & Telecommunication Department Page 29

Page 30: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Differential wires are connected to the input terminals A and B of the IC. The IC can be interfaced with PIC microcontroller as shown above. This figure shows only single configuration of SN75176B but it can be used in multipoint configuration which can be clearly represented with the help of following diagram.

Fig 2.7

The figure shows that the networking employed by RS485 protocol and SN75176B transreceiver can support upto 32 transreceivers. Texas Instruments SN75176B transceiver that interfaces between RS-485 and TTL logic levels.The chip has a two-wire RS-485 interface, a TTL driver input and receiver output, and TTL enable inputs for the driver and receiver. Similar chips include Linear Technology’s LTC485, Maxim’s MAX485, and National Semiconductor’s DS3695.

1.9.5 RS485:-When a network needs to transfer small blocks of information over long distances, RS-485 is often the interface of choice.The network nodes can be PCs, microcontrollers, or any devices capable of asynchronous serial communications.Compared to Ethernet and other network interfaces, RS-485’s hardware and protocol requirements are simpler and cheaper. The RS-485 standard is flexible enough to provide a choice of drivers, receivers, and other components depending on the cable length, data rate, number of nodes, and the need to conserve power.Several vendors offer RS-485 transceivers with various combinations of features. Also, there are options for methods of terminating and biasing the line and controlling the driver-enable inputs.The interface popularly known as RS-485 is an electrical specification for multipoint systems that use balanced lines. RS-485 is similar to RS-422, but RS-422 allows just one driver with multiple receivers whereas RS-485 supports multiple drivers and receivers.The specification document (TIA/EIA-485-A) defines the electrical characteristics of the line and its drivers and receivers. There are brief suggestions relating to terminations and wiring, but there’s no

Electronics & Telecommunication Department Page 30

Page 31: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

discussion of connector pinouts or software protocols (as there is for RS-232). An RS-485 network can have up to 32 unit loads, with one unit load equivalent to an input impedance of 12k. By using high-impedance receivers, you can have as many as 256 nodes.An RS-485 link can extend as far as 4000’ and can transfer data at up to 10 Mbps, but not both at the same time. At 90 kbps, the maximum cable length is 4000’, at 1 Mbps it drops to 400’, and at 10 Mbps it drops to 50’.For more nodes or long distances, you can use repeaters that regenerate the signals and begin a new RS-485 line.

Although the RS-485 standard says nothing about protocols, most RS-485 links use the familiar asynchronous protocols supported by the UARTs in PCs and other computers. A transmitted word consists of a start bit followed by data bits, an optional parity bit, and a stop bit.Two ways to add RS-485 to a PC are on an expansion card and by attaching an RS-485 converter to an existing port. Converters for RS-232 are widely available and Inside Out Networks has developed a USB–to–RS-485 converter, also available from B&B Electronics.On microcontrollers, you can connect an RS-485 transceiver to any asynchronous serial port.

Many network circuits also require a port bit to control each transceiver’s driver-enable input. Ports designed for RS-232 communications can use the RTS output. If that’s not available, any spare output bit will do.Most serial-communications tools, including Visual Basic’s MSComm, support RS-485 communications with RTS controlled in software. The COMM-DRV serialportdrivers from WCSC have automatic RTS control built-in.

The main reason why RS-485 links can extend so far is their use of balanced,or differential, signals. Two wires (usually a twisted pair) carry the signal voltage and its inverse.The receiver detects the difference between the two. Because most noise that couples into the wires is common to both wires, it cancels out. In contrast, interfaces like RS-232 use unbalanced, or single-ended, signals.The receiver detects the voltage difference between a signal voltage and acommon ground. The ground wire tends to be noisy because it carries the return currents for all of the signals in the interface, along with whatever other noise has entered the wire from other sources. And noise on the ground wire can cause the receiver to misread transmitted logic levels. The datasheets for interface chips label the noninverted RS-485 line as line A and the inverted line as line B. An RS-485 receiver must see a voltage difference of just 200 mV between A and B. If A is at least 200 mV greater than B, the receiver’s output is logic high. If B is at least 200 mV greater than A, the output is a logic low. For differences less than 200 mV, the output is undefined. At the driver, the voltage difference must be at least 1.5 V, so the interface tolerates a fair amount of non-commonmode noise and attenuation. Vendors for RS-485 transceivers include Linear Technology, Maxim, National Semiconductor, and Texas Instruments. These companies are also excellent sources for application notes containing circuit examples and explanations of the theory behind them. RS-485 is designed to be wired in a daisy-chain or bus topology. Any stubs that connect a node to the line should be as short as possible. Most links use

Electronics & Telecommunication Department Page 31

Page 32: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

twisted pairs because of their ability to cancel magnetically and electromagnetically coupled noise.Advantage using twisted pair cable:-

Fig 2.8

In the picture above, noise is generated by magnetic fields from the environment. The picture shows the magnetic field lines and the noise current in the RS485 data lines that is the result of that magnetic field.

In the straight cable, all noise current is flowing in the same direction, practically generating a looping current just like in an ordinary transformer.

When the cable is twisted, we see that in some parts of the signal lines the direction of the noise current is the opposite from the current in other parts of the cable. Because of this, the resulting noise current is many factors lower than with an ordinary straight cable.

Shielding which is a common method to prevent noise in RS232 lines tries to keep hostile magnetic fields away from the signal lines.

Twisted pairs in RS485 communication however add immunity which is a much better way to fight noise. The magnetic fields are allowed to pass, but do no harm. If high noise immunity is needed, often a combination of twisting and shielding is used as for example in STP, shielded twisted pair and FTP, foiled twisted pair networking cables.

Electronics & Telecommunication Department Page 32

Page 33: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Differential signals and twisting allows RS485 to communicate over much longer communication distances than achievable with RS232. With RS485 communication distances of 1200 m are possible.

RS485 Network Topology:-

Fig 2.9

The RS485 network topology is as shown above. Various transreceivers are connected in a multidrop fashion as shown. The general network topology of RS485 is shown. N nodes are connected in a multipoint

RS485 network. For higher speeds and longer lines, the termination resistances are necessary on both ends of

the line to eliminate reflections. Use 100 Ω resistors on both ends. The RS485 network must be designed as one line with multiple drops, not as a star. Although

total cable length maybe shorter in a star configuration, adequate termination is not possible anymore and signal quality may degrade significantly.

Electronics & Telecommunication Department Page 33

Page 34: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Fig 3.0

The circuit has two 120-W terminating resistors connected in parallel, at or just beyond the final node at each end of the link. One end of the link also has two 560-W biasing resistors.The terminations reduce voltage reflections that can cause the receiver to misread logic levels.The receiver sees reflected voltages as output switches, and the line settles from its initial current to its final current. The termination eliminates reflections by making the initial and final currents equal. The initial current is a function of the line’s characteristic impedance, which is the input impedance of an infinite open line. The value varies with the wires’ diameters, the spacing between them, and the insulation type. For digital signals (which consist mainly of frequencies greater than 100 kHz), the characteristic impedance is mostly resistive; the inductive and capacitive components are small.A typical value for 24-AWG twisted pair is 120 W. The final current is a function of the line termination; the receiver’s input impedance, and the line’s seriesimpedance. In a typical RS-485 line without a termination, the initial current is greater than the final current because the characteristic impedance is less than the receiver’s combined input impedance. On a line without a termination, the first reflection occurs when the initial current reaches the receiver. The receiver’s input can absorb only a fraction of the current. The rest

Electronics & Telecommunication Department Page 34

Page 35: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

reflects back to the driver. As the current reverses direction, its magnetic field collapses and induces a voltage on the line. As a result, the receiver initially sees a greater voltage thanwhat was transmitted.When the reflected voltage reaches the driver, which has a lower impedance than the line, the driver absorbs some of the reflection and bounces the rest back to the receiver. This reflection is of opposite polarity to the first reflection and causes the receiverto see a reduced voltage. The reflections bounce back and forth like this for a few rounds before they die out and the line settles to its final current. If the line terminates with a resistor equal to the line’s characteristic impedance, there are no reflections. When the initial current reaches the termi- nation, it sees exactly what it was expecting—a load equal to the line’s characteristic impedance. The entire transmitted voltage drops across the load. In a network with two parallelterminations, the drivers drive two lines with each ending at a termination.The biasing resistors hold the line in a known state when no drivers are enabled. Most RS-485 transceivers have internal biasing circuits, but adding a termination defeats their ability to bias the line. A typical internal circuit is a 100-kW pullup from line A to V+, and a 100-kW pulldown from lineB to ground.

With no termination and when no drivers are enabled, the biasing resistors hold line A more positive than line B. When you add two 120-W terminations, the difference between A and B shrinks to a few millivolts, much less than the required 200 mV. The solution is to add smaller resistors in parallel with the internal biasing so that a greater proportion of the series voltage drops across the termination.The size of the biasing resistors is a tradeoff. For a greater voltage difference and higher noise immunity on an idle line, use smaller values. For lower power consumption and a greater differential voltage on a driven line, use larger values.

When the receiver is disabled, the receiver’s output is high impedance. If the output doesn’t connect to a input with an internal pullup, adding a pullup here ensures that the node doesn’tsee false start bits when its receiver is disabled. To comply with the specification, all of the nodes must share a common ground connection. This ground may be isolated from earth ground.The ground wire provides a path for the current those results from small imbalances in the balanced line. If the A and B outputs balance exactly with equal, opposite currents, the two currents in the ground wire cancel each other out and the wire carries no current at all. In real life, components don’t balance perfectly; one driver will be a little stronger and one receiverwill have a slightly larger input impedance. Without a common ground, the circuit may work, but the energy from the imbalance has to go somewhere and may dissipate as electromagnetic radiation.

The RS-485 specification recommends connecting a 100-W resistor of at least 0.5 W in series between each node’s signal ground and the network’s ground wire, as Figure 3.0 shows. Thisway, if the ground potentials of two nodes vary, the resistors limit the current in the ground wire.

Electronics & Telecommunication Department Page 35

Page 36: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

CIRCUIT DIAGRAM

Electronics & Telecommunication Department Page 36

Page 37: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Circuit Diagram of Master:-

Electronics & Telecommunication Department Page 37

Page 38: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Circuit Diagram of Slave:-

Electronics & Telecommunication Department Page 38

Page 39: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Artwork/PCB Layout of Master:-

Electronics & Telecommunication Department Page 39

Page 40: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Artwork/PCB Layout of Slave:-

Electronics & Telecommunication Department Page 40

Page 41: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Working:-

Slave side –

Each slave consists of a microcontroller based system which is connected to the master side with the help of RS485 link. Microcontroller 16F877A is used. After power on microcontroller first initialises various port pins as input or output. For this it uses tris registers. Each port has a tris register. This register is of one byte length. If the pin is to be used as input the corresponding bit must be set to “1” and if the pin is to be used as output it must be set to “0”. All tris registers are in bank1. Now microcontroller initialises LCD, then serial port for 9600 baud rate, then ADC registers. At present microcontroller programs port ‘A’ as all analog inputs. Port ‘B’ as output, port ‘C’ and ‘D’ as combination of input and output. Next microcontroller displays welcome message on LCD.Then it reads the temperature sensor value which is connected to analog channel 1 of port ‘A’. Then it stores this value in ram. Then it converts this value in BCD and then converts this value in ASCII and displays on LCD. The heart rate sensor is connected to timer/counter 0. Micrcontroller counts the number of pulses in one second and stores it in ram and displays on LCD. Then microcontroller reads the blood level and saline levels, stores it in ram and displays on LCD. Now the microcrcontroller sends this data through RS485 link to the master. It then issues a special hex code to the next slave in the ring. Upon receiving the code from the previous slave, the successor slave reads the data from the sensors and sends this data to the master similarly as the preceding slave. It then issues a special hex code to the next slave to indicate that now it is his turn to send the data to the master. Thus all the slaves form a loop and continue sending data to the master. All slaves continue this procedure.

Master side–

The microcontroller masterside after power on intialises port pins for input or output using tris register similar to slave microcontrollers. Then it intialises serial communication for 9600 baud rate. It goes into the receiving mode and it receives full data from slave1, now it sends the received data to PC using RS 232 level converter.

On Screen Display:-

Visual basic software is used to display data received from serial port. This software displays the data from all patients on the Screen. Then master microcontroller repeats this procedure for all other slaves.

Electronics & Telecommunication Department Page 41

Page 42: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

FLOWCHART

Electronics & Telecommunication Department Page 42

Page 43: Networking Based Patient Monitoring System Project Report

Networking Based Patient Monitoring System

Electronics & Telecommunication Department Page 43

Start

Initialise master, slave and PC

Slave no.1 will accept input from the sensors and send it to master.