1.2 Block Diagram:








LCD 16X2







high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. In addition. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip. a full duplex serial port. two data pointers. and clock circuitry. the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. Timer/counters. the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.2 Description: The AT89S52 is a low-power. 4. 32 I/O lines. Eight Interrupt Sources  Full Duplex UART Serial Channel  Low-power Idle and Power-down Modes  Interrupt Recovery from Power-down Mode  Watchdog Timer  Dual Data Pointer  Power-off Flag  Fast Programming Time  Flexible ISP Programming (Byte and Page Mode)  Green (Pb/Halide-free) Packaging Option 4.3 PIN/PORT Details: . serial port. timer/counters. a six-vector two-level interrupt architecture. disabling all other chip functions until the next interrupt or hardware reset. and interrupt system to continue functioning. onchip oscillator. 256 bytes of RAM. Watchdog timer. The AT89S52 provides the following standard features: 8K bytes of Flash. The Idle Mode stops the CPU while allowing the RAM. three 16-bit. The Power-down mode saves the RAM contents but freezes the oscillator.

1/T2EX). respectively.0/T2) and the timer/counter 2 trigger input (P1. Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. Port 1 also receives the low-order address bytes during Flash programming and verification. P0 has internal pull-ups. As an output port. When 1s are written to Port 1 pins.Vcc: Supply voltage (+5V). Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. . Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. as shown in the following table. In this mode. As inputs.1 can be configured to be the timer/counter 2 external count input (P1. External pull-ups are required during program verification. the pins can be used as highimpedance inputs. When 1s are written to port 0 pins. each pin can sink eight TTL Inputs. P1. Port 0: Port 0 is an 8-bit open drain bidirectional I/O port. Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition. they are pulled high by the internal pull-ups and can be used as inputs.0 and P1. Gnd: Ground.

Port 2 uses strong internal pull-ups when emitting 1s. Port 2 emits the contents of the P2 Special Function Register. The Port 3 output buffers can sink/source four TTL inputs. they are pulled high by the internal pull-ups and can be used as inputs.Table PORT1 Port 2: 4. As inputs. When 1s are written to Port 3 pins. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memories that use 16-bit addresses (MOVX @ DPTR). When 1s are written to Port 2 pins. Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89S52. As inputs. . Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups.1 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. In this application.3. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. Port 3 receives some control signals for Flash programming and verification. During accesses to external data memories that use 8-bit addresses (MOVX @ RI). Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. they are pulled high by the internal pull-ups and can be used as inputs. The Port 2 output buffers can sink/source four TTL inputs. as shown in the following table.

XTAL1: .Table 4. This pin is also the program pulse input (PROG) during Flash programming. In normal operation. ALE is active only during a MOVX or MOVC instruction. Note. With the bit set. If desired. the RESET HIGH out feature is enabled. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. that one ALE pulse is skipped during each access to external data memory. Otherwise. that if lock bit 1 is programmed. EA/VPP: External access enables. the pin is weakly pulled high. except that two PSEN activations are skipped during each access to external data memory. In the default state of bit DISRTO. ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. however. This pin drives high for 98 oscillator periods after the Watchdog times out. PSEN: Program Store Enable (PSEN) is the read strobe to external program memory. ALE operation can be disabled by setting bit 0 of SFR location 8EH. ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. however. A high on this pin for two machine cycles while the oscillator is running resets the device.3. PSEN is activated twice each machine cycle. When the AT89S52 is executing code from external program memory.2 PORT 3 Reset input. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. EA will be internally latched on reset. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. Note. EA should be strapped to VCC for internal program executions.

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

2 GSM ARCHITECTURE. The method chosen by GSM is a combination of Time. A call from a GSM mobile station to the PSTN is called a “mobile originated call” (MOC) or “outgoing call”. a method must be devised to divide up the bandwidth among as many users as possible.and Frequency-Division Multiple Access (TDMA/FDMA). or approx. which forms .615 ms). Each of these carrier frequencies is then divided in time. One or more carrier frequencies are assigned to each base station. 0. The words. 4. In this document. Eight burst periods are grouped into a TDMA frame (120/26 ms.Handset UM A-bis BSC A X.577 ms). and a call from a fixed network to a GSM mobile station is called a “mobile terminated call” (MTC) or “incoming call”. “Mobile Station” (MS) or “Mobile Equipment” (ME) are used for mobile terminals supporting GSM services. using a TDMA scheme. the word “product” refers to any product supporting the AT commands interface. Multiple Access and Channel Structure: Since radio spectrum is a limited resource shared by all users. The FDMA part involves the division by frequency of the (maximum) 25 MHz bandwidth into 124 carrier frequencies spaced 200 kHz apart.25 OMC (Operation & Maintenance Center) HLR/ VLR MSC SS7 PSTN BTS SIM card Mobile station Radio sub-system Operation Terminal Data Terminal Network sub-system PSTN FIG 4. The fundamental unit of time in this TDMA scheme is called a burst period and it lasts 15/26 ms (or approx.

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

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

FIGURE. called LAPDm.4: SIGNALLING PROTOCOL STRUCTURE IN GSM The signalling protocol in GSM is structured into three general layers [1]. Across the Um interface. which requires that registration. the data link layer is a modified version of the LAPD protocol used in ISDN. authentication. [19]. which uses the channel structures discussed above over the air interface. These functions are performed by the Network Subsystem. as shown in Figure 3. • • • Authentication Assignment of TMSI Management of subscriber location Radio Resource Management (RR): .4. 7 protocol. In addition. Layer 2 is the data link layer. Layer 3 of the GSM signalling protocol is itself divided into 3 sublayers. A GSM mobile can seamlessly roam nationally and internationally. Mobility Management (MM): Mobility Management handles the control functions required for mobility e.Ensuring the transmission of voice or data of a given quality over the radio link is only part of the function of a cellular mobile network. call routing and location updating functions exist and are standardized in GSM networks. mainly using the Mobile Application Part (MAP) built on top of the Signalling System No. the fact that the geographical area covered by the network is divided into cells necessitates the implementation of a handover mechanism. Across the A interface. the Message Transfer Part layer 2 of Signalling System Number 7 is used. depending on the interface. Layer 1 is the physical layer.g.

The role of the RR management layer is to establish and release stable connection between mobile stations (MS) and an MSC for the duration of a call, and to maintain it despite user movements. The following functions are performed by the MSC • • • • • • Call selection Handover Allocation and take-down of point-to-point channels Monitoring and forwarding of radio connections Introduction of encryption Change in transmission mode

Connection Management (CM): Connection Management is used to setup, maintain and take down call connections; it is comprised of three subgroups: • • • Call Control (CC):- Manages call connections. Supplementary Service Support (SS):- Handles special services. Short Message Service Support (SMS):- Transfers brief texts.

GSM Protocol Stacks:


Protocols on the Um interface:  Layer 1: Physical layer.

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

Connectionless transfer on point-to-multipoint signalling channels. Connection-oriented transfer with retention of the transmission sequence, error detection and error correction.

 Layer 3: Contains the following sub layers which control signalling channel functions (BCH, CCCH and DCCH). GSM Radio Interface: GSM Radio interface uses the base FDMA+TDMA technologies along with an optional Slow Frequency Hopping. The specs are the specifications are mentioned below. • • • • 124 radio carriers, inter carrier spacing 200 kHz. 890 to 915 MHz mobile to base – UPLINK 935 to 960 MHz base to mobile - DOWNLINK 8 channels/carrier

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

Efficient Modem Operation: For our modem to operate at the lowest power level, consistent with satisfactory call quality: If your modem has an extendible antenna, extend it fully. Some models allow

you to place a call with the antenna retracted. However your modem operates more efficiently with the antenna fully extended. Do not hold the antenna when the modem is «IN USE». Holding the antenna affects call quality and may cause the modem to operate at a higher power level than needed. Antenna Care and Replacement: Do not use the modem with a damaged antenna. If a damaged antenna comes into contact with the skin, a minor burn may result. Replace a damaged antenna immediately. Consult your manual to see if you may change the antenna yourself. If so, use only a manufacturer-approved antenna. Otherwise, have your antenna repaired by a qualified technician. Use only the supplied or approved antenna. Unauthorized antennas, modifications or attachments could damage the modem and may contravene local RF emission regulations or invalidate type approval. Driving: Check the laws and regulations on the use of cellular devices in the area where you drive. Always obey them. Also, when using your modem while driving, please: give full attention to driving, pull off the road and park before making or answering a call if driving conditions so allow. When applications are prepared for mobile use they should fulfil road-safety instructions of the current law! Electronic Devices: Most electronic equipment, for example in hospitals and motor vehicles is shielded from RF energy. However RF energy may affect some malfunctioning or improperly shielded electronic equipment. Vehicle Electronic Equipment: Check your vehicle manufacturer’s representative to determine if any on board electronic equipment is adequately shielded from RF energy.

Transmitters: Performance is critical in three areas: in-channel, out-of-channel, and out-of band In-channel measurements determine the link quality seen by the user in question: Phase error and mean frequency error

perform correct calibration and assure correct field operation. in manufacturing where throughput and cost are key drivers. For example.12. but with a minimum of expense.21 V8. and independent parties might interpret them differently. The standards can be difficult to understand. radio transmission and reception 3GPP TS 11. Optimization is key. the objective should be to test sufficiently to prove correct assembly. aviation. it is necessary to use a subset of the measurements defined in the specifications above.05. It is not practical to make the whole suite of measurements in most application areas.0: Base station system (BSS) equipment specification. and police): Other spurious (cross band and wideband) Receivers: Performance is critical in the following area: sensitivity. It is not necessary to type approve infrastructure component shipped. It is worth noting that these specifications were written for the purposes of full type approval and they are extensive. Sensitivity measurements determine the link quality seen by the user in low signal level conditions: Static reference sensitivity level Origins of Measurements: GSM transmitter and receiver measurements originate from the following ETSI 3GPP standards: • • 3GPP TS 05.0: Radio access network.V8. This application note aims to help the reader to interpret the standards and apply tests appropriately. radio aspects.Mean transmitted RF carrier power Transmitted RF carrier power versus time Out-of-channel measurements determine how much interference the user causes other GSM users: • • • Spectrum due to modulation and wide band noise Spectrum due to switching TX and RX band spurious Out-of-band measurements determine how much interference the user causes other users of the radio spectrum (military. Agilent Technologies uses the standards as a basis from which to design measurement algorithms .6.

In application. AT Command syntax The "AT" or "at" prefix must be set at the beginning of each command line.05. controlling device controls the GSM engine by sending AT Command via its serial interface.Attention commands: GSM engines are referred to as following term: 1) ME (Mobile Equipment).”<CR><LF><response><CR><LF>” Throughout this document. FAX board). If autobauding is enabled. 2) MS (Mobile Station).07 and ITU-T recommendation V. GSM07. <CR><LF> are omitted intentionally. Commands are usually followed by a response that includes.25ter and the AT commands developed by SIMCOM. 2) DTE (Data Terminal Equipment) or plainly “the application” which is running on an embedded system. only the responses are presented. the Unsolicited Result Codes “RDY” and so on are not indicated when you start up the MEExtended Syntax These commands can operate in several modes. 4) DCE (Data Communication Equipment) or facsimile DCE(FAX modem. The controlling device at the other end of the serial line is referred to as following term: 1) TE (Terminal Equipment). And if unsolicited result code”SCKS: 0” returned it indicates SIM card isn’t present. 3) TA (Terminal Adapter). To terminate a command line enter <CR>. Note: Only enter AT command through serial port after SIM300 is power on and Unsolicited Result Code “RDY” is received from serial port. The AT command set implemented by SIM300 is a combination of GSM07. as following table: Table 1: Types of AT commands and AT+<x>=? responses Test command The returns mobile the equipment list of .

This command sets the user-definable Execution command AT+<x> parameter values. 1. 1. you only need type “AT” or “or” at the beginning of the command line. Please note to use a semicolon as command delimiter. you do not need to type the “AT” or “at” prefix before every command. The command line buffer can accept a maximum of 256 characters. The SIM300 supports the following character sets: • GSM format • UCS2 . CMS error) of last AT command you entered before you enter the next AT command.parameters ranges set corresponding and with value the Write command or by internal Read command AT+<x>? processes. Instead.4. CME error. please note that you need to wait the final response (for example OK. If the characters entered exceeded this number then none of the command will executed and TA will returns “ERROR”.5 Supported character sets non-variable affected by internal processes in the The SIM300 AT command interface defaults to the IRA character set.5 Entering successive AT commands on separate lines When you need to enter a series of AT commands on separate lines. In this case. The execution command reads parameters GSM engine Combining AT commands on the same command line You can enter several AT commands on the same line. This command returns the currently set value of the Write command AT+<x>=<…> parameter or parameters.

• HEX • IRA • PCCP437 • PCDN • 8859_1 The character set can be set and interrogated using the “AT+CSCS” command (GSM 07.05 AT+CMGF SELECT SMS MESSAGE FORMAT AT+CMGF Select SMS Message Format AT+CMGF Select SMS Message Format Read Command Response AT+CMGF? +CMGF: <mode> OK Parameters Test Command AT+CMGF=? Write Command AT+CMGF=[<mode>] see write command Response +CMGF: list of supported <mode>s OK Response TA sets parameter to denote which input and output format of messages to use.07).05. The character set is defined in GSM specification 07. Overview of AT Commands According to GSM07. OK Parameters 0 PDU mode 1 text mode ATE SET COMMAND ECHO MODE ATE Set command echo mode ATE Set command echo mode Write command Response ATE[<value>] This setting determines whether or not .

the TA echoes characters received from TE during command state. Optionally (when +CSMS <service> value is 1 and network supports) <scts> is returned. This page is to help the enthusiast who wants to interface LCD with . Values can be used to identify message upon unsolicited delivery status report result code. OK Parameter 0 Echo mode off 1 Echo mode on AT+CMGS Response SEND SMS MESSAGE TA sends message from a TE to the network (SMS-SUBMIT). But due to lack of proper approach to LCD interfacing many of them fail. you just need to have a logical approach. Many people consider LCD interfacing a complex job but according to me LCD interfacing is very easy task. 1) If text mode(+CMGF=1) and sending successful: +CMGS: <mr> OK 2) If PDU mode(+CMGF=0) and sending successful: +CMGS: <mr> OK 3)If error is related to ME functionality: +CMS ERROR: <err> LCD 16x2 Liquid crystal display is very important device in embedded system. Message reference value <mr> is returned to the TE on successful message delivery. It offers high flexibility to user as he can display the required data on it.

Check how LCD discriminates data bytes and command bytes. You can refer the datasheet of LCD to know the LCD driver for e. I will show you a technique to manipulate a datasheet within minutes. Here you set the interface mode. is it active low and which pins of LCD are to be toggled. First thing to find out in datasheet is the features viz. number of row and columns.This page will help you develop logical approach towards LCD interfacing. JHD 162A is name of LCD having driver HD44780U. Copy and Paste technique may not work when an embedded system engineer wants to apply LCD interfacing in real world projects. your LCD is dumb it does not know to talk with your microcontroller. Why people ignore datasheets? Most of us do not like to read 100 pages of datasheet. LCD driver is a link between the microcontroller and LCD. From datasheet of LCD driver find out whether hardware reset is required at startup. Without these booster rockets the space shuttle would not launch in geosynchronous orbit. First thing to begin with is to know what LCD driver/controller is used in LCD. size of display data RAM. Similarly to understand LCD interfacing you need to have booster rockets attached! To get it done right you must have general idea how to approach any given LCD. which pins on LCD are used for communication. what is the time of reset pulse. To understand the algorithm of LCD interfacing user must have datasheet of both LCD and LCD driver.You have to interface the LCD according to the driver specification.Pin diagram of LCD driver can be omitted. horizontal or vertical addressing . bits per pixel. display mode. Many people ignore the datasheets and end up in troubles.Yes. Major task in LCD interfacing is the initialization sequence. But for a accurate technical specification datasheets are must. maximum speed for interface in MHz. type of interface. In LCD initialization you have to send command bytes to LCD. address counter increment direction. You will be knowing about the booster rockets on space shuttle.g. You must have the pin diagram of LCD. set contrast of LCD. operating voltage.through understanding. If you want to interface LCD successfully you must have datasheets. number of pixels. Study the type of communication protocol whether it is parallel or serial interface. Study Interface timing diagram given in the datasheet.

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

Character LCD pins with 1 Controller Character LCD pins with 2 Controller DDRAM-Display data RAM: .

For LCDs like 1x16. only 16 characters are visible. The character generator ROM generates 5 x 8 dot or 5 x 10 dot character patterns from 8-bit character codes. Figures below will show you the DDRAM addresses of 1 Line. It can generate 208 5 x 8 dot character patterns and 32 5 x 10 dot character patterns. 2 Line and 4 Line LCDs. The area in display data RAM (DDRAM) that is not used for display can be used as general data RAM.Character Generator ROM Now you might be thinking that when you send an ASCII value to DDRAM. Its extended capacity is 80 X 8 bits. User defined character patterns are also available by mask-programmed ROM.Display data RAM (DDRAM) stores display data represented in 8-bit character codes. So whatever you send on the DDRAM is actually displayed on the LCD. . DDRAM Address for 1 Line LCD DDRAM Address for 2 Line LCD DDRAM Address for 4 Line LCD CGROM . or 80 characters. so whatever you write after 16 chars is written in DDRAM but is not visible to the user. how the character is displayed on LCD? So the answer is CGROM.

control information is temporarily stored into these registers to allow interfacing with various MCUs. BF =1) and as soon as the instruction is executed successfully this flag is cleared (BF = 0). LCD address etc. LCD clear. the address where you want to send the data. This is helpful in producing and exact amount of delay. which include register selection signal (RS). which operate at different speeds. These signals. For 5 x 8 dots. the condition RS = 0 and R/W = 1 must be met and The MSB of the LCD data bus (D7) act as busy flag. and for 5 x 10 dots.Character Generator RAM CGRAM area is used to create custom characters in LCD. When we send a command or data to the LCD for processing. and Data register is used for storing data .e. and the data bus (DB0 to DB7). In the character generator RAM.g. four character patterns can be written. this flag is set (i. or various peripheral control devices. When BF = 1 means LCD is busy and will not accept next command or data and BF = 0 means LCD is ready for the next command or data to process. read/write signal (R/W).CGRAM . .Busy Flag Busy Flag is a status indicator flag for LCD. The internal operation of the LCD is determined by signals sent from the MCU. LCD shift command. which is to be displayed on LCD when send the enable signal of the LCD is asserted. Commands and Instruction set Only the instruction register (IR) and the data register (DR) of the LCD can be controlled by the MCU. the data on the pins is latched in to the data register and data is then moved automatically to the DDRAM and hence is displayed on the LCD? Data Register is not only used for sending data to DDRAM but also for CGRAM. Instruction register corresponds to the register where you send commands to LCD e. Before starting the internal operation of the LCD. is decided by the instruction you send to LCD. the user can rewrite character patterns by program. eight character patterns can be written. Instruction Register (IR) and Data Register (DR) There are two 8-bit registers in HD44780 controller Instruction and Data register. BF . To read Busy Flag.

There are four categories of instructions that: • • • • Designate LCD functions. etc.make up the LCD instructions (table below). . Below is a brief list of useful commands which are used frequently while working on the LCD. data length. such as display format. Set internal RAM addresses Perform data transfer with internal RAM Perform miscellaneous functions Table: Command and Instruction set for LCD type HD44780 Although looking at the table you can make your own commands and test them.

Initialization by internal Reset Circuit An internal reset circuit automatically initializes the HD44780U when the power is turned on. we will discuss both ways of initialization one by one. The following instructions are executed during the initialization. The busy flag (BF) is . LCD has to be initialized either by the internal reset circuit or sending set of commands to initialize the LCD.Frequently used commands and instructions for LCD LCD Initialization Before using the LCD for display purpose. It is the user who has to decide whether an LCD has to be initialized by instructions or by internal reset circuit.

mode = 1. . The busy state lasts for 10 ms after VCC rises to 4. 0.kept in the busy state until the initialization ends (BF = 1). Increment by Display Cursor 8-bit interface 1-line set: data display control: off off set: 1 F = 0. on/off = = 0. • • Display clear Function DL N = = 1. Blinking off • Entry I/D S = 0. 0. 5 x 8 dot character font • Display D C B = 0. No shift Power Supply condition for Internal Reset circuit Figure 7 shows the test conditions which are to be met for internal reset circuit to be active.5 V.

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

1) 2) 3) 4) 5) 6) 7) 8) 9) Set Send Function entry set Display mode command Send command see Send command Send command 0x30 Delay 0x30 Delay 0x30 Delay Table 4 Clear explained for more 8-bit 8-bit Using 8-bit interface 20ms interface 20ms interface 20ms information command below The first 3 commands are usually not required but are recommended when you are using .Flow chart for LCD initialization As you can see from the flow chart. the LCD is initialized in the following sequence.

         Wait for about 20mS Send the first init value (0x30) Wait for about 10mS Send second init value (0x30) Wait for about 1mS Send third init value (0x30) Wait for 1mS Select bus width (0x30 .4-bit interface. Following is the reset sequence of LCD. This delay might vary depending on the LCD you are using. we need to follow special sequence of initialization that tells the LCD controller that user has selected 4-bit mode of operation. So it actually depends on the LCD module you are using. as you might have a different crystal frequency on which LCD controller is running. Instead we simply put a certain amount of delay usually 300 to 600uS. This usually works. Usually we do not use busy flag in 4-bit mode as we have to write code for reading two nibbles from the LCD. We call this special sequence as resetting the LCD. So if you feel any problem running the LCD. Function set command depends on what kind of LCD you are using and what kind of interface you are using. LCD interfacing with Microcontrollers-4bit mode In 4-bit mode the data is sent in nibbles. simply try to increase the delay. To enable the 4-bit mode of LCD. first we send the higher nibble and then the lower nibble.for 8-bit and 0x20 for 4-bit) Wait for 1mS The busy flag will only be valid after the above reset sequence. So you can program the LCD starting from step 7 when working with 8bit interface. LCD connections in 4-bit Mode .

ONEWIRE PROTOCAL FOR TEMPERATURE SENSOR DS1820 1-Wire is a device communications bus system designed by Dallas Semiconductor Corp. Then you may connect it on your controller but that will only increase another pin and does not make any big difference. We are not using Read/Write (RW) Pin of the LCD. Potentiometer RV1 is used to control the LCD contrast. D0-D3 are connected to ground. signaling. If you want to use it. D4-D7 are the data pins connection and Enable and Register select are for LCD control pins. and power over a single signal. It is typically used to communicate with small inexpensive devices such as digital thermometers and weather . that provides low-speed data.[1] 1-Wire is similar in concept to I²C. where we only need 6 pins to interface an LCD.e. The unwanted data pins of LCD i. as we are only writing on the LCD so we have made it grounded permanently. but with lower data rates and longer range.Above is the connection diagram of LCD in 4-bit mode.

or attached to the object being monitored. The iButton (also known as the Dallas Key) is a mechanical packaging standard that places a 1-Wire component inside a small stainless steel "button" similar to a disk-shaped battery. In such systems. Manufacturers also produce products that are more complex than a single component. Parallax BASIC Stamp. and use the 1-wire bus to communicate. or attached to a device being monitored. and power the device during periods where the data line is used for data. timers. These can be connected to a PC using a bus converter. the Microchip PIC family and RENESAS family. each including all of the logic needed to operate on the 1-Wire bus. Alternatively. MicroLans also interface to microcontrollers. PICAXE. RS-232 serial. Parallax Propeller. To accomplish this. the iButton clips into it. but is easily removed. . battery monitors. iButtons are used as Akbil smart tickets for the Public transport in Istanbul. iButtons are connected to 1-Wire bus systems by means of sockets with contacts which touch the "lid" and "base" of the canister. native 1-wire devices are available as single components in integrated circuit and TO92 packaging. 1-wire devices include an 800 pF capacitor to store charge. RJ11 (6P2C or 6P4C modular plugs.instruments. A 1-Wire device may be just one of many components on a circuit board within a product. with the devices themselves mounted in a socket. commonly used for telephones) are popular. voltage and current sensors. Dependent on function. incorporated in a small PCB. and in some cases a portable form called an iButton that resembles a watch battery. Some laboratory systems and other data acquisition and control systems connect to 1-Wire devices using cords with modular connectors or with CAT-5 cable. and parallel port interfaces are popular solutions for connecting the MicroLan to the host PC. such as the Arduino. A network of 1-Wire devices with an associated master device is called a MicroLan. but are also found in isolation within devices such as a temperature sensor probe. the connection can be semi-permanent with a different socket type. Systems of sensors and actuators can be built by wiring together 1-Wire components. USB. One distinctive feature of the bus is the possibility to use only two wires: data and ground. Examples include temperature loggers. and memory.

The master starts a transmission with a "reset" pulse. which may be a PC or a microcontroller.3 kbit/s can be achieved. After a collision. The falling (negative) edge of the pulse is used to start a monostable multivibrator in the slave device. connects the pull up resistor to ground through its output MOSFET. which is why the output pulses have to be 60 µs long. The multivibrator in the slave clocks to read the data line about 30 µs after the falling edge. There is also an overdrive mode which speeds up the communication by a factor of 10. The slave's multivibrator unavoidably has analog tolerances that affect its timing accuracy. a ring-mounted iButton with a Java Virtual Machine compatible with the Java Card 2. Protocols are built into the software to detect collisions. and may provide power to the slave devices. which pulls the wire to 0 volts for 480 µs. The master initiates activity on the bus. . and the starting pulse can't be longer than 15 µs.[2] Each 1-Wire chip has a unique code buried within it. operate time clock systems. Use of the bus In any MicroLan. simplifying the avoidance of collisions on the bus. if present. shows that it exists with a "presence" pulse: it holds the wire to ground for at least 60 µs after the master releases the bus.15 µs) low pulse. any slave device. After that. Communication occurs when a master or slave asserts the bus low—that is. was given to attendees of the JavaOne 1998 conference. ideal for use as a key to open a lock. A single pull-up resistor is common to all devices and acts to pull the bus up to 3 or 5 volts. Specific 1-Wire driver and bridge chips are also available. The Dallas 1-Wire network is physically implemented as an open drain master device connected to one or more open drain slaves[3] . probably by depriving them all of power. and other similar uses. arm and deactivate burglar alarms. To send a "1".0 specification within. there is always exactly one master in overall charge. To send a "0". the software sends a 60 µs low pulse. authenticate computer system users. This resets every slave device on the bus. especially in an iButton package. Data rates of 16. the bus master software sends a very brief (1 .The Java Ring. This feature makes the chips. the master tries again to effect the required communication.

and then data is sent or received in groups of 8-bits. The master can send a selection command. and are particularly useful in utilizing long (greater than 100 m) cables effectively. "listening" after each bit of an address.If a parallel port is inconvenient or the operating system interferes with the timing. it does nothing. and the wire goes immediately up to the pulled-up voltage. The bus also has an algorithm to recover the address of every device on the bus. The 64-bit address space is searched as a binary tree. [4] There are several standard broadcast commands. and then an address. The least significant byte of the serial number is an 8-bit number that tells the type of the device. Serial or USB "bridge" chips are also available that handle the timing and waveform requirements of the 1-Wire bus. If a slave has all the address bits so far. Up to 300 meter long buses consisting of simple twistedpair telephone cable has been tested by the manufacturer. the master sends a 1-15 µs 0 volt pulse to start each bit. and then the address of a particular device. To find the devices. and commands addressed to particular devices. allowing up to 75 devices to be found per second. When a sequence of data is being transferred. errors can be detected with an 8-bit CRC (weak data protection). It will however require adjustment of pull-up resistances from say 5kΩ to 1 kΩ. If the transmitting slave unit wants to send a "1". The most significant byte is a standard (for the 1-wire bus) 8-bit CRC. it returns a 0. The basic sequence is a reset pulse followed by an 8-bit command. Since the address includes the device type and a CRC. When receiving data. Many devices can share the same bus. Each device on the bus has a unique 64-bit serial number. a UART running at 100 kbit/s with a few resistors and special software can produce and sense acceptable 1-wire pulses. recovering the address roster also produces a reliable inventory of the devices on the bus. it pulls the data line to ground for 60 µs. the master broadcasts an enumeration command. The master uses this simple behavior to search systematically for valid sequences of . If the transmitting slave wants to send a "0". and then the next command is executed only by the selected device.

On input sample time high. Software can therefore explore sequential Example communication with a device The following signals were generated by an FPGA.address bits. the manufacturer has a special device that either passes through the bus or switches it off. and measured with a logic analyzer. The process is much faster than a brute force search of all possible 64-bit numbers because as soon as an invalid bit is detected. The 1-wire input is the measured bus signal. which was the master for the communication with a DS2432 (EEPROM) chip. all subsequent address bits are known to be invalid. MAX232 . the FPGA samples the input for detecting the device response and receiving bits. High on the 1-wire output means that the output of the FPGA is in tri-state mode and the 1-wire device can pull down the bus. An enumeration of 10 or 15 devices finishes very quickly. Low means that the FPGA pulls down the bus. The location of devices on the bus is sometimes significant. For these situations.

This can be confusing when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite from the RS232 Control Line voltages at the same logic state. The receivers reduce RS-232 inputs (which may be as high as ± 25 V).1 μF in place of the 1. it changes a TTL Logic 0 to between +3 and +15 V. When a MAX232 IC receives a TTL level to convert.5 V. TX. see the table below. These receivers have a typical threshold of 1. to standard 5 V TTL levels. The drivers provide RS-232 voltage level outputs (approx.0 μF capacitors used with the original device. [2] [edit] Voltage levels It is helpful to understand what occurs to the voltage levels. CTS and RTS signals. and changes TTL Logic 1 to between -3 to -15 V. as power supply design does not need to be made more complicated just for driving the RS-232 in this case.5 V. and a typical hysteresis of 0. To clarify the matter. For more information see RS-232 Voltage Levels. from 3 to 5. This makes it useful for implementing RS-232 in devices that otherwise do not need any voltages outside the 0 V to + 5 V range. but operates at a broader voltage range.The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits.3 V. ± 7. RS232 Line Type & Logic Level RS232 TTL Voltage to/from .[1] The newer MAX3232 is also backwards compatible. The later MAX232A is backwards compatible with the original MAX232 but may operate at higher baud rates and can use smaller external capacitors – 0. and vice versa for converting from RS232 to TTL.5 V) from a single + 5 V supply via on-chip charge pumps and external capacitors. The MAX232 is a dual driver/receiver and typically converts the RX.

A number of factors allow serial to be clocked at a greater rate: • Clock skew between different channels is not an issue (for unclocked asynchronous serial communication links) A serial connection requires fewer interconnecting cables (e. on a link with several parallel channels. or SerDes) and to outstrip its disadvantages (clock skew. Serial versus parallel The communication links across which computers—or parts of computers—talk to one another may be either serial or parallel. where several bits are sent as a whole. where the cost of cable and synchronization difficulties make parallel communication impractical. interconnect density). Serial computer buses are becoming more common even at shorter distances.Data Transmission (Rx/Tx) Logic 0 Data Transmission (Rx/Tx) Logic 1 Control Signals (RTS/CTS/DTR/DSR) Logic 0 Control Logic 1 SERIAL COMMUNICATION Signals (RTS/CTS/DTR/DSR) Voltage MAX232 +3 V to +15 V 0 V -3 V to -15 V 5 V -3 V to -15 V 5 V +3 V to +15 V 0 V n telecommunication and computer science. This is in contrast to parallel communication.g. At first sight it would seem that a serial link must be inferior to a parallel one. etc. the concept of serial communication is the process of sending data one bit at a time. and achieve a higher data rate. A parallel link transmits several streams of data (perhaps representing particular bits of a stream of bytes) along multiple channels (wires. Serial communication is used for all long-haul communication and most computer networks. printed circuit tracks. a serial link transmits a single stream of data. sequentially. over a communication channel or computer bus. The extra space allows for better isolation of the channel from its surroundings • . as improved signal integrity and transmission speeds in newer serial technologies have begun to outweigh the parallel bus's advantage of simplicity (no need for serializer and deserializer. However. it is often the case that serial links can be clocked considerably faster than parallel links. wires/fibres) and hence occupies less space. because it can transmit less data on each clock tick.). optical fibres.

as opposed to parallel ones. the meaning of signals. • • • Interface mechanical characteristics. serial is a better option because it is cheaper to implement. short-circuit behavior. parity) protocols for error detection or algorithms for data compression bit rates for transmission. issued in 1997 Scope of the standard The Electronic Industries Association (EIA) standard RS-232-C[1] as of 1969 defines: • Electrical signal characteristics such as voltage levels. RS-232 (Recommended Standard 232) is the traditional name for a series of standards for serial binary single-ended data and control signals connecting between a DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating Equipment). voltage withstand level. ASCII. although the standard says it is intended for bit rates lower than 20. The standard does not define such elements as • • character encoding (for example. because there are fewer conductors in proximity. signaling rate. timing and slew-rate of signals. The standard defines the electrical characteristics and timing of signals. Functions of each circuit in the interface connector. and maximum load capacitance. Many ICs have serial interfaces. start/stop bits. Many modern devices support speeds of 115. In many cases.200 bit/s and above • • . In telecommunications. pluggable connectors and pin identification.• Crosstalk is less of an issue. The current version of the standard is TIA-232-F Interface Between Data Terminal Equipment and Data Circuit-Terminating Equipment Employing Serial Binary Data Interchange. so that they have fewer pins and are therefore less expensive.000 bits per second. Baudot code or EBCDIC) the framing of characters in the data stream (bits per character. It is commonly used in computer serial ports. and the physical size and pinout of connectors. Standard subsets of interface circuits for selected telecom applications.

History RS-232 was first introduced in 1962. test instruments. It remained in widespread use into the late 1990s. Common problems were non-standard pin assignment of circuits on connectors. and a receiver that converts from RS-232 compatible signal levels to the UART's logic levels. Since application to devices such as computers. an RS-232-compatible port was a standard feature for serial communications. patch boxes. and shortcircuit behavior are typically controlled by a line driver that converts from the UART's logic levels to RS-232 compatible signal levels. A common deviation from the standard was to drive the signals at a reduced voltage: the standard requires the transmitter to use +12 V and −12 V." Later personal computers (and other devices) started to make use of the standard so that they could connect to existing equipment. often a single integrated circuit called a UART that converts data from parallel to asynchronous start-stop serial form. books. Some manufacturers therefore built transmitters that supplied +5 V and -5 V and labeled them as "RS-232 compatible. but requires the receiver to distinguish voltages as low as +3 V and -3 V. and incorrect or missing control signals. The C revision of the standard was issued in 1969 in part to accommodate the electrical characteristics of these devices. Details of voltage levels. on many computers. such as USB. and so on was not considered by the standard. In personal computer peripherals it has largely been supplanted by other interface standards. For many years.• power supply to external devices. When electronic terminals (smart and dumb) began to be used. test equipment. such as modem connections. RS232 is still used to connect older designs of peripherals. The lack of adherence to the standards produced a thriving industry of breakout boxes.[2] The original DTEs were electromechanical teletypewriters and the original DCEs were (usually) modems. Details of character format and transmission bit rate are controlled by the serial port hardware. and so supported RS-232. and other aids for the connection of disparate equipment. industrial equipment (such as . designers implementing an RS-232 compatible interface on their equipment often interpreted the requirements idiosyncratically. slew rate. they were often designed to be interchangeable with teletypes. printers.

in particular.PLCs). the designer must decide on either a DTE-like or DCE-like interface and which connector pin assignments to use.[3] Revision C was issued in a document dated August 1969.24. The current revision is TIA-232-F Interface Between Data Terminal Equipment and Data Circuit-Terminating Equipment Employing Serial Binary Data Interchange. • The handshaking and control lines of the interface are intended for the setup and takedown of a dial-up communication circuit. . they have limitations in speed and compatibility. Issues with the RS-232 standard include:[4] • The large voltage swings and requirement for positive and negative supplies increases power consumption of the interface and complicates power supply design. Changes since Revision C have been in timing and details intended to improve harmonization with the CCITT standard V. The standard continued to be revised and updated by the Electronic Industries Alliance and since 1988 by the Telecommunications Industry Association (TIA). Multi-drop connection among more than two devices is not defined. • Single-ended signaling referred to a common signal ground limits the noise immunity and transmission distance. EIA 232. The voltage swing requirement also limits the upper speed of a compatible interface. and most recently as TIA 232. the use of handshake lines for flow control is not reliably implemented in many devices. and has been variously known as EIA RS-232. The standard has been renamed several times during its history as the sponsoring organization changed its name. issued in 1997. Revision D was issued in 1986. but equipment built to the current standard will interoperate with older versions. console ports and special purpose equipment such as a cash drawer for a cash register. • • Asymmetrical definitions of the two ends of the link make the assignment of the role of a newly developed device problematic. While multidrop "work-arounds" have been devised. Limitations of the standard Because the application of RS-232 has extended far beyond the original purpose of interconnecting a terminal with a modem. successor standards have been developed to address the limitations.

that is. . Valid signals are plus or minus 3 to 15 volts.• No method is specified for sending power to a device. user data is sent as a time-series of bits. the standard defines a number of control circuits used to manage the connection between the DTE and DCE. or character encoding. While a small amount of current can be extracted from the DTR and RTS lines. supporting concurrent data flow in both directions. The standard does not define character framing within the data stream. the ±3 V range near zero volts is not a valid RS-232 level. Standard details In RS-232. Both synchronous and asynchronous transmissions are supported by the standard. Each data or control circuit only operates in one direction. the interface can operate in a full duplex manner. and ±15 V are all commonly seen depending on the power supplies available within a device. Voltage levels Diagrammatic oscilloscope trace of voltage levels for an uppercase ASCII "K" character (0x4b) with 1 start bit. In addition to the data circuits. is also controlled. RS-232 drivers and receivers must be able to withstand indefinite short circuit to ground or to any voltage level up to ±25 volts. The slew rate. 1 stop bit The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels for the data transmission and the control signal lines. Since transmit data and receive data are separate circuits. • The 25-way connector recommended in the standard is large compared to current practice. ±12 V. 8 data bits. signaling from a DTE to the attached DCE or the reverse. this is only suitable for low power devices such as mice. The standard specifies a maximum open-circuit voltage of 25 volts: signal levels of ±5 V. or how fast the signal changes between levels. ±10 V.

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

on the original IBM PC. but the female D-sub connector was used for a parallel Centronics printer port. In practice. NOT GATE INPUT OUTPUT A 0 1 NOT A 1 0 Traditional NOT Gate (Inverter) symbol International Electrotechnical Commission NOT Gate (Inverter) symbol In digital logic. The standard specifies 20 different signal connections. Since this 'resistive-drain' approach uses only a single type of . Inverters can be constructed using a single NMOS transistor or a single PMOS transistor coupled with a resistor. For example. Some personal computers put non-standard voltages or signals on some pins of their serial ports. a male D-sub was an RS-232C DTE port (with a non-standard current loop interface on reserved pins). Many terminals were manufactured with female terminals but were sold with a cable with male connectors at each end. The truth table is shown on the right. actual devices have electrical characteristics that must be carefully considered when designing inverters. Presence of a 25 pin D-sub connector does not necessarily indicate an RS-232-C compliant interface. which is the defining assumption in Digital electronics. Other devices may have any combination of connector gender and pin definitions. In fact. Since most devices use only a few signals. and modems have female connectors with DCE pin functions. the non-ideal transition region An inverter circuit outputs a voltage representing the opposite logic-level to its input. smaller connectors can often be used.terminals and computers have male connectors with DTE pin functions. the terminal with its cable satisfied the recommendations in the standard. This represents perfect switching behavior. an inverter or NOT gate is a logic gate which implements logical negation.

Electronic . Digital electronics circuits operate at fixed voltage levels corresponding to a logical 0 or 1 (see Binary). Often these units were anchored to a wall or ceiling to use it as a sounding board. a relay may be connected to interrupt its own actuating current. However. Similarly. because current flows through the resistor in one of the two states. Inverters can also be constructed with Bipolar Junction Transistors (BJT) in either a resistor-transistor logic (RTL) or a transistor-transistor logic (TTL) configuration. the resistive-drain configuration is disadvantaged for power consumption and processing speed. Implementation determines the actual voltage. BUZZER A buzzer or beeper is an audio signaling device. An inverter circuit serves as the basic logic gate to swap between those two voltage levels. +5V) for TTL circuits. Typical uses of buzzers and beepers include alarms. The word "buzzer" comes from the rasping noise that electromechanical buzzers made. which may be mechanical. inverters can be constructed using two complementary transistors in a CMOS configuration. Processing speed can also be improved due to the relatively low resistance compared to the NMOS-only or PMOS-only type devices. This configuration greatly reduces power consumption since one of the transistors is always off in both logic states. electromechanical. or electronic. but common levels include (0. timers and confirmation of user input such as a mouse click or keystroke. Electromechanical Early devices were based on an electromechanical system identical to an electric bell without the metal gong. it can be fabricated at low cost. Alternatively.transistor. causing the contacts to buzz.

This type of equipment is used to detect a gas leak and interface with a control system so a process can be automatically shut down. A gas detector can also sound an alarm to operators in the area where the leak is occurring.). Originally. flammable and toxic gases. detectors were produced to detect a single gas. when dangerous levels of gas vapors are detected. the sensor responds to a calibration gas. infrared. This type of device is used widely in industry and can found in a variety of locations such as on oil rigs. . etc. oxidation. They can also be classified according to the operation mechanism (semiconductors. As a sensor’s detection exceeds a preset alarm level. The first is used to monitor the atmosphere around personnel and is worn on clothing or on a belt/harness. usually as part of a safety system. They transmit warnings via a series of audible and visible signals such as alarms and flashing lights. the alarm or signal will be activated. or even a combination of both types Types Gas detectors come in two main types: portable devices and fixed gas detectors. This type of device is important because there are many gases that can be harmful to organic life. Sounds commonly used to indicate that a button has been pressed are a click. They may also be used in firefighting. to monitor manufacture processes and emerging technologies such as photovoltaic. catalytic. which serves as the reference point or scale. Gas detectors are usually battery operated. Electronic buzzers find many applications in modern days. As detectors measure a gas concentration. Gas detectors can be used to detect combustible. Gas detector A gas detector is a device which detects the presence of various gases within an area.Piezoelectric disk beeper A piezoelectric element may be driven by an oscillating electronic circuit or other audio signal source. such as humans or animals. gas detectors are produced as portable or stationary devices. a ring or a beep. but modern units may detect several toxic or combustible gases. As units. giving them the opportunity to leave the area. and oxygen depletion.

[2] or as part of feeback loop which maintains a constant partial pressure of oxygen in a rebreather. early detection methods relied on less precise detectors. and alert the leakage of a wide array of gases. History Gas leak detection methods became a concern after the effects of harmful gases on human health were discovered. semiconductor. These sensors are used for a wide range of applications. vehicles. and cryogenic suppliers are typical customers. A rapid decrease of oxygen can provide a very dangerous environment for employees. Since then. normally a very songful bird. Electrochemical Sensors. and around the home. MRI rooms. would stop singing and eventually die in the presence of these gases. coal miners would bring canaries down to the tunnels with them as an early detection system against life threatening gases such as carbon monoxide and methane. These sensors usually employ an audible alarm to alert people when a dangerous gas has been detected. monitor. and Semiconductor Sensors. Before modern electronic sensors. for example to determine the proportion of oxygen in a nitrox mixture used in scuba diving. . Oxygen fraction in a breathing gas is measured by electro-galvanic fuel cell sensors.[3] Gas leak detection Gas leak detection is the process of identifying potentially hazardous gas leaks by means of various sensors. and argon (Ar) are inert and can displace oxygen (O2) in a confined space if a leak is present. Common sensors used today include Infrared Point Sensors. signaling the miners to exit the mine quickly. wastewater treatment facilities. many technologies and devices have been developed to detect. an oxygen gas monitor is important to have when cryogenics are present. The canary. refineries. helium (He). carbon monoxide presence was detected with a chemically infused paper that turned brown when exposed to the gas. Ultrasonic Sensors. Through the 19th and early 20th centuries. Before the development of electronic household carbon monoxide detectors in the 1980s and 90s.Oxygen concentration Oxygen deficiency gas monitors are used for employee and workforce safety. They may be used stand-alone. Laboratories. pharmaceutical. and can be found in industrial plants. With this in mind. Cryogenics such as liquid nitrogen (LN2).

Also. the difference in energy between these two wavelengths is proportional to the concentration of gas present. since the diffusion barrier is a physical/mechanical barrier. Energy from the radiation is absorbed as it passes through the gas at certain wavelengths. IR sensors are commonly found in wastewater treatment facilities. and other facilities where flammable gases are present and the possibility of an explosion exists. underground gas storage facilities.[2] Electrochemical gas detectors are used in a wide variety of environments such as refineries.[4] This type of sensor is advantageous because it does not have to be placed in the gas itself in order to detect it. and more. gas turbines. The sensor would be able to detect high levels of carbon dioxide in the vehicles’ exhaust.5 μm. The range of wavelengths that is absorbed depends on the properties of the specific gas. Manufactures can customize electrochemical gas detectors by changing the porous barrier to allow for the detection of a certain gas concentration range. the sensors themselves are subject to corrosive elements and may last only 1-2 years before a replacement is required. the detector tends to be more stable and reliable over the sensor's duration and thus requires less maintenance than other types of detectors. chemical plants. The energy in this wavelength is compared to a wavelength outside of the absorption range. and other infrared active gases such as water vapor and calcium fluoride. Infrared Point Detectors Infrared point sensors (IR) use radiation passing through a volume of gas to detect leaks. However. Carbon monoxide absorbs wavelengths of about 4.[1] The sensor is then able to determine the concentration of the gas. and even be integrated with the vehicles’ electronic systems to notify drivers.Types of Gas Detectors Electrochemical Detectors Electrochemical gas detectors work by allowing gases to diffuse through a porous membrane to an electrode where it is either oxidized or reduced. chemical plants.75 μm for most people. The amount of current produced is determined by how much of the gas is oxidized at the electrode. for example.[6] .2-4. refineries.[3] This is approximately a factor of 10 larger than the wavelength of visible light. gas turbines. which ranges from . Engine emissions are another area where IR sensors are being researched for use.39 μm to .[5] compounds composed of hydrogen and carbon atoms. Infrared point sensors can be used to detect hydrocarbons.

Semiconductor Detectors Semiconductor sensors detect gases by a chemical reaction that takes place when the gas comes in contact with the sensor. Ultrasonic gas detectors are mainly used for outdoor environments where weather conditions can easily dissipate escaping gas before allowing it to reach gas leak detectors that require contact with the gas in order to detect it and sound an alarm. Ultrasonic Detectors Ultrasonic gas detectors use acoustic sensors to detect changes in the background noise of its environment.[9] One of the most common uses for semiconductor sensors is in carbon monoxide sensors.5 kΩ in the presence of 1% methane. Since most gas leaks occur in the ultrasonic range of 25 kHz to 10 MHz.[7] and the electrical resistance in the sensor is decreased when it comes in contact with the monitored gas. the larger its ultrasonic sound level will be. gas compressor and metering stations. oxygen. semiconductor sensors work in a smaller range than infrared point or ultrasonic detectors. the device is still able to determine the leak rate of an escaping gas.[11] The ultrasonic gas leak detector then produces an alarm when there is an ultrasonic deviation from the normal condition of background noise. gas turbine power plants. The bigger the leak. alcohol. and other facilities that house a lot of outdoor pipeline.[8] This change in resistance is used to calculate the gas concentration. the sensors are able to easily distinguish these frequencies from background noise which occurs in the audible range of 20 Hz to 20 kHz. They are also used in breathalyzers. Despite the fact that Ultrasonic gas leak detectors don’t measure gas concentration. These detectors are commonly found on offshore and onshore oil/gas platforms. Semiconductor sensors are commonly used to detect hydrogen. Holographic Detectors Holographic gas Sensor use light reflection to detect changes in a polymer film matrix containing a hologram.[10] Because the sensor must come in contact with the gas in order to detect it. Tin dioxide is the most common material used in semiconductor sensors. the detector is able to determine the leak rate. which depends on the gas pressure and size of the leak. and harmful gases such as carbon monoxide. Since holograms reflect light at certain wavelengths a change in . The resistance of the tin dioxide is typically around 50 kΩ in air but can drop to around 3. [12] By measuring its ultrasonic sound level.

colorless gas. Household Safety There are many different sensors that can be purchased to detect hazardous gases around the house. It is an odorless. propane tanks. killing hundreds of people worldwide each year. making it impossible for humans to detect it. or any other combustible gas Regulator: .their composition can generate a colorful reflection indicative of the presence of a gas molecule[13]. Carbon monoxide detectors can be purchased for around $20-60. Carbon monoxide is a very dangerous gas that robs the lungs of oxygen. Holographic sensor require however illumination sources such as white light or lasers and an observer or CCD detector. butane tanks. Handheld flammable gas detectors can be used to trace leaks from natural gas lines.

It must have a heat sink for high current. Most power supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in India) to a safer low voltage. it is called monolithic voltage regulator. These regulators have: • • • • High performance (ideal 100% regulation) Low cost.10: REGULATOR CIRCUIT A discrete voltage regulator fabricated on a single chip. Usually monolithic voltage regulator is available as 3 terminals IC7805 as shown in below figure.FIG 4. By using this regulator circuit we are deriving 5v from 12v battery. The 3 terminals are denoted as IN (input). This +5V regulator is useful in power up to 500mw. COM (common). Easier to use. The input coil is called the primary and the output coil is called the secondary. Step-up transformers increase voltage. There is no electrical connection between the two coils. A 1mf high quality and tantalum capacitor should be placed from output to ground for stability. instead they are linked by an alternating magnetic field created in the soft-iron . Transformer: Transformers convert AC electricity from one voltage to another with little loss of power. Transformers work only with AC and this is one of the reasons why mains electricity is AC. OUT (output). Reduced size. step-down transformers reduce voltage.

Transformers waste very little power so the power out is (almost) equal to the power in. but this method is rarely used now that diodes are cheaper. Note that as voltage is stepped down current is stepped up. A single diode can be used as a rectifier but it only uses the positive (+) parts of the AC wave to produce halfwave varying DC Single Diode Rectifier: A single diode can be used as a rectifier but this produces half-wave varying DC which has gaps when the AC is negative.core of the transformer.4.12V) level. A full-wave rectifier can also be made from just two diodes if a centre-tap transformer is used. The transformer will step down the power supply voltage (0-230V) to (0. Then the secondary of the potential transformer will be connected to the bridge rectifier. Rectifier: There are several ways of connecting diodes to make a rectifier to convert AC to DC. which is constructed with the help of PN junction diodes.11: RECTIFYING CIRCUIT . It is hard to smooth this sufficiently well to supply electronic circuits unless they require a very small current so the smoothing capacitor does not significantly discharge during the gaps FIG. The bridge rectifier is the most important and it produces full-wave varying DC. The advantages of using bridge rectifier are it will give peak voltage output as DC.

the maximum voltage that . At this time D3 and D1 are forward biased and will allow current flow to pass through them. at point A and a negative potential at point B.4. the peak voltage from the centre tap to either X or Y is 500 volts.. In the conventional full-wave circuit. The negative potential at point B will forward bias D1 and reverse D2. and the output is taken from the remaining two corners.12: DIODE RECTIFIER WAVE DIAGRAM Bridge Rectifier: FIG. the positive potential at point A will forward bias D3 and reverse bias D4.FIG.4. Since only one diode can conduct at any instant. D4 and D2 are reverse biased and will block current flow. the circuit is called as bridge rectifier. One advantage of a bridge rectifier over a conventional full-wave rectifier is that with a given transformer the bridge rectifier produces a voltage output that is nearly twice that of the conventional full-wave circuit.13: BRIDGE RECTIFIER When four diodes are connected as shown in figure. Let us assume that the transformer is working properly and there is a positive potential. The input to the circuit is applied to the diagonally opposite corners of the network.

For example 6V RMS AC is rectified to full wave DC of about 4. For many circuits a ripple which is 10% of the supply voltage is satisfactory.6V RMS (1.4V smooth DC. With both circuits using the same transformer.14: SMOOTHING WAVE FORM Smoothing is not perfect due to the capacitor voltage falls a little as it discharges. Note that smoothing significantly increases the average DC voltage to almost the peak value (1. the maximum voltage that can be rectified is the full secondary voltage. Therefore. Voltage Regulators: .4. which is 1000 volts. supplying current to the output when the varying DC voltage from the rectifier is falling. FIG. A larger capacitor will give fewer ripples. the bridge rectifier circuit produces a higher output voltage than the conventional full-wave rectifier circuit. The maximum voltage that appears across the load resistor is nearly-but never exceeds-500 v0lts.can be rectified at any instant is 500 volts. with smoothing this increases to almost the peak value giving 1.4V is lost in the bridge rectifier). The capacitor value must be doubled when smoothing half-wave DC. and then discharges as it supplies current to the output. In the bridge rectifier shown in view B. giving a small ripple voltage. The capacitor charges quickly near the peak of the varying DC.6 = 6. Smoothing: Smoothing is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir. The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). the peak output voltage across the load resistor is nearly 1000 volts. as result of the small voltage drop across the diode.4 × RMS value).4 × 4.

a regulated dc output voltage. They are also rated by the maximum current they can pass. from a second terminal. Negative voltage regulators are available. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection'). 12 and 15V) or variable output voltages. a fixed negative voltage. or an adjustably set voltage. Vi. The series 78 regulators provide fixed positive regulated voltages from 5 to 24 volts. mainly for use in dual supplies. such as the 7805 +5V 1Amp regulator.Voltage regulators comprise a class of widely used ICs. They include a hole for attaching a heat sink if necessary. IC units provide regulation of either a fixed positive voltage.15: IC VOLTAGE REGULATOR Zener Diode Regulator: . A fixed three-terminal voltage regulator has an unregulated dc input voltage. FIG. Many of the fixed voltage regulator ICs has 3 leads and look like power transistors. and overload protection all in a single IC. with the third terminal connected to ground. comparator amplifier.4. Regulator IC units contain the circuitry for reference source. applied to one input terminal. control device. corresponding to power ratings from milli watts to tens of watts. the series 79 regulators provide fixed negative regulated voltages from 5 to 24 volts. IC Voltage Regulators: Voltage regulator ICs are available with fixed (typically 5. Vo. The regulators can be selected for operation with load currents from hundreds of milli amperes to tens of amperes. Similarly.

FIG. FIG. The resistor limits the current (like an LED resistor).3W). A diode rectifier then provides a full-wave rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage. is connected to a transformer. which steps down that ac voltage down to the level of the desired dc output.4. typically 220V.10 Power Supply: The ac voltage.16: ZENER DIODE REGULATOR 4..4.A regulator circuit removes the ripples and also retains the same dc value even if the input dc voltage varies.For low current power supplies a simple voltage regulator can be made with a resistor and a zener diode connected in reverse as shown in the diagram. so when there are no output current all the current flows through the zener diode and its power rating must be large enough to withstand this. This voltage regulation is usually obtained using one of the popular voltage regulator IC units. Zener diodes are rated by their breakdown voltage and maximum power (typically 400mW or 1. This resulting dc voltage usually has some ripple or ac voltage variation. or the load connected to the output dc voltage changes. The current through the resistor is constant.17 BLOCK DIAGRAM OF POWER SUPPLY .

computers and their peripherals. A power supply converting AC line voltage to DC power must perform the following functions at high efficiency and at low cost:  Rectification: Convert the incoming AC line voltage to DC voltage. these devices now comprise a worldwide segment of the electronics market in excess of $5 billion annually.  Voltage transformation: Supply the correct DC voltage level(s).FIG. e.  The DC/AC inverter.g. and instruments.  The AC/DC power supply. TV and hi-fi equipment. Since power supplies are so widely used in electronic equipment. Most of this equipment requires not only DC voltage but voltage that is also well filtered and regulated. Each has its own area of use but this paper will only deal with the first two. .  Filtering: Smooth the ripple of the rectified voltage..  Regulation: Control the output voltage level to a constant value irrespective of line. calculators. which are the most commonly used.4. is powered from a DC power source. be it a battery or a DC power supply. load and temperature changes.  Isolation: Separate electrically the output from the input voltage source. There are three types of electronic power conversion devices in use today which are classified as follows according to their input and output voltages:  DC/DC converter.18 CIRCUIT DIAGRAM OF POWER SUPPLY Virtually every piece of electronic equipment.

each diode must withstand twice the reverse voltage that a diode sees in a full-wave bridge for the same input voltage.4.19: REAL POWER SUPPLY HAS ERROR COMPARED TO IDEL POWER SUPPLY Linear Power Supplies: Two common linear power supply circuits in current are used. such as simplicity. The linear voltage regulator behaves as a variable resistance between the input and the output as it provides the precise output voltage. An ideal power supply would be characterized by supplying a smooth and constant output voltage regardless of variations in the voltage. However. The center-tapped configuration is preferred for low output voltages since there is just one diode voltage drop. which further increase power conversion efficiency. Both circuits employ full-wave rectification to reduce ripple voltage to capacitor C1. load current or ambient temperature at 100% conversion efficiency. FIG. Figure 1 compares a real power supply to this ideal one and further illustrates some power supply terms. provide back-up power or shutdown during a brown-out. One of the limitations to the efficiency of this circuit is due to the fact that the linear device must drop the difference in voltage between the input and output. Protection: Prevent damaging voltage surges from reaching the output. low . The bridge rectifier circuit has a simple transformer but current must flow through two diodes. While these supplies have many desirable characteristics. Consequently the power dissipated by the linear device is (Vi–Vo) x Io. Schottky barrier diodes are commonly used since they have lower voltage drops than equivalently rated ultra-fast types. For 5V and 12V outputs.

option setup make facility. excellent line and load regulation. Use μvision to create source files and organize them into a project that defines your target application. Introduction to Keil Compiler: When the Keil μVision is used.output ripple. The compiler and assembler process source files and create relocatable object files. C51 Compiler and A51 Macro Assembler: Source file created by μ vision IDE and passed to the C51 compiler macro assembler. fast response time to load or line changes and low EMI. they suffer from low efficiency and occupy large volumes. assembles and links your embedded application and provides a single focal point for your development efforts. and online help.μ vision automatically compiles. a rich featured editor with interactive error correction. The keil C51 compiler is a full ANSI implementation of the C programming language that supports all standard features of the C language. .  Create source file in C or assembly  Build application with the project manager  Correct errors in source file  Test the linked application μ Vision IDE: The μvision IDE combines project managements. the project development cycle is roughly the same as it is for any other software development project.

water absorption property. turning etc. dimensional stability etc. insulation resistance.The two main types of base laminate are epoxy glass and phenolic paper laminates are generally used for simple circuits.5 PCB DESIGN PCB design starts right from the selection of the laminates .2 PCB Fabrication: The fabrication of a PCB includes four steps. Transferring the pattern onto the PCB. coefficient of thermal expansion.CHAPTER 5 SYSTEM IMPLEMENTATION 5.e.) drilling. phenolic paper has poor electrical characteristics and it absorbs more moisture than epoxy glass.1 PCB Design: FIG. Finishing (i. smoothing. . shear strength. Developing the PCB. • • • • Preparing the PCB pattern. 5. The important properties that have to be considered for selecting the PCB substrate are the dielectric strength. Epoxy glass has highermechanicalstrength. hardness. Though it is very cheap and can easily be drilled. cutting.

the type of end terminal should be considered.2.1 Transferring the PCB Pattern: The copper side of the PCB should be thoroughly cleaned with the help of alcoholic spirit or petrol. The mirror image of the pattern must be carbon copied and to the laminate the complete pattern may now be made each resistant with the help of paint and thin brush. the mixture should be thoroughly stirred and a few drops of HCl may be added to speed up the process.2.5 grams of FeCl3 added to it.3 Finishing Touches: After the etching is completed. The board with its copper side facing upward should be placed in a flat bottomed plastic tray and the aqueous solution of FeCl2 poured in the etching process would take 40 to 60 min to complete. In this step. 5. 5. the copper side may be given a coat of varnish to prevent oxidation.the printed pattern should be clearly visible.2. After etching the board it should be washed under running water and then held against light . hole of suitable diameter should be drilled. then the PCB may be tin plated using an ordinary 35 Watts soldering rod along with the solder core. 5.2 Developing: In this developing all excessive copper is removed from the board and only the printed pattern is left behind. the area that each component would occupy.4 Drilling: . 5. The paint should be removed with the help of thinner. all interconnection between the components in the given circuit are converted into PCB tracks. Several factors such as positioning the diameter of holes.2. It must be completely free from dust and other contaminants.Pattern designing is the primary step in fabricating a PCB. About 100ml of tap water should be heated to 75 ° C and 30.

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

1 Applications:  Industries:  Domestic:  6.2 Advantages: 6.3 Future Enhancements: .CHAPTER 6 APPLICATIONS AND ADVANTAGES 6.


8051projects.1 Reference Books:  Muhammad Ali Mazidi –“THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS”   www.60) 8.2 Softwares:  Keil C51 compiler user guide (Keil Software .3 Web Links:       www.  Ayala. Pearson education.CHAPTER 8 BIBLIOGRAPHY  www.“INTRODUCTION TO 8051 MICROCONTROLLER” 8.

Sign up to vote on this title
UsefulNot useful