You are on page 1of 39


Automatic Ration Dispensing System presented here is an advanced system useful for the automatic & more efficient way of ration distribution. This project is designed to minimize the manual intervention in the process of ration distribution, so that more transparency & efficiency can be maintained.

The project consists of a User Card; based on a FLASH / E2PROM memory chip 9356 as user card & an automated system interfaced with a PC and material dispensing mechanism. The project is also equipped with a microcontroller unit for the ease of message display and for easy future enhancements in the project.

As shown in the Block diagram, the project consists of following sub-systems;

The system consists of a User Card reader connected to the system, into which the user card can be inserted. The card reader is connected to the system through the printer port. The P. C communicates with the Card through the printer port which is a versatile port through which the data can be inputted and outputted. The program is stored in the memory of the program. The system program is written in C language. The card consists of an EEPROM chip, which can be written & erased electrically. To store the information it is written and to retrieve it is read. The card is programmed serially. Logical unit (Computer): This unit is logical & processing unit i.e. computer. The system software or program is stored in the computer. The system or hardware unit is connected to the computer by a connector connected to the printer port. The various outputs from the hardware like memory card, Buzzer etc are all connected to this unit only. Buzzer Indication: This section consists of Piezo buzzer which sounds if we enter the wrong password. This section input is form P. C, the input signal is amplified and given to the buzzer. The buzzer operates on 9V power supply.

Material Dispensing Motors: These are normal DC used to control the dispensing mechanism of the project. They are typically of 12V rating and can be controlled with the aid of Darlington driver circuit.. Regulated Power supply: This section is very important section of the system as it feeds the power to all the sections. This section generates a 5V D.C source to supply all the I. Cs and circuits. This section consists of a step down transformer of 9V A.C, diode bridge rectifier, and filter capacitor and 5V regulator I. Cs. The output is 5V-regulated D.C for all the I.C s and unregulated 9V d. c is supplied to relay operating directly.

APPLICATIONS 1. The project can be used at the places where the automated ration distribution is required. 2. With certain modification the project can also be used for automated medicine dispensing.

ADVANTAGES 1. The project is fully automatic and easy to use, eliminating the man power 2. The project is based in advanced memory chip technology, thus enabling to to track & protect the database of the user. 3. With its centralized server connectivity the project can be made real time & thus helping resource management effectively.

Block Diagram of Automatic Ration Dispensing System:

Ration card (RFID card) Alarm unit for wrong pswd Printer

Card Reader

Container Sensor

PC (Central Display Unit) Microcontroller Unit

Max 232 Unit

Rs232 Cable

Driver Ckt Input Unit


This resulting dc voltage usually has some ripple or ac voltage variation.1. Circuit Diagram of Power Supply 2. This voltage regulation is usually ohtained using one of the popular voltage regulator 1C units. or the load connected to the output dc voltage changes. .1.2.1 Working Principle The AC voltage. typically 220V rms.1 CIRCUIT DIAGRAM Fig. A regulator circuit removes the ripples and also remains the same dc value even if the input dc voltage varies. is connected to a transformer. which steps that ac voltage down to the level of the desired DC output.CHAPTER 2 POWER SUPPLY UNIT 2. A diode rectifier then provides a full-wave rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage.

2 TRANSFORMER The potential transformer will step down the power supply voltage (0-230V) to (0-6V) level. One-half cycle later the polarity across the secondary of the transformer reverse. the circuit is called as bridge rectifier. through the secondary of the transformer back to point B. 2. through the secondary of T1. this path is indicated by the solid arrows. through D2.1.3 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 positive potential at point A will forward bias D3 and reverse bias D4. forward biasing D2 and D4 and reverse biasing Dl and D3. and back to point A.Figure 2. at point A and a negative potential at point B. The input to the circuit is applied to the diagonally opposite corners of the network. are reverse biased and will block current flow. up through RL. through D3. Then the secondary of the potential transformer will be connected to the precision rectifier. Current flow will now be from point A through D4. D4 and D2. The negative potential at point B will forward bias Dl and reverse D2.1. At this time D3 and Dl are forward biased and will allow current flow to pass through them. and the output is taken from the remaining two comers.2 Block diagram of power supply 2. . rest of the circuits will give only RMS output. Waveforms (1) and (2) can be observed across Dl and D3. The advantages of using precision rectifier are it will give peak voltage output as DC. up through RL. which is constructed with the help of op-amp. The path for current flow is from point B through Dl.

The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The maximum voltage that appears across the load resistor is nearly-but never exceeds-500 vOlts. In flowing through RL this current develops a voltage corresponding to that shown waveform (5).This path is indicated by the broken arrows. supplying current to the output when the varying DC voltage from the rectifier is falling. . the maximum voltage that can be rectified is the full secondary voltage. the peak output voltage across the load resistor is nearly 1000 volts.4 SMOOTHING CAPACITOR: Smoothing is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir. Therefore. and then discharges as it supplies current to the output. as result of the small voltage drop across the diode. the bridge rectifier circuit produces a higher output voltage than the conventional full-wave rectifier circuit. The current flow through RL is always in the same direction. The capacitor charges quickly near the peak of the varying DC. the peak voltage from the center tap to either X or Y is 500 volts. With both circuits using the same transformer. 2.1. Waveforms (3) and (4) can be observed across D2 and D4. In the bridge rectifier shown in view B. This may be shown by assigning values to some of the components shown in views A and B. The peak voltage developed between points X and y is 1000 volts in both circuits. assume that the same transformer is used in both circuits. Since current flows through the load (RL) during both half cycles of the applied voltage. 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. In the conventional full-wave circuit shown --in view A. this bridge rectifier is a full-wave rectifier. the maximum voltage that can be rectified at any instant is 500 volts. which is 1000 volts. Since only one diode can conduct at any instant.

with smoothing this increases to almost the peak value giving 1. applied to one input terminal.4V is lost in the bridge rectifier). C = Vs × f C= smoothing capacitance in farads (F) Io= output current from the supply in amps(A) Vs= supply voltage in volts(V). . Regulator 1C units contain the circuitry for reference source. The capacitor value must be doubled when smoothing half-wave DC. 1C units provide regulation of either a fixed positive voltage. giving a small ripple voltage.4V smooth DC. The regulators can be selected for operation with load currents from hundreds of milli amperes to tens of amperes.6V RMS (1. and overload protection all in a single 1C.6 = 6.4 × RMS value). Smoothing is not perfect due to the capacitor voltage falling a little as it discharges. comparator amplifier. A larger capacitor will give less ripple. this is the peak value of the unsmoothed DC f= frequency of the AC supply in hertz(Hz). corresponding to power ratings from milli watts to tens of watts. A fixed three-terminal voltage regulator has an unregulated dc input voltage.1. 5 × Io Smoothing capacitor for 10% ripple.Note that smoothing significantly increases the average DC voltage to almost the peak value (1. a fixed negative voltage.4 × 4. 50Hz in the UK 2. For many circuits a ripple which is 10% of the supply voltage is satisfactory and the equation below gives the required value for the smoothing capacitor. For example 6V RMS AC is rectified to full wave DC of about 4. Vi. or an adjustably set voltage. control device.5 IC VOLTAGE REGULATORS Voltage regulators comprise a class of widely used ICs.

7. We will discuss the transmit and receive pin first. The serial port contains a electronic chip called a Universal Asynchronous Receiver/Transmitter (UART) that actually does the conversion. The serial port is used to convert each byte to a stream of ones and zeroes as well as to convert a stream of ones and zeroes to bytes. but could be 5. how long does the signal stay in a particular state to define a bit.1 INTRODUCTION Serial communication is basically the transmission or reception of data one bit at a time. Electrically speaking. whenever the serial port sends a logical one (1) a negative voltage is effected on the transmit pin. The serial port has many pins. . if the line is operating at 9600 baud. the UART (serial port) first sends a START BIT which is a positive voltage (0). 6.CHAPTER 3 SERIAL COMMUNICATION 3. A byte contains 8 bits. The baud rate is the number of times the signal can switch states in one second. When no data is being sent. It is dependent on the baud rate. This means each bit has the duration of 1 '9600 of a second or about 100µsec.600 times per second. the line can switch states 9. Today's computers generally address data in bytes or some multiple thereof. Note that the serial port can also be forced to keep the transmit pin at a positive voltage (0) and is said to be the SPACE or BREAK state. When transmitting a byte. In other words. or 8 bits) followed by one or two STOP Bits which is a negative(l) voltage.1 Byte Transmission At this point you may want to know what the duration of a bit is. followed by the data (general 8 bits. Fig 3. Every character on this page is actually expressed internally as one byte. The answer is simple. the serial port's transmit pin's voltage is negative (1) and is said to be in a MARK state. Whenever the serial port sends a logical zero (0) a positive voltage is affected. Therefore. (The terms MARK and SPACE are also used to simply denote a negative voltage (1) or a positive voltage (0) at the transmit pin respectively). The sequence is repeated for each byte sent. A bit is basically either a logical 1 or zero. Figure shows a diagram of what a byte transmission would look like.

each character requires 10 bits to be transmitted for each character.When transmitting a character there are other characteristics other than the baud rate that must be known or that must be setup. mark. The above represents (Start Bit) (Data Bits) (Stop Bit). If SPACE parity. The binary representation of the letter 'A' is 01000001. the bit stream transmitted would be as follows for the line characteristics 8 bits. Remembering that bits are transmitted from least significant bit (LSB) to most significant bit (MSB). Half duplex serial communication needs at a minimum two wires. Half duplex means that the device cannot send and receive at the same time. We will expand the discussion to line protocol. The second characteristic is parity. and receive data line. space. In the case of the above example. Serial communication can be half duplex or full duplex. Full duplex communication means that a device can receive and transmit data at the same time. The parity characteristic can be even. The first characteristic is the length of the byte that will be transmitted. or none. It can do them both. but not at the same time. The above discussion was concerned with the "electrical/logical" characteristics of the data stream. signal ground. 1 stop bit and 9600 baud. up to 960 bytes can be transferred in one second. LSB (0100009101) MSB. This length in general can be anywhere from 5 to 8 bits. This specification defines several additional signals that are asserted (set to logical 1) for information and control beyond the data signal. then the last data bit transmitted will be a logical 1 if the data transmitted had an odd amount of 0 bits. If even parity. . then the last transmitted data bit will always be a logical 0. at 9600 baud. If MARK parity. The third characteristic is the amount of stop bits. Assume we want to send the letter A' over the serial port. then the last data bit transmitted will be a logical 1 if the data transmitted had an even amount of 0 bits. no parity. odd. Full duplex serial communication needs at a minimum three wires. This value in general is 1 or 2. then the last transmitted data bit will always be a logical 1. signal ground and the data line. Half duplex communication is all but outdated except for a very small focused set of applications. As such. These characteristics define the entire interpretation of the data stream. transmit data line. To calculate the actual byte transfer rate simply divide the baud rate by the number of bits that must be transferred for each byte of data. The RS232 specification governs the physical and electrical characteristics of serial communications. If no parity then there is no parity bit transmitted. If odd parity.

and signal ground. that most people don't realize anymore the origin of the phrase and that a null modem connection is an exception. . The benefit to this however is crisp and reliable flow control. Data Set Ready (DSR). instead to with the It re-asserts the RTS general it (logical can 0) its line when it A terminal flow that can no does the in DSR receive thing is when receive of again. when a device can no longer receive. In most situations. DTE means Data Terminal Equipment (computers etc. Request To Send (RTS). Handshaking can increase the maximum allowed communication speed because it gives the computers the ability to control the flow of information. Data Terminal Ready (DTR). the way a computer should communicate with a peripheral device like a modem.S232 Cabling describes these signals and how they are connected. asserted by modems to signal the phone ringing. The terminology null modem for the situation where two computers communicate directly is so often used nowadays. asserted by terminals to show their presence. practical solutions were developed to let two computers talk with each other using a null modem serial communication line. asserted by terminals if they can receive data. A modem in characters. Note that hardware flow control requires the use of additional wires. other Hardware flow when control to send is electronically CTS or when not longer same practice send data. One of the oldest and most widely spread communication methods in computer world.e. asserted by modems if they can receive data. The way this type of communication can be performed is pretty well defined in standards. This method requires a simple 3 wire serial communication link. asserted by modems to signal a successful connection to another modem.) where DCE is the abbreviation of Data Communication Equipment (modems). The section R. For your information. signal. One of the main uses of serial communication today where no modem is involved-a Serial Null Modem configuration with DTE/DTE communication-is not so well defined. 3. If using this method. Clear To Send (CTS). it will transmit a character that the two devices agreed on. receive data. The a method above that to two paragraph connected alluded devices to use hardware to tell drops it flow each control. Another method of flow control used is known as software flow control. This character is known as the XOFF character. asserted by modems to show their presence. not the rule. The standards show the use of DTE/DCE communication. transmit data. Another in the method previous hardware except control the perform same procedure paragraph and DTR signals are used for the handshake. I.2 AN INTRODUCTION TO NULL MODEM Serial communications with RS232. In history. the original modem signal lines are reused to perform some sort of handshaking. especially when it comes to flow control. Ring Indicator (RI). with one exception.These signals are the Carrier Detect Signal (CD).

4 NULL MODEM WITHOUT HANDSHAKING How to use the handshaking lines in a null modem configuration? The simplest way is to don't use them at all.A high amount of incoming data is allowed if the computer is capable to handle it. CTS are the answering signal coming from the DCE. a computer communicating with a modem device) RTS is an output on the DTE and input on the DCE. request to send and CTS. but not if it is busy performing other tasks. Modem speeds of 300 baud were common and 1200 baud was seen as a high speed connection. 3. In that situation. If the DCE cannot handle new requests.3 ORIGINAL USE OF RS232 When we look at the connector pin out of the RS232 port. 3. only the data lines and signal ground are cross connected in the null modem communication cable. If no How control is implemented in the null modem connection. This signal indicates the existence of a communication Jink between two modem devices. No information will be sent until the DCE grants permission by using the CTS line. It is not used directly for flow control. The assumption is that the DTE can always handle incoming information faster than the DCE can send it. communication is only possible at speeds at which it is sure the receiving side can handle the amount information even under worst case conditions.e. All other pins have no connection. we see two pins which are certainly used for flow control. With DTE/DCE communication (i. The last flow control signal present in DTE/DCE communication is the CD carrier detect. the CTS signal will go low. . A simple but useful mechanism allowing flow control in one direction. These two pins are RTS. this was true. Before sending a character. the DTE asks permission by setting its RTS output. In the past. but mainly an indication of the ability of the modem device to communicate with its counter part. An example of such a null modem cable without handshaking can be seen in the figure below. clear to send.

if either of the two devices checks the DSR or CD inputs. Communication links like present in the Norton Commander program can use this null modem cable.5 COMPATIBILITY ISSUES If you read about null modems. As you can imagine. As they are not connected. This causes the software to hang because no physical connection is present to either CTS line to make this possible.3. This might cause a problem. If the software on both sides is well structured. The same holds for the RTS/CTS handshaking sequence. This null modem cable can also be used when communicating with devices which do not have modem control signals like electronic measuring equipment etc. .Fig. Yes. it is simple but can we use it in all circumstances? There is a problem. The only way to perform flow control is with software flow control using the XOFF and XON characters. The only type of communication which is allowed on such a null modem line is data-only traffic on the cross connected Rx/TX lines. this three wire null modem cable is often talked about. their signal level will never go high. the RTS output is set high and then a waiting cycle is started until a ready signal is received on the CTS line. Null Modem without Handshaking 3.2. These signals normally define the ability of the other side to communicate. with this simple null modem cable no hardware flow control can be implemented. This does however not mean that this null modem cable is useless.

and the operation and support system (OSS).CHAPTER 4 GSM MODEM 4. not requirements.4.2 THE GSM NETWORK GSM provides recommendations. GSM Network Elements . The reason for this is to limit the designers as little as possible but still to make it possible for the operators to buy equipment from different suppliers. Fig. 4. The GSM specifications define the functions and interface requirements in detail but do not address the hardware.1 DEFINITION Global system for mobile communication (GSM) is a globally accepted standard for digital cellular communication. GSM is the name of a standardization group established in 1982 to create a common European' mobile telephone standard that would formulate specifications for a pan-European mobile cellular radio system operating at 900 MHz. The basic GSM network elements are shown in below figure. The GSM network is divided into three major systems: the switching system (SS).1. the base station system (BSS).

 1989. Writing and searching phone book entries.only about six to ten SMS messages per minute. The main difference between them is that a dial-up modem sends and receives data through a fixed telephone line while a wireless modem sends and receives data through radio waves. Like a GSM mobile phone.4 MILESTONES OF GSM  1982-Confederation of European Post and Telegraph (CEPT) establishes Group Special Mobile.  1987. MoU signed between 12 operators.  1985. writing and deleting SMS messages. an external GSM modem is connected to a computer through a serial cable or a USB cable. With the extended AT commands. A GSM modem in the form of a PC Card / PCMCIA Card is designed for use with a laptop computer. It should be inserted into one of the PC Card / PCMCIA Card slots of a laptop computer.Validation of system.4. computers use AT commands to control modems.TDMA chosen as Access Standard.  1986. A GSM modem can be an external device or a PC Card / PCMCIA Card.  1988. The number of SMS messages that can be processed by a GSM modem per minute is very low .3 GSM MODEM A GSM modem is a wireless modem that works with a GSM wireless network.  Reading. These extended AT commands are defined in the GSM standards.  Monitoring the signal strength. Typically. . 4. a GSM modem requires a SIM card from a wireless carrier in order to operate.Responsibility taken up ETSI  1990-First GSM specification released  1991-First commercial GSM system launched.Different field tests for radio technique for the common air interface. In addition to the standard AT commands. You can use a GSM modem just like a dial-up modem.  Monitoring the charging status and charge level of the battery.Adoption of list of recommendation to be generated by the group. GSM modems support an extended set of AT commands. you can do things like:  Reading. Both GSM modems and dial-up modems support a common set of standard AT commands.  Sending SMS messages. As mentioned in earlier sections of this SMS tutorial. A wireless modem behaves like a dial-up modem.

1200 Bit/s Data service (packet switched)  Synchronous: 2. security measurements. etc.  All services have to obey cellular functions. mandatory for all service providers.8 or 9.1 Frequency range of GSM 4.6 KBit/s  Asynchronous: 300-.6 SERVICES OF GSM Bearer Services Basic telecommunication services to transfer data b/w access points  Specification of services up to the terminal interface (corresponding to OSI layers 1-3)  Different data rates for voice and data (original standard) Data service (circuit switched)  Synchronous: 2.5 FREQUENCY RANGES OF GSM GSM works on 4 different frequency ranges with FDMA-TDMA and FDD.4.They are as follows.8 or 9.6 KBit/s  Asynchronous: 300 .9600 Bit/s  Additionally: signaling channels for connection control (used by telematic services) Tele Services  Telecommunication services that enable voice communication via mobile phones. 4. free of charge.4. connection . 4.1 kHz  _ Emergency number Common number throughout Europe (112).  Offered services:  Mobile telephony Primary goal of GSM was to enable mobile telephony offering the traditional bandwidth of 3. System Freq Uplink Freq Downlink P-GSM (Primary) 890-915MHz 935-960MHz E-GSM (Extended) 880-915MHz 925-960MHz GSM 1800 1710-1785MHz 1805-1880MHz GSM 1900 1850-1910MHz 1930-1990MHz Table 4.4.

implemented in the fixed network)  Short Message Service (SMS) Alphanumeric data transmission to/from the mobile terminal using the signaling channel. Message Handling System. countries and protocol Versions. . cannot be offered stand-alone  Similar to ISDN services besides lower bandwidth due to radio link  May differ between different service providers. thus allowing simultaneous use of basic services and SMS Supplementary Services  Services in addition to the basic services.with the highest priority (preemption of other connections possible)  _ Multinumbering Several phone numbers per user possible Non-Voice-Teleservices  Fax  Voice mailbox (implemented in the fixed network supporting the mobile terminals)  Electronic mail (MHS.

2 GSM architecture  Components  MS (mobile station)  BS (base station)  MSC (mobile switching center)  LR (location register)  Subsystems . Diagram for GSM architecture Fig.7 GSM ARCHITECTURE GSM is a PLMN (Public Land Mobile Network) several providers setup mobile networks following the GSM standard within each country.4. Important services  Identification: forwarding of caller number  Suppression of number forwarding  Automatic call-back  Conferencing with up to 7 participants  Locking of the mobile terminal (incoming or outgoing calls 4.

thus maximum capacity of a cell is 45 calls (+ 3 time slots for signaling). Base Transceiver Station (BTS)  Controls several transmitters  Each transmitter has 8 time slots. on a specific frequency  Maximum amount of frequencies and transmitters in a cell is 6. Network and Switching Subsystem  The backbone of a GSM network is an ordinary telephone network with some added capabilities  Mobile Switching Center (MSC)  An ISDN exchange with additional capabilities to support mobile communications  Visitor Location Register (VLR)  A database. RSS (radio subsystem): covers all radio aspects  NSS (network and switching subsystem): call forwarding. switching  OSS (operation subsystem): management of the network Base Station Subsystem  Transcoding Rate and Adaptation Unit (TRAD)  Performs coding between the 64 kpbs PCM coding used in the backbone network and the 13 kbps coding used for the Mobile Station  Base Station Controller (BSC)  Controls the channel (time slot) allocation implemented by the BTSes  Manages the handovers within the BSS area  Knows which mobile stations are within the cell and informs the MSC/VLR about this  Does now know the exact location of a MS before a call is made. handover. some used for signaling. part of the MSC  Contains the location of the active Mobile Stations .

g. including authentication information in Authentication Center (AuC)  Equipment Identity Register (EIR)  International Mobile Station Equipment Identity (IMEI) codes for e. blacklisting stolen phones. Home Location Register  One database per operator Contains all the permanent subscriber information  MSISDN (Mobile Subscriber ISDN number) is the telephone number of the subscriber  IMSI code is used to link the MSISDN number to the subscriber's SIM (Subscriber Identity Module)  International Mobile Subscriber Identity (IMSI) is the 15 digit code used to identify the subscriber  It incorporates a country and operator code  Charging information  Services available to the customer  Also the subscriber's present Location Area Code. Mobile Station  MS is the user's handset and has tv/o parts  Mobile Equipment  Radio equipment  User interface  Processing capability and memory required for various tasks  Encryption  SMS messages  Equipment IMEI number  Subscriber Identity Module Subscriber Identity Module  A small smart card  Encryption codes needed to identify the Subscriber  Subscriber IMSI number . which can connect to the MS. which refers to the MSC. Gateway Mobile Switching Center (GMSC)  Links the system to PSTN and other operators  Home Location Register (HLR)  Contains subscriber information.

8 SIMCOM SIM300GSM MODULE INTRODUCTON SIMCOM SIM300 module connects to the specific application and the air interface. As SIM300 can be integrated with a wide range of applications. DCS 1800 MHz and PCS 1900 MHz.g. Subscriber's own information (telephone directory)  Third party applications (banking etc. SIM300 is a Tri-band GSM/GPRS engine that works on frequencies EGSM 900 MHz. . all functional components of SIM300 are described in great detail. SIM300 features GPRS multi-slot class 10/ class 8 (optional) and supports the GPRS coding schemes CS-1. CS-2. PRODUCT CONCEPT Designed for global market. 4.)  Can also be used in other systems besides GSM. e. some WLAN access points accept SIM based user authentication Other Systems  Operations Support System  The management network for the whole GSM system  Usually vendor dependent  Very loosely specified in the GSM standards  Value added services  Voice mail  Call forwarding  Group calls  Short Message Service Center  Stores and forwards the SMS messages  Like an e-mail server  Required to operate the SMS service  The SMS service was initially used to notify the subscriber about new voicemail. CS-3 and CS-4.

turn on or off download function . CS-2. SIM300 features GPRS multi-slot class 10/ class 8 (optional) and supports the GPRS coding schemes CS-1. CS-3 and CS-4.85mm .3 EVB top view Designed for global market.Fig.0V SIM Tray Antenna with LED indications. SIM300 can fit almost all the space requirements in our applications. A: SIM300 module interface B: SIM card interface C: headset interface D: Download switch.With a tiny configuration of 40mm x 33mm x 2. Regulated power Supply 4. SIM300 is a Tri-band GSM/GPRS engine that works on frequencies EGSM 900 MHz.4. DCS 1800 MHz and PCS 1900 MHz. such as smart phone. PDA phone and other mobile devices. In this hardware SIM300 is only interfaced with RS232.

switch the voltage source from the adaptor or external battery F: PWRKEY key. such as keypad port.8 sec Off . turn on or turn off SIM300 G: RESET key H: expand port.3 sec Off .E: VBAT switch. AT command transmitting. main and debug serial port. display port I: MAIN serial port for downloading.SIM300 is not running 64ms On/ 0. data exchanging J: DEBUG serial port K: hole for fixing the antenna L: source adapter interface M: light N: buzzer O: headphones interface P: hole for fixing the SIM300 NETWORK STATUS INDICATION LED LAMP State SIM300 function Off .SIM300 does not find the network 64ms On/ 3 Sec Off .SIM300 find the network 64ms On/ 0.GPRS communication SIM CARD INTERFACE You can use AT Command to get information in SIM card. The SIM interface supports the functionality of the GSM Phase 1 specification and also supports the functionality of the new GSM Phase 2+ specification for FAST 64 kbps SIM (intended for use with a SIM application Tool- .

followed by a decimal parameter.g. The default terminator is the ENTER key <CR> character..4 SIM card interface AT Command Format A command line is a string of characters sent from a DTE to the modem (DCE) while the modem is in a command state. Characters within the command line are parsed as commands with associated parameter values.4.The SIM interface is powered from an internal regulator in the module having nominal voltage 2. “AT or “at. All pins reset as outputs driving low. “&” or “+”).kit). The command line interpretation begins upon receipt of the ENTER key character. i. Each command line (with the exception of the A/ command) must begin with the character sequence AT and must be terminated by a carriage return. 4.0V SIM Cards are supported. or single characters proceeded by a prefix character (e. Missing decimal parameters are evaluated as 0. and a terminator.. The basic commands consist of single ASCII characters.e.9 APPLICATIONS Access control devices . Characters that precede the AT prefix are ignored.8V. but both the A and T must be of the same case. Commands entered in upper case or lower cases are accepted. a body. Fig. A command line has a prefix.Both 1.8V and 3.

Supply Chain Management: Today SCM require huge IT infrastructure with leased lines. Complete log of transaction is available at the head-office Server instantly without any wiring involved and device can instantly alert security personnel on their mobile phone in case of any problem. The main benefit is that central server can be anywhere in the world. they can be connected through a serial cable. Transaction terminals: EDC machines. SENDING SMS MESSAGES FROM A COMPUTER USING A MOBILE PHONE OR GSM/GPRS MODEM: The SMS specification has defined a way for a computer to send SMS messages through a mobile phone or GSM/GPRS modem.Now access control devices can communicate with servers and security staff through SMS messaging. The actual way to use depends on the capability of the mobile phone or GSM/GPRS modem. The main difference is that a wireless modem transmits data through a wireless network whereas a dial-up modem transmits data through a copper telephone line. A wireless modem is similar to a dial-up modem. you can receive instant transaction data from all your branch offices. However. which is then connected to a computer. There are several ways to connect a mobile phone or GSM/GPRS modem to a computer. Most mobile phones can be used as a wireless modem. workstations and still you have large downtimes and high costs. This will be discussed in the section "Which is Better: Mobile Phone or GSM / GPRS Modem" later. a Bluetooth link or an infrared link. For . More information about GSM/GPRS modems will be provided in the section "Introduction to GSM / GPRS Wireless Modems". networking devices. RaviRaj Technologies is introducing this technology in all Fingerprint Access control and time attendance products. data centre. A GSM/GPRS modem is a wireless modem that works with GSM/GPRS wireless networks. POS terminals can use SMS messaging to confirm transactions from central servers. warehouses and business associates with nil downtime low cost. a USB cable. A central server in your head office with GSM capability is the answer. Today you need local servers in every city v/ith multiple telephone lines. You save huge infrastructure costs as well as per transaction cost. For example. first place a valid SIM card from a wireless carrier into a mobile phone or GSM/GPRS modem. To send SMS messages. some mobile phones have certain limitations comparing to GSM/GPRS modems. You can do all this at a fraction of the cost with GSM M2M technology.

it cannot connect to the computer through a Bluetooth link. In addition to this common set of standard AT commands. A terminal program's function is like this: It sends the characters you typed to the mobile phone or GSM/GPRS modem. After connecting a mobile phone or GSM/GPRS modem to a computer. mobile phones and GSM/GPRS modems support an extended set of AT commands. More details about the use of Microsoft HyperTerminal can be found in the "How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem" section of this SMS tutorial.example. if a mobile phone does not support Bluetooth. The instructions used for controlling the mobile phone or GSM/GPRS modem are called AT commands. you can control the mobile phone or GSM/GPRS modem by sending instructions to it. . (AT commands are also used to control dial-up modems for wired telephone system.) Dial-up modems. One use of the extended AT commands is to control the sending and receiving of SMS messages. mobile phones and GSM/GPRS modems support a common set of standard AT commands. It then displays the response it receives from the mobile phone or GSM/GPRS modem on the screen. The following table lists the AT commands that are related to the writing and sending of SMS messages: AT command +CMGS +CMSS +CMGW +CMGD +CMGC +CMMS Meaning Send message Send message from storage Write message to memory Delete message Send command More messages to send One way to send AT commands to a mobile phone or GSM/GPRS modem is to use a terminal program. The terminal program on Microsoft Windows is called HyperTerminal.

The lines in bold type are the command lines that should be entered in HyperTerminal. AT OK AT+CMGF=1 OK AT+CMGW="+85291234567" > A simple demo of SMS text messaging. which indicates the command line "AT+CMGF=1" has been executed successfully. If the response is "+CMGF: (0. The result code "OK" is returned (line 4). To confirm.1)" (0=PDU mode and 1=text mode). If the result code "ERROR" is returned. The GSM / GPRS modem sends back the result code "OK" (line 2). . it is likely that the GSM / GPRS modem does not support the SMS text mode.  Line 3: The AT command +CMGF is used to instruct the GSM / GPRS modem to operate in SMS text mode. The other lines are responses returned from the GSM / GPRS modem or mobile phone. which means the connection between the HyperTerminal program and the GSM / GPRS modem works fine. +CMGW: 1 OK AT+CMSS=1 +CMSS: 20 OK Here is a description of what is done in the above example:  Line 1: "AT" is sent to the GSM / GPRS modem to test the connection. type "AT+CMGF=?" in the HyperTerminal program. If the response is "+CMGF: (0)". then SMS text mode is not supported.Below shows a simple example that demonstrates how to use AT commands and the HyperTerminal program of Microsoft Windows to send an SMS text message. then SMS text mode is supported.

To send SMS messages from an application.the SMS transmission speed is low. you should press the Enter button of the keyboard. It indicates the location of the SMS text message in the message storage. Delphi or other programming languages you like. The GSM / GPRS modem will then return a prompt "> " and you can start typing the SMS text message "A simple demo of SMS text messaging. C++. You have to learn how to compose the bits and bytes of an SMS message. just like what a terminal program does. AT commands are not used for communicating with an SMS center or SMS gateway. an SMS application developer does not need to know AT commands and the composition of SMS messages in the bit-level.  Line 7: "+CMGW: 1" tells us that the index assigned to the SMS text message is 1.g. "+85291234567" is the recipient mobile phone number. The API / SDK / library encapsulates the low-level details. Line 13: The result code "OK" indicates the execution of the AT command +CMSS is successful. Line 10: The AT command +CMSS is used to send the SMS text message from the message storage of the GSM / GPRS modem. Java. However. When finished. Visual Basic.   Line 9: The result code "OK" indicates the execution of the AT command +CMGW is successful. press Ctrl+z of the keyboard. it has to handle a larger amount of SMS traffic and finally the mobile phone or GSM/GPRS modem will not be able to take the load.  Sending SMS messages with a mobile phone or GSM/GPRS modem has a drawback -. "1" is the index of the SMS text message obtained from line 7. As your SMS messaging application becomes more popular. In most cases. However. instead of writing your own code for interacting with the mobile phone or GSM/GPRS modem via AT commands. This means your have to make a big change to your SMS messaging application in order to move from a wireless-modem-based solution to a SMSC-based solution. You can write the source code in C. To obtain a high SMS transmission speed. a direct connection to an SMSC or SMS gateway of a wireless carrier or SMS service provider is needed. to specify the character encoding (e.". For example. Line 5 and 6: The AT command +CMGW is used to write an SMS text message to the message storage of the GSM / GPRS modem. a better solution is to use a high-level SMS messaging API (Application programming interface) / SDK (Software development kit) / library. you need to know which bits in the message header should be modified and what value should be assigned.   Line 11: "+CMSS: 20" tells us that the reference number assigned to the SMS text message is 20. 7-bit encoding and 16-bit Unicode encoding) of an SMS message. you have to write the source code for connecting to and sending AT commands to the mobile phone or GSM/GPRS modem. . After typing the recipient mobile phone number. So. writing your own code has a few disadvantages:   You have to learn how to use AT commands.

4.) Simple protocols such as HTTP / HTTPS can then be used for sending SMS messages in the application. Remember to check the list if you are going to use an SMS messaging API / SDK / library or an SMS gateway software package. e.Some SMS messaging APIs / SDKs / libraries support SMSC protocols in addition to AT commands. (This has been described in the section "What is an SMS Gateway?" earlier. Short Data Size You data size per transaction should be small like 1-3 lines. sales/purchase data. an SMS messaging API / SDK / library can be very helpful to you since it encapsulates the SMSC protocol's details.g. SMPP. If an SMSC protocol (e. GSM will be more cost-effective then other communication systems. banking transaction data. consignment tracking data. The links to some open source and free SMS messaging libraries can be found in the article "Free Libraries/Tools for Sending/Receiving SMS with a Computer". CIMD. You can also transfer faxes. Hence with negligible cost you are able to send critical information to your head office located anywhere in the world from multiple points. These small but important transaction data can be sent through SMS messaging which cost even less then a local telephone call or sometimes free of cost worldwide.9 APPLICATIONS SUITABLE FOR GSM COMMUNICATION If your application needs one or more of the following features.g. usually you just need to modify a configuration file / property file or make a few changes to your SMS messaging application's source code. updates. Multiple remote data collection points: . Another way to hide the low-level AT command layer is to place an SMS gateway between the SMS messaging application and the mobile phone or GSM/GPRS modem. large data through GSM but this will be as or more costly compared to landline networks. Usually a list of supported / unsupported mobile phones or wireless modems is provided on the web site of an SMS messaging API / SDK / library or an SMS gateway software package. etc) is used for communicating with the SMS gateway instead of HTTP / HTTPS. To move from a wireless-modem-based SMS solution to a SMSC-based SMS solution.

10 ADVANTAGES OF GSM OVER ANALOG SYSTEMS  Capacity increases  Reduced RF transmission power and longer battery life. You can just purchase the GSM hardware like modems. state. whereas one GSM connection is enough to handle hundreds of transaction per minute. leading to wider range of services .  Encryption capability for information security and privacy. Also in situations where you expect that someone may sabotage your communication systems by cutting wires or taping landlines. Also you can be mobile with GSM terminals and can also communicate with server using your mobile phone. insert SIM cards. warehouses. Mobility.  International roaming capability. country or worldwide you will benefit the most. you can depend on GSM. 4. GSM electronic terminals and Mobile phones. business associates. You can receive large number SMS messages on your server like e-mails without internet connectivity. GSM terminals. terminals and mobile handsets. Many a times some places like warehouses may be situated at remote location may not have landline or internet but you will have GSM network still available easily. GSM solutions can be implemented within few weeks whereas it may take many months to implement the infrastructure for other technologies. Quick installation GSM technology allows mobility. modems can be just picked and installed at other location unlike telephone lines. Large transaction volumes: GSM SMS messaging can handle large number of transaction in a very short time.If you have multiple data collections points situated all over your city. and agents with devices like GSM modems connected to PCs.  Compatibility with ISDN. Consider situation like shop owners doing credit card transaction with GSM technology instead of conventional landlines time you find local transaction servers busy as these servers use multiple telephone lines to take care of multiple transactions.  Better security against fraud (through terminal validation and user authentication). configure software and your are ready for GSM communication. High uptime If your business require high uptime and availability GSM is best suitable for you as GSM mobile networks have high uptime compared to landline. The data can be sent from multiple points like your branch offices. E-mails normally get delayed a lot but SMS messages are almost instantaneous for instant transactions. internet and other communication mediums.

have certainly improved the functional. hand-held communication devices. but also provides more flexibility 5. Remote Microcontrollers are single chip microcomputers. interrupt logic. Today. memory. operational and performance based specifications. serial ports.2 FEATURES • Compatible with MCS-51™ Products • 4K Bytes of In-System Reprogrammable Flash Memory – Endurance: 1. analog to digital converters (ADC). digital to analog converters (DAC).1 INTRODUCTION controllers. timers and counters. oscillator circuitry and many more functional blocks on chip. low power consumption. Microcontrollers have central processing unit (CPU).000 Write/Erase Cycles • Fully Static Operation: 0 Hz to 24 MHz • Three-level Program Memory Lock .CHAPTER 5 AT89C51 5. micro controllers have become an integral of all automatic and semi-automatic machines. more reliability and ease of integration within an application design. All these functional block on a single Integrated Circuit (IC). The usage of micro controllers not only reduces the cost of automation. I/O units. more suited for control and automation of machines and process. dedicated controllers. result into a reduced size of control board.

4 PIN CONFIGURATION .3 DESCRIPTION The AT89C51 is a low-power. high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). By combining a versatile 8-bit CPU with Flash on a monolithic chip. 5. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.• 128 x 8-bit Internal RAM • 32 Programmable I/O Lines • Two 16-bit Timer/Counters • Six Interrupt Sources • Programmable Serial Channel • Low-power Idle and Power-down Modes 5. The device is manufactured using Atmel’s high-density non-volatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out.

1 Pin configuration 5.5.Fig.5 BLOCK DIAGRAM .

5. . GND Ground.Fig.2. Block diagram 5.6 PIN DESCRIBTION VCC Supply voltage.

As inputs. During accesses to external data memory that use 8-bit addresses (MOVX @ RI). When 1s are written to port 0 pins. In this application. When 1s are written to Port 1 pins they are pulled high by the internal pull ups and can be used as inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull ups and can be used as inputs.0 RXD (serial input port) P3. Port 0 also receives the code bytes during Flash programming. Port 1 also receives the low-order address bytes during Flash programming and verification. As an output port. Port 3 also serves the functions of various special features of the AT89C51 as listed below: PORT PIN ALTERNATE FUNCTIONS P3. PORT 2 Port 2 is an 8-bit bi-directional I/O port with internal pull ups. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. As inputs.PORT 0 Port 0 is an 8-bit open-drain bi-directional I/O port. When 1s are written to Port 3 pins they are pulled high by the internal pull ups and can be used as inputs. and outputs the code bytes during program verification. The Port 3 output buffers can sink/source four TTL inputs.1 TXD (serial output port) P3. In this mode P0 has internal pull ups. PORT 1 Port 1 is an 8-bit bi-directional I/O port with internal pull ups. the pins can be used as high impedance inputs. Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. The Port 2 output buffers can sink/source four TTL inputs. Port 2 emits the contents of the P2 Special Function Register. Port 3 pins that are externally being pulled low will source current (IIL) because of the pull ups. each pin can sink eight TTL inputs. External pull ups are required during program verification. PORT 3 Port 3 is an 8-bit bi-directional I/O port with internal pull ups. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. As inputs.2 INT0 (external interrupt 0) . Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. The Port 1 output buffers can sink/source four TTL inputs. it uses strong internal pull ups when emitting 1s. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX @ DPTR).

except that two PSEN activations are skipped during each access to external data memory. EA should be strapped to VCC for internal program executions. EA will be internally latched on reset. that one ALE pulse is skipped during each access to external Data Memory. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. for parts that require 12-volt VPP. With the bit set. When the AT89C51 is executing code from external program memory. If desired.3 INT1 (external interrupt 1) P3. ALE operation can be disabled by setting bit 0 of SFR location 8EH.5 T0 (timer 0 external input) T1 (timer 1 external input) P3. 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. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency. EA/VPP External Access Enable.6 P3. PSEN is activated twice each machine cycle. ALE is active only during a MOVX or MOVC instruction. Otherwise.4 P3.P3. PSEN Program Store Enable is the read strobe to external program memory. however. however. ALE/PROG Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. Note.7 WR (external data memory write strobe) RD (external data memory read strobe) Port 3 also receives some control signals for Flash programming and verification. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. A high on this pin for two machine cycles while the oscillator is running resets the device. and may be used for external timing or clocking purposes. XTAL1 . RST Reset input. that if lock bit 1 is programmed. Note. the pin is weakly pulled high.

To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset. OSCILLATOR CHARACTERISTICS XTAL1 and XTAL2 are the input and output. It should be noted that when idle is terminated by a hard ware reset. respectively. On-chip hardware inhibits access to internal RAM in this event. the device normally resumes program execution. The mode is invoked by software. but minimum and maximum voltage high and low time specifications must be observed.Input to the inverting oscillator amplifier and input to the internal clock operating circuit. as shown in Figure 1. XTAL2 Output from the inverting oscillator amplifier. There are no requirements on the duty cycle of the external clock signal. of an inverting amplifier which can be configured for use as an on-chip oscillator. the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory. from where it left off. up to two machine cycles before the internal reset algorithm takes control. . IDLE MODE In idle mode. the CPU puts itself to sleep while all the on-chip peripherals remain active. Either a quartz crystal or ceramic resonator may be used. The idle mode can be terminated by any enabled interrupt or by a hardware reset. since the input to the internal clocking circuitry is through a divide-by-two flip-flop. XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. but access to the port pins is not inhibited. To drive the device from an external clock source.

5.3. C2 = 30 pF ± 10 pF for Crystals = 40 pF ± 10 pF for Ceramic Resonators Fig.External Clock Drive Configuration SOFTWARE TOOLS .Fig. Oscillator Connections Note: C1.4.5.

the compiler generates a listing file which may optionally include symbol table and cross reference. Keil software makes C compilers. .  Nine basic data types. bdata. the keil C51 compiler is the de facto industry standard and supports more than 500 current 8051 device variants.  Interrupt functions may be written in C. integrated environments. data. keil software offers development tools for ARM. since the market introduction in 1988. once compiled.1 KEIL C Keil software is the leading vendor for 8/16-bit development tools (ranked at first position in the 2004 embedded market study of the embedded system and EE times magazine). The C51 Compiler translates C source files into relocatable object modules which contain full symbolic information for debugging with the uVision Debugger or an in-circuit emulator. including 32-bit IEEE floating-point. Language extensions in the C51 Compiler give you full access to all resources of the 8051. The C51 Compiler allows you to write 8051 microcontroller applications in C that. macro assemblers. xdata. idata. simulators. ARM and XC16x/C16x/ST10 microcontroller families. In addition to the object file. It provides more features than any other 8051 C compiler available today. Keil software is represented worldwide in more than 40 countries.  Full use of the 8051 register banks.8. real-time kernels. The Keil C51 C Compiler for the 8051 microcontroller is the most popular 8051 C compiler in the world. have the efficiency and speed of assembly language. debuggers. Now.  Flexible variable allocation with bit. 251. and evaluation boards for 8051. and pdata memory types.

 Bit-addressable data objects.  Built-in interface for the RTX51 real time kernels.xC752 limited instruction sets.  Use of AJMP and ACALL instructions. . Complete symbol and type information for source-level debugging. and 8. 8xC751.  Support for the Infineon 80C517 arithmetic unit.  Support for the Philips 8xC750.