Sei sulla pagina 1di 68


Chapter name
Chapter- 1 1.1 Introduction 1.2 Block diagram 1.3 Block diagram description 1.4 Circuit diagram Chapter -2 2.1 IC tempreture sensor 2.1.1 Features 2.1.2 LM35 layout 2.2 pulse sensor 2.2.1 piezo electric crystal 2.3 power supply 2.3.1 Rectifier 2.3.2 Monolithic IC voltage regulator 2.4 ADC module 2.4.1 Applications 2.4.2 ADC 0809 2.4.3 Features 2.4.4 Key specifications 2.4.5 Functional description 2.5 AT 89C51 microcontroller 2.5.1 Features 2.5.2 Memory organization 2.5.3 Pin diagram description 2.6 IC 555 timer 2.6.1 Pin function-8 pin package

Page no

2.6.2 IC 555 timer Astable operation 2.7 RS 232 serial communication 2.7.1 PC interface section 2.7.2 Mode of operation 2.7.3 Specification 2.7.4 Advantages 2.7.5 Disadvantages 2.7.6 MAX-232 2.8 LM 358 2.8.1 pin diagram 2.8.2 Unique characteristics 2.8.3 Advantages 2.8.4 Features 2.9 LM 324 2.9.1 pin diagram 2.9.2 Unique characteristics 2.9.3 Advantages 2.9.4 Features Chapter-3 3.1 Experimental investigation 3.1.1 Microcontroller test 3.1.2 Power supply test 3.1.3 LM 358 test 3.1.4 Breath sensor test 3.1.5 PCB test 3.2 Experimental analysis 3.2.1 Microcontroller test 3.2.2 Power supply test 3.2.3 LM358 test 3.2.4 Components test Chapter-4

4.1 Flow chart of C program 4.2 Flow chart for microcontroller code 4.3 Project source code Chapter-5 Conclusion Chapter-6 Future scope Chapter-7 Bibliography

1. FIG 1.2(a): Block Diagram 2. FIG 1.4 Circuit Diagram 3. FIG 2.1.2 IC LM35 4. FIG 2.2.1: Piezo Electric Crystal 5. FIG2.3 Power supply 6. FIG 2.4 Three-bit Binary Representation 7. FIG 2.4.5(A) Functional Block Diagram of ADC 8. FIG 2.4.5 (B): Pin Diagram of ADC 9. FIG 2.4.5(C): Connection Diagram 10. FIG 2.4.5(D): Channel Selection 11. FIG 2.5.2(a): Program Memory 12. FIG 2.5.2(b): Data Memory 13. FIG 2.6.2(a): 555 Timer in Astable Operation 14. FIG 2.6.2(b): Modified Duty Cycle in Astable Mode 15. FIG 2.7.1: RS-232 Connector Diagram 16. FIG 2.8.1 Pin diagram of RS-232 17. FIG 2.9.1 Pin diagram of LM 324

18. FIG 4.1: Flow Chart of C Program 19. FIG 4.2: Flow Chart for microcontroller code

Humans are noted for their desire to understand and influence the world around them seeking to explain and manipulate natural phenomena through their technology.As technology progresses, the line between hardware and software has begun to waver with the invention of many different embedded systems. The advantages of embedded systems are many, primarily creating added efficiencies where applications are run from within the actual circuitry. Embedded systems technology is optimized based on the underlying circuit design and hardware. Embedded systems are programmed to automate certain tasks. Cell phones, computers, copiers, medical equipment,programmable logic controllers, and numerous other products rely on embedded systems. Real time embedded systems can be used to replace traditional software applications. Embedded system design, development and programming take some highly technical work from team of engineers.The microcontroller is a true computer on a chip. The design incorporates all of the features in a microprocessor CPU: ALU, PC, SP and registers. It also has added the other features needed to make a complete computer: ROM, RAM, parallel I/O, serial I/O,counters and a clock circuit. A microcontroller is also a general purpose device. The prime use of a microcontroller is to control the operation of a machine using a fixed program that is stored in ROM and that does not change over the lifetime of the system.

The microcontroller design uses a much more limited set of single and double byte instructions that are used to move code and data from internal memory to the ALU.Many instructions are coupled with pins on the integrated circuit package the pins are programmable that is, capable of having several different functions depending on the wishes of the programmer.The microcontroller is concerned with getting data from and to its own pins the architecture and instruction set are optimized to handle data in bits and byte size. Now coming to the project, PATIENT MONITORING SYSTEM is an embedded system used for measuring the temperature, pulse & breathe count .We are using 89c51 Microcontroller .We are using LM35 for measuring the temperature, piezo electric

crystal for measuring the pulse and slot sensor for measuring the breathe count .The temperature value, pulse value is read by the microcontroller through the ADC 0809 which is interfaced to it. The breathe count is shown in the form high and low pulses which is plotted in the PC simultaneously with the temperature and the pulse.The measured value is displayed on the PC which is interfaced to the Microcontroller through the RF Transmitter and the RF Receiver. So, all the three parameters are displayed simultaneously. If the temperature range, pulse range and the breathe count are above the abnormality range, then message will be sent to the pre-setted mobile number. Here we are using MAX 232 for communication between microcontroller and PC.

CHAPTER 2 2.1 Block diagram


Power Supply

ADC Micro Controller

RS 232





Figure 2.1 Block Diagram of AT89C51

1.2 Block diagram description

The block diagram consists of Temperature sensing circuit Pulse measurement circuit Breathe Measuring circuit Micro Controller A to D converter Power supply 555 Timer Rs-232 communication link PC

Temperature sensing circuit

The temperature sensing circuit consist of a LM35 Temperature Sensor, this is placed where the temperature needed to be measured. The output of LM35 is given to LM358 (amplifier) circuit to amplify its voltagelevel and is given to the ADC0809.

Pulse measurement circuit

Breatthe measurement circuit Micro controller

the micro controller we are using is AT89C51 it helps in transferring the data and displaying it into the LCD & PC. It acts as the communicator in between the main circuit and components used externally.

The analog data should be converted into the digital form because Micro controller can understand only digital data and the ADC block does it.

Power supply
The Power supply circuit consists of a rectifier, a filter and a voltage regulator. The output of the transformer is 12V, but we need 5V so the voltage should be converted into 5V and this circuit does it.

555 Timer
The 555 timers is one of the most remarkable integrated circuits ever developed. It comes in a single or dual package and even low power CMOS versions exist ICM7555. Common part numbers are LM555, NE555, LM556, NE556. The 555 timer consists of two voltage comparators, a bi-stable flip flop, a discharge transistor, and a resistor divider network. In our project we are 555- Timer in astable mode.

RS-232 Communication link

Most successful serial data standard for PC and telecom applications. It was originally adapted by the Electronic IndustriesAassociation (EIA) in 1960 to interface between Data terminal equipment and Data communication equipment employing serial binary data interchange. Data terminal equipment is the terminal and Data communication equipment is the modem or the communication device. But now it enables a variety of peripherals to communicate with PCs. To ensure fast and reliable data transmission between two devices, the data transfer must be coordinated So, we are using 9 pins in RS232 instead of 25 pins.


The receiving module is connected to the PC using the DB9 connector (female).

3.1 IC Temperature sensor(LM35)
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of 14C at room temperature and 34C over a full 55 to +150C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35s low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 A from its supply, it has very low self-heating, less than 0.1C in still air. The LM35 is +110C range (10 with improved accuracy). The LM35 series is available packaged in hermetic TO-46 transistor packages, while theLM35C, LM35CA, and LM35D are also available in the plastic TO-92 transistor package. The LM35D is also available in an 8-lead surface mount small outline package and a plastic TO-220 package. 3.1.1 LM35 LAYOUT rated to operate over a 55 to +150C temperature range, while the LM35C is rated for a 40 to

Figure 3.1.1 LM35 layout It has the following features: 1. Calibrated directly in Celsius (Centigrade) 2. Linear + 10.0 mV/C scale factor 3. 0.5C accuracy guarantee able (at +25C) 4. Rated for full 55 to +150C range 5. Suitable for remote applications 6. Low cost due to wafer-level trimming 7. Operates from 4 to 30 volts 8. Less than 60 A current drain 9. Low self-heating, 0.08C in still air 10. Nonlinearity only 14C typical 11. Low impedance output, 0.1 W for 1 mA load

3.2 Pulse sensor

Pulse oximetry is a particularly convenient noninvasive measurement method. Typically it utilizes a pair of small light-emitting diodes (LEDs) facing a photodiode through a translucent part of the patient's body, usually a fingertip or an earlobe. One LED is red, with wavelength of 660 nm, and the other is infrared, 905, 910, or 940 nm. Absorption at these wavelengths differs significantly between oxyhemoglobin and its deoxygenated form; therefore, the oxy/deoxyhemoglobin ratio can be calculated from the ratio of the absorption of the red and infrared light. The absorbance of oxyhemoglobin and deoxyhemoglobin is the same (isosbestic point) for the wavelengths of 590 and

805 nm; earlier equipment used these wavelengths for correction of hemoglobin concentration.[10] The monitored signal bounces in time with the heart beat because the arterial blood vessels expand and contract with each heartbeat. By examining only the varying part of the absorption spectrum (essentially, subtracting minimum absorption from peak absorption), a monitor can ignore other tissues or nail polish, (though black nail polish tends to distort readings)[11] and discern only the absorption caused by arterial blood. Thus, detecting a pulse is essential to the operation of a pulse oximeter and it will not function if there is none. Pulse oximetry is a non-invasive method allowing the monitoring of the oxygenation of a patient's hemoglobin. A sensor is placed on a thin part of the patient's body, usually a fingertip or earlobe, or in the case of an infant, across a foot. Light of two different wavelengths is passed through the patient to a photodetector. The changing absorbance at each of the wavelengths is measured, allowing determination of the absorbances due to the pulsing arterial blood alone, excluding venous blood, skin, bone, muscle, fat, and (in most cases) fingernail polish.[1] With NIRS it is possible to measure both oxygenated and deoxygenated hemoglobin on a periperhal scale (possible on both brain and muscle). Reflectance pulse oximetry may be used as an alternative to transmissive pulse oximetery described above. This method does not require a thin section of the patient's body and is therefore well suited to more universal application such as the feet, forehead and chest.

Figure 3.2 pulse sensors

3.3 Breathe measuring

U-shaped Photo Sensors

This device has a compact construction where the emitting-light sources and the detectors are located faceto-face on the same optical axis. The detector consists of a phototransistor Transmitter is positioned opposite the receiver used for small distances and narrow objects.

Optoelectronic transmitters and receivers are used in pairs and linked optically Emitting light is influenced by an object on its way to the detector Known as transmissive sensors or interrupters or slotted switch or optical switch or reflective sensors Change of the light signal causes a change in the electrical signal in the receiver

3.2.1 Working of photo sensor

The basic elements of an optical transmissive sensor also known as Photo interrupter are an emitter and a photo detector. Typically an IRED (Infrared emitting diode) and a phototransistor is used. Figure 7 shows a typical circuit. The anode of IRED is connected to the power supply via the resistor 680R and the cathode is grounded. The resistor adjusts the irradiance by limiting the forward current of the IRED.

The collector of the phototransistor acts as an output pin, connected to microcontroller pins. If an object is moving between the gap the light will be blocked and the transistor base will on, hence give an high output. TAGs:-

U-SHAPED OPTO SENSOR,optocoupler u shaped, sensor u-shaped, sensor for motion detection, optocoupler for motion detection, motion control sensor, motion sensor, interface of microcontroller with motion control sensor, sensor output through optocoupler, digital output of sensor, motion sensor circuit,interfacing switch microcontroller,interfacing camera microcontroller,interfacing sensor with 8051microcontroller,sensor interface with 8051,Sensor Interface with 8051 in C,Analog to Digital Converter (ADC) to interface the 8051,8051,ULN2803 and Relay,Driving TIP122 using Optocoupler pc817 driven by 8051,8051 microcontroller hardware interfacing tutorials,sensors interfacing temerature,optical transmissive sensor,microcontrollers 8051 and motion sensor,U type optocoupler sensor interface with microcontroller, data acquisition and control using microcontroller 8051 with sensor and optocouplers

Like diodes, all transistors are light-sensitive. Phototransistors are designed specifically to take advantage of this fact. The most-common variant is an NPN bipolar transistor with an exposed base region. Here, light striking the base replaces what would ordinarily be voltage applied to the base -- so, a phototransistor amplifies variations in the light striking it. Note that phototransistors may or may not have a base lead (if they do, the base lead allows you to bias the phototransistor's light response. For phototransistor selection and comparison information, see the phototransistor section of the BEAM Reference Library 's BEAM Pieces collection. Note that photodiodes also can provide a similar function, although with much lower gain (i.e., photodiodes allow much less current to flow than do phototransistors). You can use this diagram to help you see the difference (both circuits are equivalent):

For an illuminating comparison of the various photo-sensitive devices, make sure to check out "Choosing the Detector for your Unique Light Sensing Application. "

3.4 Microcontroller
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM) Microcontrollers have been used extensively for space and defense application in the last twenty-five years or so. Responding to the needs of designers, manufactures have introduced a range of

microcontrollers of different architectures and features to address the needs of different application.Traditionally microcontrollers come with on-chip EPROM with facility to address external program and data .However reproducing requires that device be removed from the printed circuit board, exposed to UV source for about twenty minutes, and reprogrammed.The advent of Flash Memory technology has introduced features .The micro controller used in the File Data Transfer Unit implements the advanced technology with 4K bytes of Reprogrammable Flash Memory and three level program memory lock Bits and overcome the security problems. It has the following features: 1. 4K Bytes of In-System Reprogramming Flash Memory 2. Endurance: 1,000 Write /erase cycles 3. Fully Static operation 4. Three level program Memory Lock 5. 128 X 8 bit internal RAM 6. 32 Programmable I/O lines 7. Two 16-bit Timers /Counters 8. Six interrupt sources 9. Programmable serial channel 10. Low power Idle and Power down Modes

Figure 3.4(a) ATMEL 89C51

Figure 3.4(b) architecture of the AT89C51 Microcontroller

3.4.1 Memory orgasnization The 89C51 Microcontroller has separate address spaces for program Memory and Data Memory .The Program Memory can be up to 64K bytes long .The lower address may reside on chip .64K bytes data memory external to the chip can be directly accessed .It has 128 bytes of on-hip RAM and a number of SFRS.The lower 128 bytes of RAM can be accessed either directly or indirectly .Memory mapping of program and data Memory is as shown below.


Figure 3.4.1(a) Program memory

SFRS direct add Only Direct&Indirect addressing

64K Bytes External

Figure 3.4.2(b) Data memory

The 128 bytes of RAM are divided into 3 A) B) C) Register banks 0-3 (00-IFH) Bit addressable area (20H-2Fh) Scratch Pad area (30H-7Fh)

If the Sp is initialized to this area, enough bytes should be left aside to prevent Sp data destruction.

Program Lock Bits Mode LB1 LB2 LB3

Protection Type

No program Lock feature MOVC instruction executed from external program memory are disabled from






memory .EA is sampled and latched on reset ,and future programming

Same as mode 2, also verify is disabled verify and External execution disabled.

3.5.2 pin diagram description

A &B Registers
They are used during math and logical Operations .The register A is used for all data transfers between the microcontroller and memory .The B register is used during multiplication and division operations. For other instructions, it can be treated as another scratch pad register.

It contains math flags, user flag F0 and register select bits RS1 and RS0 to determine the Working registers bank.

Stack pointer
Stack is used to hold and retrieve data quickly. The 8-bit SP is incremented before data is stored during PUSH and executions .While stack may reside anywhere in on-clip RAM, the SP is initialized 07H after a reset causing the stack to begin at location 08H.

It is used to hold memory addresses for internal and external code access, external data access .It consists of high byte (DPH), and a low byte (DPL).It may be manipulated as a 16-bit register or as two independent 8-bit registers.

It addresses the memory location that program instructions are to be fetched.It is the other register that does not have any internal address.

That is 1-bit register provided to store results of certain program instructions.Other instructions can test the condition of the flags and make the decisions accordingly To be conveniently addresses, they are grouped inside the PSW and PCON.

The microcontroller has 4 math flags: carry, auxiliary carry (AC), overflow (OV), parity (P) and 3 general purpose flags: F0, GF0 and GF1.

All ports are bi-directional; each consists of a latch, an output driver and an input buffer .P0, P1, P2, and P3 are SFR latches of port 0, 1, 2 and 3 respectively. The main functions of each port are mentioned below: Port 0: Input/Output bus port, address output port and data input/output port.

Port1: Quasi-bidirectional input/output port Port2: Quasi-bidirectional input/output port and address output port Port3: Quasi-bidirectional input/output port and control input/output pin. SBUF The microcontroller has serial data transmission circuit that uses SBUF register to hold data.It is actually two separate registers, a transmit buffer and a receive buffer register. When data is moved to SBUF ,it goes to transmit buffer, where it is held for serial transmission and when it is moved from SBUF, it comes from the receive buffer.

Timer registers
Register pairs (TH0, TL0), (TH1, TL1) are the 16 bit counter registers for timers/counters 0 and 1.

Control registers
SFRS, IP, IE, TMOD, SCON and PCON contain control and status bits for the Interrupt system, Timers/Counters and serial port.

Oscillator circuit
This circuit generates the clock pulses by which all internal operations are synchronized .For the microcontroller to yield standard baud rates, the crystal frequency is chosen as 11.0592 MHZ.

The Reset switch is the RST pin of the micro controller, which is the input to a Schmitt trigger. It is accomplished by holding the RST high for at least two machine cycles while the oscillator frequency is running .The CPU responds by generating an internal reset.

Accessing external memory

Access to external memory is either to program or to data memory. Access to external program memory use the PSEN (Program Store Enable) signal as the read strobe. Accesses to external data memory use RD or WR (alterable functions of P3.7 and P3.6) to strobe the memory.

External program memory is accessed when the EA signals are active or when the PC contains a number larger than 0FFH to the port 0 latch thus oblitering any information in the port 0 SFR. If the user writes to port 0 during an external memory fetch, the incoming code byte is corrupted. Therefore user should not write to port 0 if external program memory is used. When the CPU is executing out of external program memory, all 8 bits of port 2 are dedicated to an O/P function and may not be used for general purpose I/O.

Timers /counters
Micro-controller has 2 16-bit Timer/counter register T0 & T1 configured to operate either as timers or event counters. There are no restrictions on the Duty cycle of the external input signal, but it should be held for at least one full machine cycle to ensure that a given level is sampled at least once before it changes. Timers 0 & 1 have four operating modes :13-bit timer mode ,16-bit timer mode, 8-bit auto reloaded mode and split timer mode .Control bits C/T in TMOD SFR select the timer or counter function.

Mode 0
Both timers in MODE 0 and 8-bit counters with a divide by-32 pre-scalar .The timers registers is configured as a 13-bit register with all 8 bits of TH 1 and the lower 5-bits of TL1.The upper 3 bits of TL 1 are indeterminate and should be ignored .Setting the run flag(TR1) does not clear the registers .

Mode 1
Mode 1 is same as mode 0, except that the timer register is run with all 16-bits.The clock is applied to the combined high and low timer registers. As clock pulses are received, the timer counts. An overflow flag .The timer continues to count.

Mode 2
This mode configures the timer register as an 8-bit counter (TL1/0) with automatic reload.Overflow from TL 1/0 not only sets TF 1/0, but also reloads TL 1/0 with the contents of TH 1/0, which is present by software. The reload leaves TH 1/0 unchanged.

Mode 3
Mode 3 is used for applications that require an extra 8-bit timer or counter. Timer 1 in mode 3 simply holds its count .The effect is same as setting TR1=0. Timer 0 in mode 3 establishes TLO and THO as two separate counters. TLO uses the timer 0 control bits CT, GATE, TRO, INTO and TFOTHO is locked into the timer function and over the use of TR 1 AND TF 1 from timer 1.Thus THO controls the timer 1 interrupts.

The microcontroller provide 5 interrupt sources: 2 external interrupts, 2 timer interrupts and a serial port interrupts. The external interrupts (INTO & INT1) can each be either level activated or transition activated, depending on bits IT0 and IT1 in register TCON .The flags that actually generate these interrupts are IE0 & IE1 bits in TCON. TE0 and TF1 generate the timer 0 & 1 interrupts, which are set by a roll over in their respective timers/counter registers; When a timer interrupt is generated, the on-chip hard ware clears the flag that generated it when the service routine is vectored to .The serial port interrupt is generated by the logical OR of R1 & T1.Neither of these flags is cleared by hardware when service routine is vectored to. In fact, the service routine itself determines whether R1 or T1 generated the interrupts, and the bit is cleared in the software.

Serial interface
The serial port is duplex, i.e., it can transmit and receive simultaneously. It is also receive buffered which implies it can begin receiving s second byte before a previously received byte has been read from the receiver register .The serial port receive and transmit registers are both accessed at SBUF SFR .Writing to SBUF loads the transmit register and SBUF accessed at SBUF SFR .Writing to SBUF loads the transmit register and SBUF accesses a physically separate receive registers. The serial interface has four modes of operation:

Mode 0

In this mode of operation the serial data enters and exits through RXD.TXD outputs the shift clock .Eight data bits are transmitted/received ,with the LSB first. The baud rate is fixed at 1/12 of the oscillator frequency .Reception is initialized by the condition R1=0 and REN=1.

Mode 1
In this mode 10 bits (a start bit 0, 8 data bits (LSB), a programmed 9th data bit and a stop bit) are transmitted through TXD, or received through RXD. At receiving end stop bits goes into RB8 in SFR SCON. The baud rate is variable.

Mode 2
In the mode, 16 bits (a start bit 0, 8 data bits (LSB), a programmed 9th data bit and a stop bit) are transmitted through TXD, or received through RXD. The baud rate is programmable to either 1/32 or 1/64 of the oscillator frequency.

Mode 3
The function of mode is same as mode 2 except that the baud rate is variable .Reception is initialized by the incoming start bit if REN=1. Baud rate calculation of different modes 1. Baud rate in mode 0 is fixed Mode 0 baud rate = oscillator freq.12 (1/1 machine cycle = 12 Clock Cycles) 2. The baud rate in mode 2 depends on the value of SMOD bit in PCON register. SMOD=0, baud rate = (1/64) X Oscill. freq SMOD=1, baud rate = (1/32) X Oscill. freq i.e., mode 2 baud rate = [(2(POW) SMOD)/64 X timer 1 Overflow rate. 3. In modes 1 & 3, timer 1 overflow rate and the value of SMOD determines the baud rates. Baud rates of mode 1 & 3 = [(2(POW) SMOD)/64 X timer 1 Overflow rate. The timer 1 interrupt should be disabled in this application.

3.5 ADC ADC is short for Analog Digital Converter, Sometimes called a A-D or A to D Converter. An ADC is a device that converts a continuous analog signal to a multi-level digital signal without altering its content. The signals that are monitored are sounds, movement, and temperature into binary code for the PC.

Figure 3.5 pin diagram of ADC

Analog digital (A/D, ADC) converters are electrical circuit devices that convert continuous signals, such as voltages or currents, from the analog domain to the digital domain where the signals are represented by numbers Most processing equipment today are digital in nature, and they work with signals which are binary valued. In a digital or binary representation, a signal is represented by a word, which is composed of a finite number of bits. The processing of signals is preferably carried out in the digital domain because digital processing is fast, accurate and reliable. Analog to digital converters are widely used for converting analog signals to corresponding digital signals for many electronic circuits. Analog to digital converters allow the use of sophisticated digital signal processing systems to process analog signals, which are common in the real world. Many modern electronic systems require conversion of signals from analog to digital or from digital to analog form. Circuits for performing these functions are now required in numerous common consumer devices such as digital cameras, cellular telephones, wireless data network equipment, audio devices such as MP3 players, and video equipment such as digital video disk (DVD) players, high definition digital television (HDTV), and numerous other products. Analog to digital converters (ADC's) form an essential link in the signal processing pathway at the interface between the analog and digital domains. Advances in ADC technology have increased the speed, lowered the cost, and reduced the power requirements of analog to digital converters, and resulted in a proliferation of ADC applications. Conversion involves quantizing and encoding. Quantizing means partitioning the analog signal range into a number of discrete quanta and determining to which quantum the input signal belongs. Encoding means assigning a unique digital code to each quantum and determining the code that corresponds to the input signal. The most common system is binary, in which there are 2n quanta (where n is some whole number), numbered consecutively; the code is a set of n physical two-valued levels or bits (1 or 0) corresponding to the binary number associated with the signal quantum.

The illustration shows a typical three-bit binary representation of a range of input signals, partitioned into eight quanta. For example, a signal in the vicinity of 3/8; full scale (between 5/16 and 7/16) will be coded 011 (binary 3).

Figure 3.5 A three-bit binary representation of a range of input signals. There are four commonly used ADCs: Parallel converter Successive approximation ADC Voltage-to-Frequency ADC Integrating ADC

This is 8-Bit P Compatible A/D Converters with 8-Channel Multiplexer. The ADC0809 data acquisition component is a monolithic CMOS device with an 8-bit analog-to-digital converter,8-channel multiplexer and microprocessor compatible Control logic. The 8-bit A/D converter uses successive approximation as the conversion technique. The converter features a high impedance chopper stabilized comparator, a 256R voltage divider with analog switch tree and a successive approximation register. The 8-channel multiplexer can directly access any of 8-single-ended analog signals. The device eliminates the need for external zero and full-scale adjustments. Easy interfacing to microprocessors is provided by the latched and decoded multiplexer address inputs and latched TTL TRI-STATE outputs.

3.5.1 Functional description

The ADC0809 shown in figure can be functionally divided into 2 basic sub circuits. These two sub circuits are an analog multiplexer and an A/D converter. The multiplexer uses 8 standard CMOS analog switches to provide to up to 8 analog inputs. The switches are selectively turned on, depending on the data latched into a 3-bit multiplexer address register.The second functional block, the successive approximation A/D converter, transforms the analog output of the multiplexer to an 8-bit digital word. The output of the multiplexer goes to one of two comparator inputs. The other input is derived from a 256R resistor ladder, which is tapped by a MOSFET transistor switch tree. The converter control logic controls the switch tree, funneling a particular tap voltage to comparator. Based on the result of this comparison, the control logic and the successive approximation register (SAR) will decide whether the next tap to be selected should be higher or lower than the present tap on the resistor ladder. This algorithm is executed 8 times per conversion, once every 8-clock period, yielding a total conversion time of clock periods. When the conversion cycle is complete the resulting data is loaded into the TRISTATE output latch. The data in the output latch can be then be read by the host system any time before the end of the next conversion. The TRI-STATE capability of the latch allows easy interfaces to bus oriented systems. The operation on these converters by a microprocessor or some control logic is very simple. The controlling device first selects the desired input channel. To do this, a 3-bit channel address is placed on the A, B, C in and out pins; and the ALE input is pulsed positively, clocking the address into the multiplexer address register. To begin the conversion, the START pin is pulsed. On the rising edge of this pulse the internal registers are cleared and on the falling edge the start conversion is initiated. As mentioned earlier, there are 8 clock periods per approximation. Even though there is no conversion in progress the ADC0809 is still internally cycling through these 8 clock periods. A start pulse can occur any time during this cycle but the conversion will not actually begin until the converter internally cycles to the beginning of the next 8 clock period sequence. As long as the start pin is held high no conversion begins, but when the start pin is taken low the conversion will start within 8 clock periods. The EOC output is

triggered on the rising edge of the start pulse. It, too, is controlled by the 8 clock period cycle, so it will go low within 8 clock periods of the rising edge of the start pulse. One can see that it is entirely possible for EOC to go low before the conversion starts internally, but this is not important, since the positive transition of EOC, which occurs at the end of a conversion, is what the control logic is looking for. Once EOC does go high this signals the interface logic that the data resulting from the conversion is ready to be read. The output enable(OE) is then raised high. This enables the TRI-STATE outputs, allowing the data to be read. Figure shows the timing diagram.

Figure 3.5.1 Functional block diagram of ADC

SC (Chip Selection)
By using this selection Bit you can select the Chip. After selecting this bit the chip is ready to do operation. By using HIGH(1) you can select the this pin as a active high.

ALE (Address Latch Enable)

ALE is to enable address latch of ADC, so that the selected channel is activated. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency, and can be used for external timing or clocking. Note that one ALE pulse is skipped during each access to external data memory. This pin is also the Program Pulse input (PROG) during Flash programming.

EOC (End of Conversion)

After End of ADC Conversion EOC bit is set to high.

Table 3.5.1 Channel selection

21 22 23 24 8 7 6 5 4 20 3


Figure 3.5.2 connections of ADC It has the following features: Easy interface to all microprocessors Operates ratio metrically or with 5 VDC or analog span adjusted voltage reference No zero or full-scale adjust required

8-channel multiplexer with address logic 0V to 5V input range with single 5V power supply Outputs meet TTL voltage level specifications ADC0809 equivalent to MM74C949-1 ADC0808 equivalent to MM74C949

It has the following specifications Resolution 8 Bits Total Unadjusted Error 12 LSB and 1 LSB Single Supply 5 VDC Low Power 15 mW Conversion Time

It has the following applications of ADC: Digital camera or scanner uses A/D converters to transform the variable charges in CCD and CMOS chips into the binary data that represent pixels. Cell phone and digital desk phone has an ADC converter that converts the pressure of sound waves into PCM code Etc.

3.6 Power supply

Power supply unit provides 5V regulates power supply to the systems. It consists of two parts namely, 1. Rectifier 2. Voltage regulator

Figure 3.6(a) Circuit diagram of power supply

There are two types of standard transistors, NPN and PNP, with different circuit symbols. The letters refer to the layers of semiconductor material used to make the transistor. Most transistors used today are NPN because this is the easiest type to make from silicon. If you are new to electronics it is best to start by learning how to use NPN transistors.The leads are labelled base (B), collector (C) and emitter (E).These terms refer to the internal operation of a transistor but they are not much help in understanding how a transistor is used, so just treat them as labels.

3.6(b) Transistor circuit symbols


NPN is one of the two types of bipolar transistors, in which the letters "N" and "P" refer to the majority charge carriers inside the different regions of the transistor. Most bipolar transistors used today are NPN, because electron mobility is higher than hole mobility in semiconductors, allowing greater currents and faster operation. NPN transistors consist of a layer of P-doped semiconductor (the "base") between two Ndoped layers. A small current entering the base in common-emitter mode is amplified in the collector output. In other terms, an NPN transistor is "on" when its base is pulled high relative to the emitter.The arrow in the NPN transistor symbol is on the emitter leg and points in the direction of the conventional current flow when the device is in forward active mode.

The other type of BJT is the PNP with the letters "P" and "N" referring to the majority charge carriers inside the different regions of the transistor.PNP transistors consist of a layer of N-doped semiconductor between two layers of P-doped material. A small current leaving the base in common-emitter mode is amplified in the collector output. In other terms, a PNP transistor is "on" when its base is pulled low relative to the emitter.The arrow in the PNP transistor symbol is on the emitter leg and points in the direction of the conventional current flow when the device is in forward active mode.

Figure 3.6(c) Operation of a transistor.

The essential usefulness of a transistor comes from its ability to use a small signal applied between one pair of its terminals to control a much larger signal at another pair of terminals. This property is called "gain". A transistor can control its output in proportion to the input signal; this is called an "amplifier".Or, the transistor can be used to turn current on or off in a circuit like an electrically controlled "switch", where the amount of current is determined by other circuit elements.The two types of transistors have slight differences in how they are used in a circuit. A bipolar transistor has terminals labelled base, collector and emitter. A small current at base terminal can control or switch a much larger current between collector and emitter terminals. For a field-effect transistor, the terminals are labelled gate, source, and drain, and a voltage at the gate can control a current between source and drain. The image to the right represents a typical bipolar transistor in a circuit. Charge will flow between emitter and collector terminals depending on the current in the base. Since internally the base and emitter connections behave like a semiconductor diode, a voltage drop develops between base and emitter while the base current exists. The size of this voltage depends on the material the transistor is made from, and is referred to as Vbe.

Capacitors store electric charge. They are used with resistors in timing circuits because it takes time for a capacitor to fill with charge. They are used to smooth varying DC supplies by acting as a reservoir of charge. They are also used in filter circuits because capacitors easily pass AC (changing) signals but they block DC (constant) signals.

This is a measure of a capacitor's ability to store charge. A large capacitance means that more charge can be stored. Capacitance is measured in farads, symbol F. However 1F is very large, so prefixes are used to show the smaller values. Three prefixes (multipliers) are used, (micro), n (nano) and p (pico):

means 10-6 (millionth), so 1000000F = 1F n means 10-9 (thousand-millionth), so 1000nF = 1F

p means 10-12 (million-millionth), so 1000pF = 1nF

Capacitor values can be very difficult to find because there are many types of capacitor with different labeling systems. There are many types of capacitor but they can be split into two groups, polarised and unpolarised. Each group has its own circuit symbol.

Polarised capacitors (large values, 1F +)

Figure3.6(d) Circuit symbol

Figure 3.6(e) Polarised capacitor Electrolytic capacitors are polarised and they must be connected the correct way round, at least one of their leads will be marked + or -. They are not damaged by heat when soldering.

Figure 3.6(f) Circuit symbol Small value capacitors are unpolarised and may be connected either way round. They are not damaged by heat when soldering, except for one unusual type (polystyrene). They have high voltage ratings of at least 50V, usually 250V or so. It can be difficult to find the values of these small capacitors because there are many types of them and several different labelling systems.

Figure 3.6(g) Unpolarised capacitors

A Resistor is a two-terminal electronic component designed to oppose an electric current by producing a voltage drop between its terminals in proportion to the current, that is, in accordance with Ohm's law: V = IR Resistors are used as part of electrical networks and electronic circuits. They are extremely commonplace in most electronic equipment. Practical resistors can be made of various compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel/chrome).The primary characteristics of resistors are their resistance and the power they can dissipate.

Figure 3.6(h) Resistors

The ohm (symbol: ) is a SI-driven unit of electrical resistance, named after Georg Simon Ohm. Commonly used multiples and submultiples in electrical and electronic usage are the milliohm, kilohm, and megohm.

Table3.6 Examples of resistors



0.47 ohms


4.7 ohms


470 ohms


4.7K ohms


47K ohms


47.3K ohms


470K ohms


4.7M ohms

Diodes Diodes allow electricity to flow in only one direction. The arrow of the circuit symbol shows the direction in which the current can flow. Diodes are the electrical version of a valve and early diodes were actually called valves.

Figure 3.6(i) Diodes

Figure 3.6(j) Circuit symbol Forward Voltage Drop Electricity uses up a little energy pushing its way through the diode, rather like a person pushing through a door with a spring. This means that there is a small voltage across a conducting diode, it is called the forward voltage drop and is about 0.7V for all normal diodes which are made from silicon. The forward voltage drop of a diode is almost constant whatever the current passing through the diode so they have a very steep characteristic (current-voltage graph). Reverse Voltage When a reverse voltage is applied a perfect diode does not conduct, but all real diodes leak a very tiny current of a few A or less. This can be ignored in most circuits because it will be very much smaller than the current flowing in the forward direction. However, all diodes have a maximum reverse voltage (usually 50V or more) and if this is exceeded the diode will fail and pass a large current in the reverse direction, this is called breakdown. Ordinary diodes can be split into two types: Signal diodes which pass small currents of 100mA or less and Rectifier diodes which can pass large currents. In addition there are LEDs (which have their own page) and Zener diodes (at the bottom of this page).

Connecting and soldering Diodes must be connected the correct way round, the diagram may be labelled a or + for anode and k or - for cathode. The cathode is marked by a line painted on the body. Diodes are labelled with their code in small print, you may need a magnifying glass to read this on small signal diodes. Small signal diodes can be damaged by heat when soldering, but the risk is small unless you are using a germanium diode in which case you should use a heat sink clipped to the lead between the joint and the diode body. A standard crocodile clip can be used as a heat sink. Rectifier diodes are quite robust and no special precautions are needed for soldering them.

3.6.2 Rectifier
Here the step down transformer 230-0v/12-0-12 is used which gives the secondary current up to 500mA, to the Rectifier. The Transformer secondary is provided with a center tap. Hence the voltage V1 and V2 are equal and has a phase difference of 1800. So if the anode of Diode D1 is positive with respect to the center tap, the anode of the other diode d2 will be negative with respect to the center tap. During the positive half cycleof the supply D1 conducts and current flows through the center tap D1 and load. During the negative half cycle of the supply voltage, the voltage on the diode D2 will be positive and hence D2 conducts. The current flows through the transformer winding, Diode D2 and load. It is to be noted that the current i1 and i2 are flowing in the same direction in load. The average of the two current i1 and i2 flows through the load producing a voltage drop, which is the D.C. output voltage of the rectifier. Using capacitor filters the ripple in the out waveform can be minimized. The voltage can be regulated by using monolithic IC voltage regulators.

3.6.3 IC voltage regulator

A voltage regulator is a circuit that supplies a constant voltage regardless of changes in load currents. Although voltage regulators can be designed using op-amps, it is quicker and easier to use IC voltage regulators. Furthermore, IC voltage regulators are versatile and relatively inexpensive and are available with features such as programmable output, current/voltage boosting, internal short-circuit current limiting, thermal shutdown and floating operation for high voltage applications Here we are using 7800 series voltage regulators. the 7800 series consists of 3-terminal +ve voltage regulators with seven voltage options. These ICs are designed as fixed voltage regulators and with adequate heat sinking can deliver output currents in excess of 1A. Although these devices do not require external components, such components can be used to obtain adjustable voltages and currents. For proper operation a common ground between input and output voltages is required. In addition, the difference between input and output voltages (Vi Vo) called drop out voltage, must be typically 1.5V even during the low point as the input ripple voltage. Further more, the capacitor Ci is required if the regulator is located an appreciable distance from a power supply filter. Even though Co is not needed, it may be used to improve the transient response of the regulator. Typical performance parameters for voltage regulators are line regulation, load regulation, temperature stability and ripple rejection. Line regulation is defined as the change in output voltage for a change in the input voltage and is usually expressed in milli volts or as a percentage of Vo. Temperature stability or average temperature coefficient of output voltage (TCVo) is the change in output voltage per unit change in temperature and is expressed in either milli volts/C or parts per million (PPM/C). ripple rejection is the measure of a regulators ability to reject ripple voltage. It is usually expressed in decibels. The smaller the values of line regulation, load regulation and temperature stability the better the regulation. Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable output voltages. The maximum current they can pass also rates them. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection'). Many of the fixed voltage regulators ICs have 3 leads and look

like power transistors, such as the 7805 +5V 1A regulator shown on the right. The LM7805 is simple to use. You simply connect the positive lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin and then when you turn on the power, you get a 5 volt supply from the output pin.

Figure 3.6.3 7805 Voltage Regulator The Bay Linear LM7805 is integrated linear positive regulator with three terminals. The LM7805 offer several fixed output voltages making them useful in wide range of applications. When used as a zener diode/resistor combination replacement, the LM7805 usually results in an effective output impedance improvement of two orders of magnitude, lower quiescent current. The LM7805 is available in the TO-252, TO-220 & TO-263packages It has the following features: Output Current of 1.5A Output Voltage Tolerance of 5% Internal thermal overload protection Internal Short-Circuit Limited Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24

3.7 IC555 Timer

IC555 Timer is a highly stable device for generating accurate time delays or oscillations. Additional terminals are provided for triggering and resetting applications,

if it is desired in the time delay mode of operation, the time is precisely controlled by one external resistor and capacitor. The following are the main features of timers: (a) Timing from microseconds through hours. (b) Operates in both Astable and Monostable modes. (c) Adjustable duty cycle. (d) Output can source or sink 200mA. (e) Output and supply TTL compatible. (f) Temperature stability is better then 0.005% per deg centigrade. (g) Normally ON and normally OFF output. The applications of the timer include the following: Precision timing. Pulse generation. Sequential timing. Time delay generation. Pulse width modulation. Linear ramp generation.

Since its debut the 555 timers has been used for number of novel and useful applications. These applications include monostable and astable multivibrators,dc-dc converters, temperature measurement and control, infrared transmitters , burglar and toxic gas alarms and voltage regulators. Here we are using 555 timer in astable mode for clock pulse generation, the duration of which is determined by the resistor and capacitor network connected across it.

3.7.1 Pin Functions

Ground (Pin 1) - Not surprising this pin is connected directly to ground. Trigger (Pin 2) - This pin is the input to the lower comparator and is used to set the latch, which in turn causes the output to go high.

Output (Pin 3) - Output high is about 1.7V less than supply. Output high is capable of source up to 200mA while output low is capable of sink up to 200mA. Reset (Pin 4) - This is used to reset the latch and return the output to a low state. The reset is an overriding function. When not used connect to V+. Control (Pin 5) - Allows access to the 2/3V+ voltage divider point when the 555 timer is used in voltage control mode. When not used connect to ground through a 0.01 uF capacitor. Threshold (Pin 6) - This is an input to the upper comparator. See data sheet for comprehensive explanation. Discharge (Pin 7) - This is the open collector to Q14 in figure 4 below. See data sheet for comprehensive explanation. V+ (Pin 8) - This connects to Vcc and the Philips databook states the ICM7555 cmos version operates 3V - 16V DC while the NE555 version is 3V - 16V DC. Note comments about effective supply filtering and bypassing this pin below under "General considerations with using a 555 timer"

3.7.2 IC 555 timer in Astable operation

When configured as an oscillator the 555 timer is configured as in figure 3.5 below. This is the free running mode and the trigger is tied to the threshold pin. At power-up, the capacitor is discharged, holding the trigger low. This triggers the timer, which establishes the capacitor charge path through Ra and Rb. When the capacitor reaches the threshold level of 2/3 Vcc, the output drops low and the discharge transistor turns on. The timing capacitor now discharges through Rb. When the capacitor voltage drops to 1/3 Vcc, the trigger comparator trips, automatically retriggering the timer, creating an oscillator whose frequency is determined by the formula in figure 3.7.2.

Figure 3.7.2(a): 555 Timer In Astable Operation There are difficulties with duty cycle here and I will deal with them below. It should also be noted that a minimum value of 3K should be used for Rb.This circuit is best used at Vcc = 15V.

3.8 RS-232(serial communication)

RS-232 is the most successful serial data standard for PC and telecom applications. It was originally adapted in 1960 by the Electronic Industries Association (EIA), to interface between Data Terminal Equipment and Data Communication Equipment (DCE) employing serial binary data interchange.

DTE is the terminal or computer and DCE is the modem or other communications device. But it now enables a variety of peripherals to communicate with PCs. It was defined as a signal ended standard for increasing serial communications distances at low baud rate up to 20 Kbps. over the years. The standard has changed as necessary to accommodate faster drivers like the MAX 232, which offers 115 Kbps data rate capability.

1 2 3 4 5

Figure 3.8(a) RS-232 Connecter diagram

Figure 3.8(b) RS-232 Serial interface The above shown connector known as 9-pin, D-type male connector is used for RS232 connections.

Figure 3.8(c) RS 232 circuit diagram

Table 3.8 Pin Diagram Description Pin number Common Name 1 2 3 4 5 6 7 8 9 /CD RXD TXD /DTR GND /DSR /RTS /CTS -RS232 name CF BB BA CD AB CC CA CB CE Received line signal detector Received data Transmitted data Data terminal ready Signal ground Data set ready Request to send Clear to send Ring indicator Description Signal direction IN IN OUT OUT -IN OUT IN IN

3.8.1 Mode of operation

RS-232 operates in single-ended mode, i.e., an unbalanced signal is used for communication .the specification allows for data transmission at relatively slow data rates and travel through short distances. Voltage levels with respect to a system common

(power/logic ground)Represent RS-232 signals .the idle state (Mark) has the signal level negative with respective to common ,and the active state (SPACE) has the signal level positive with respective to common. It has numerous handshaking lines, and specifies a communication protocol. In general if you are not connected to a Modem the handshaking lines can present a lot of problems if not disabled in software or accounted for in the hardware. It has the following specifications 1. All circuits in accordance to RS-232 carry voltage signals ,which must not exceed

+_25V at the connector pins .Any pin must be able to withstand a short circuit to any other pin without standing permanent damage . 2. Since RS -232 is designed as a point to point rather than multi-drop interface, its drivers are specified for single loads of 3K ohms to 7Kohms. 3. At the transmitting side a logic 0 is represented by a driven voltage of between +5V and +15V and a logic 1 between +3V and +15V represent Logic 0 and a voltage between -3V and -15V represent logic 1.Voltage between +-3V are defined and lie in the transition region . 4. The maximum slew rate of the signal at the output of the driver is 30V per micro sec. this limitation is concerned with problem of cross talk between conductors in a multiconductor cable and radiated noise from the cable. 5. RS-232 transmission seldom exceed 100 feet for two reasons .One the difference between transmitted levels (+-5V) and receive levels (+-3V)allows only 2V of common mode rejection .Two ,the distributed capacitance of a longer cable can degrade slew rates by exceeding the maximum specified load (2500PF). 6. The faster the transition edges the greater the cross the greater the cross talk due to the increased high-frequency domain. This restriction together with the fact that the driver and receiver use a common signal ground and the associated noise introduced by the ground current limits the maximum data throughput. It has the following advantages 1. Simplicity and low cost of implementation. 2. It requires one line per signal. 3. Ideal for serial communication with many hand-shaking lines.

4. Cabling costs can be kept to an absolute minimum with short distance communication. It has the following disadvantages 1. Poor noise immunity: Because the ground wire forms the part of the system, transient voltages or shift in voltage potential may be induced, leading to signal degradation and ultimately leading to false receive, triggering. 2. Cross talk : Is high at higher frequencies These problems limit the distance and speed of reliable operation.

3.8.2 MAX 232

MAX 232 used in the circuit acts as a level converter between PC and Micro-Controller .since the output of the PC is 12V and the supply of micro-controller is 5V,MAX 232 converts the input signal of 12V to output signal of +/- 5V.The Micro-Controller uses its RXD and TXD pins to receive and transmit the signal from MAX232.

3.8.3 DB9
The term "DB9" refers to a common connector type, one of the D-Subminiature or D-Sub types of connectors. DB9 has the smallest "footprint" of the D-Subminiature connectors, and houses 9 pins (for the male connector) or 9 holes (for the female connector). The D-subminiature or D-sub is a common type of electrical connector. They are named for their characteristic D-shaped metal shield. When they were introduced, D-subs were among the smaller connectors used on computer systems. DB9 connectors were once very common on PCs and servers. DB9 connectors are designed to work with the EIA/TIA 232 serial interface standard, which determined the function of all nine pins as a standard, so that multiple companies could design them into their products. DB9 connectors were commonly used for serial peripheral devices like keyboards, mice, joysticks, etc. Today, the DB9 has mostly been replaced by more modern interfaces such as USB, PS/2, Firewire, and others. However, there are still many legacy devices that use the DB9 interface for serial communication.

Figure 3.8.3(a) Symbol of DB9 connector

Figure 3.8.3 (b) DB9 connectors

3.9 LM358
The LM358 series consists of two independent, high gain, internally frequency compensated operational amplifiers which were designed specifically to operate from a single power supply over a wide range of voltages. Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage. The Characteristics of LM358 are given by 1. In the linear mode the input common-mode voltage range includes ground and the output voltage can also swing to ground, even though operated from only a single power supply voltage. 2. The unity gain cross frequency is temperature compensated. 3. The input bias current is also temperature compensated.

figure 3.9 LM358 pin diagram It has the following advantages 1. Two internally compensated op amps 2. Eliminates need for dual supplies 3. Allows direct sensing near GND and VOUT also goes to GND 4. Compatible with all forms of logic 5. Power drain suitable for battery operation

3.9.1 Features
1. Available in 8-Bump micro SMD chip sized package, 2. Internally frequency compensated for unity gain 3. Large dc voltage gain: 100 dB 4. Wide bandwidth (unity gain): 1 MHz (temperature compensated) 5. Wide power supply range: Single supply: 3V to 32V dual supplies: 1.5V to 16V 6. Very low supply current drain (500 A) essentially independent of supply voltage 7. Low input offset voltage: 2 mV 8. Input common-mode voltage range includes ground 9. Differential input voltage range equal to the power supply voltage 10. Large output voltage swing

3.10 LM324
The LM324 series consists of four independent, high gain, internally frequency compensated operational amplifiers which were designed specifically to operate from a single power supply over a wide range of voltages. Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage.

Figure 3.10 Pin Diagram Of LM324 It has the following Characteristics 1. In the linear mode the input common-mode voltage range includes ground and the output voltage can also swing to ground, even though operated from only a single power supply voltage 2. The unity gain cross frequency is temperature compensated 3. The input bias current is also temperature compensated

It has the following advantages 1. Eliminates need for dual supplies 2. Four internally compensated op amps in a single package 3. Allows directly sensing near GND and VOUT also goes to GND 4. Compatible with all forms of logic 5. Power drain suitable for battery operation

3.10.1 Features
1. Internally frequency compensated for unity gain 2. Large DC voltage gain 100 dB 3. Wide bandwidth (unity gain) 1 MHz (temperature compensated) 4. Wide power supply range: - Single supply 3V to 32V -or dual supplies 1.5V to 16V 5. Very low supply current drain (700 A)essentially independent of supply voltage 6. Low input biasing current 45 nA (temperature compensated) 7. Low input offset voltage 2 mV and offset current: 5 nA 8. Input common-mode voltage range includes ground 9. Differential input voltage range equal to the power supply voltage 10. Large output voltage swing 0V to V+ 1.5V

3.11 LCD
A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light modulating properties of liquid crystals (LCs). LCs do not emit light directly. They are used in a wide range of applications including: computer monitors, television, instrument panels, aircraft cockpit displays, signal, etc. They are common in consumer devices such as video players, gaming devices, clocks, watches, calculators, and telephones. LCDs have displaced cathode ray tube (CRT) displays in most applications. They are usually more compact, lightweight, portable, less expensive, more reliable, and easier on the eyes. They are available in a wider range of screen sizes than CRT and plasma displays, and since they do not use phosphors, they cannot suffer image burn-in.

LCDs are more energy efficient and offer safer disposal than CRTs. Its low electrical power consumption enables it to be used in battery-powered electronic equipment. It is an electronically-modulated optical device made up of any number of pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector to produce images in colour or monochrome. By 2008, worldwide sales of televisions with LCD screens had surpassed the sale of CRT units. Each pixel of an LCD typically consists of a layer of molecules aligned between two transparent electrodes, and two polarizing filters the axes of transmission of which are (in most of the cases) perpendicular to each other. With no actual liquid crystal between the polarizing filters, light passing through the first filter would be blocked by the second (crossed) polarizer. In most of the cases the liquid crystal has double refraction The surface of the electrodes that are in contact with the liquid crystal material are treated so as to align the liquid crystal molecules in a particular direction. This treatment typically consists of a thin polymer layer that is unidirectionally rubbed using, for example, a cloth. The direction of the liquid crystal alignment is then defined by the direction of rubbing. Electrodes are made of a transparent conductor called Indium Tin Oxide (ITO). Before applying an electric field, the orientation of the liquid crystal molecules is determined by the alignment at the surfaces of electrodes. In a twisted nomadic device (still the most common liquid crystal device), the surface alignment directions at the two electrodes are perpendicular to each other, and so the molecules arrange themselves in a helical structure, or twist. This reduces the rotation of the polarization of the incident light, and the device appears grey. If the applied voltage is large enough, the liquid crystal molecules in the center of the layer are almost completely untwisted and the polarization of the incident light is not rotated as it passes through the liquid crystal layer. This light will then be mainly polarized perpendicular to the second filter, and thus be blocked and the pixel will appear black. By controlling the voltage applied across the liquid crystal layer in each pixel, light can be allowed to pass through in varying amounts thus constituting different levels of gray. LCD with top polarizer removed from device and placed on top, such that the top and bottom polarizers are parallel. The optical effect of a twisted nematic device in the voltage-on state is far less dependent on variations in the device thickness than that in the voltage-off state. Because of this, these devices are

usually operated between crossed polarizer such that they appear bright with no voltage (the eye is much more sensitive to variations in the dark state than the bright state). These devices can also be operated between parallel polarizer, in which case the bright and dark states are reversed. The voltage-off dark state in this configuration appears blotchy, however, because of small variations of thickness across the device. Both the liquid crystal material and the alignment layer material contain ionic compounds. If an electric field of one particular polarity is applied for a long period of time, this ionic material is attracted to the surfaces and degrades the device performance. This is avoided either by applying an alternating current or by reversing the polarity of the electric field as the device is addressed (the response of the liquid crystal layer is identical, regardless of the polarity of the applied field). When a large number of pixels are needed in a display, it is not technically possible to drive each directly since then each pixel would require independent electrodes. Instead, the display is multiplexed. In a multiplexed display, electrodes on one side of the display are grouped and wired together (typically in columns), and each group gets its own voltage source. On the other side, the electrodes are also grouped (typically in rows), with each group getting a voltage sink. The groups are designed so each pixel has a unique, unshared combination of source and sink. The electronics, or the software driving the electronics then turns on sinks in sequence, and drives sources for the pixels of each sink. 3.11.1 Pin Description The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters, whereas LCDs supporting more than 80 characters make use of 2 HD44780 controllers.

Figure 3.11.1(a) Pin description of LCD

Figure3.11.1(b) LCD Display(2x16) This waveform will write an ASCII Byte out to the LCD's screen. The ASCII code to be displayed is eight bits long and is sent to the LCD either four or eight bits at a time. If four bit mode is used, two "nybbles" of data (Sent high four bits and then low four bits with an "E" Clock pulse with each nybble) are sent to make up a full eight bit transfer. The "E" Clock is used to initiate the data transfer within the LCD. Table 3.11 LCD pins and description Pins 1 2 3 4 5 6 7 14 15 16 Description Ground (GND) Supply voltage +5V (VCC) Contrast Adjustment (V0) "R/S" _Instruction/Register Select "R/W" _Read/Write LCD Registers "E" Clock Data I/O Pins Backlight +5V (VB1) Backlight GND (VB0)

As you would probably guess from this description, the interface is a parallel bus, allowing simple and fast reading/writing of data to and from the LCD. Sending parallel data as either four or eight bits are the two primary modes of operation. While there are secondary considerations and modes, deciding how to send the data to the LCD is most critical decision to be made for an LCD interface application. Eight bit mode is best used when speed is required in an application and at least ten I/O pins are available. Four bit mode requires a minimum of six bits. To wire a

microcontroller to an LCD in four bit mode, just the top four bits (DB4-7) are written to. The "R/S" bit is used to select whether data or an instruction is being transferred between the microcontroller and the LCD. If the Bit is set, then the byte at the current LCD "Cursor" Position can be read or written. When the Bit is reset, either an instruction is being sent to the LCD or the execution status of the last instruction is read back (whether or not it has completed). The different instructions available for use with the 44780 are shown in the table below: 3.11.2 Commands Table 3.11.2- Reading/Writing instruction to the LCD R/S R/W D7 D6 D5 D4 D3 D2 D1 D0 Instruction/Description 4 0 0 0 0 0 0 0 0 0 1 5 0 0 0 0 0 0 0 0 1 0 14 13 12 11 10 9 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 8 0 1 7 1 * Pins Clear Display Return Cursor and LCD to Home Position Set Cursor Move Direction


D C B Enable Display/Cursor * * Move Cursor/Shift Display Set Interface Length

SC RL * *


A A A A A A Move Cursor into CGRAM

A A A A A A A Move Cursor to Display * * * * * * Poll the "Busy Flag" Write a Character to the Display at the Current Cursor Position Read the Character

BF *


D D D D D D D D on the Display at the Current Cursor Position

3.12 SIP

A single in line package (or SIP) has one row of connecting pins. It is not as popular as the DIP, but has been used for packaging RAM chips and multiple resistors with a common pin. SIPs group RAM chips together on a small board either by the DIP process or surface mounting SMD process. The board itself has a single row of pin-leads that resembles a comb extending from its bottom edge, which plug into a special socket on a system or system-expansion board. IPs are commonly found in memory modules. As compared to DIPs with a typical maximum I/O count of 64, SIPs have a typical maximum I/O count of 24 with lower package costs. One variant of the single-in-line package uses part of the lead frame for a heat sink tab. This multi-leaded power package is useful for such applications as audio power amplifiers, for example.

4.1 Experimental Investigations 4.1.1 Microcontroller test A microcontroller is tested ok if the testing program fed into the microcontroller produces expected results provided in the program are pertinent. The kit demonstrates the microcontroller test based on the PC. A code was given in the controller to generate a waveform for breathe and digital output for both pulse and temperature. 4.1.2 Power supply test The Connections are as shown in the circuit diagram. A 12 V supply is given as input to the circuit. The output is checked using a DMM .If this output is 5 V then circuit connections is correct. In order to test power supply connections are made on bread

board and +12v are given at the input stage and correspondingly we are getting +5.02 v thus power supply is giving supply properly in both the transmission and the receiving side . 4.1.3 LM358 test The output from the LM35 sensor has to be amplified by the LM358.This is tested at the pin number 7 of the LM358.If the output of the sensor is amplified then, the test is completed. The LM35 gives 0.35v o/p at room temperature. But when amplified it gives 0.86v output at room temperature when measured at pin number 7 using a DMM. 4.1.4 Breathe sensor test The breathe count sensor has to be connected to the PC. Depending on the breathing mechanism of the patient, the slotted wheel rotates and this is plotted as a graph on the screen. Then it is tested. 4.1.5 PCB test Firstly the holes on the PCB are checked against the pins of the components to see if they fix in. Seeing the design the continuity among the corresponding pins is checked using DMM. After placing the components on the PCB the continuity is rechecked. Then its checked if the voltages form the power supply are reaching the appropriate pins of the corresponding IC s using DMM in voltage mode.

4.1.6 Components test The components like keypad, resistors,capacitors are checked using DMM. If you press a key and test with DMM it will give a beep thus continuity is there and keys are working properly.


Temperature (LM35) In future the measurement of temperature can be done by the sensor which are much more sensitive to human body and can transmit it faster. Pulse (piezo electric crystal) Increasing the sensitivity of the sensor it can use for sensing the pulse. Or it can be replaced by the EEG electrodes and used for pulse detection purposes.

Breathe sensor The sensor was mounted in the water meter which is broke open. Since the water meter is heavy, which has a magnetic coupling due to which the metallic disc rotates, can be replaced by a plastic material which is light weight. SMS The SMS can be given simultaneously in case of abnormality instead of one single SMS.

The project PATIENT MONITORING SYSTEM has been successfullydesigned and tested. It has been developed by integrate features of all the sensor componentsused. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit. Secondly, using highly advanced IC's and sensors with the help of growing technology the project has been successfully implemented. Finally we conclude that PATIENT MONITORING SYSTEM is an essential module where in the doctor can be alerted about the status of his/her patient.

Hand book of biomedical instrumentation by RS Khandpur