You are on page 1of 88

INTRODUCTION

AIM AND OBJECTIVE In some industries proper maintenance of the controlling system or industrial devices is crucial to deliver an uninterrupted output. So to reduce the maintenance costs and to optimize critical monitoring system GSM Based Industrial Automation Technology is used.

In this project a GSM server is implemented with PSOC mixed signal chip, sensors and relays. The GSM Modem can provide the necessary data related to industry to a maintenance officer located anywhere at any time. According to data received officer will take some action by sending some commands to PSOC chip through mobile unit to GSM modem. PSOC chip decodes the commands and controls the industrial devices through relays.

SCOPE OF THE PROJECT The scope includes connecting the different control systems to relays for controlling the environment. The PSOC microcontroller can be used for implementation of more complex systems for complex tasks like controlling different systems like nuclear plants and reactors in the industry. It can also be used in the system where there is a need of instrumentation, inverting and non inverting amplifiers.

AUTOMATION Automation or industrial automation is the use of control systems such as computers to control industrial machinery and processes, reducing the need for human intervention. In the scope of industrialization, automation is a step beyond mechanization. Whereas mechanization provided human operators with machinery to assist them with the physical requirements of work, automation greatly reduces the need for human sensory and mental requirements as well. Processes and systems can also be automated. Automation plays an increasingly important role in the global economy and in daily experience. Engineers strive to combine automated devices with mathematical and organizational tools to create complex systems for a rapidly expanding range of applications and human activities. Industrial automation is the process of controlling and guiding the industrial equipment, i.e. process and systems with less of the human intervention. The operation and control of the modern industrial equipment and process needs lot of sensors to monitor various parameters of the systems. Industrial automation is the process of controlling and guiding the industrial equipment, i.e. process and systems with less of the human intervention. The operation and control of the modern industrial equipment and process needs lot of sensors to monitor various parameters of the systems.
1

Importance of Automation Automation can improve productivity and quality. In order to receive these benefits, educating the workers on the machinery is necessary. Companies must contemplate their objectives of automating before incorporating any machinery. As factory automation technology becomes more capable, more functional and ubiquitous its meaning and purpose take on many interpretations. Factory automation delivers increased product and process information, and of course, improves product quality. Technology is used in so many ways and for so many different ends that it is almost impossible to have a single definition that includes all the solutions factory automation delivers. MVI's RPM system, in effect, documents the way a company manages its people. Its various data templates can be configured to address management and executive information needs. It presents real-time data that will help them to do something with the information and make an informed decision. System monitoring showed that unit costs varied by as much as 50 percent over the three daily shifts. Providing proper training to the operators led to increased productivity and a more consistent unit cost. Factory automation's capabilities are multi-faceted and provide answers to the questions asked of it. They have been forced to change from basic suppliers of parts, components or equipment to a take position where they help customers realize greater productivity, quality and a competitive edge from OEM purchases. Because there are fewer mechanical components, the OEM can deliver the press at a lower initial cost to the printer or publisher. While increased productivity is the clarion call for the OEM, end users must contend with a growing list of factory automation opportunities, a challenge for implementing successful factory automation. Among the initiatives that Siemens has started is one called Totally Integrated Power, or TIP, to better manage energy costs and save money It can also lead to decreased factory power outages and improve uptime. As with any powerful technology, consider your risk before you take action. Make sure you have a solid set of goals and objectives that meet your company's operating needs.
2

Context of the Project Monitoring of the Critical sensor monitoring is very important in several industries (Nuclear plants, power plants, petroleum and gas). This job should be done with at most accuracy and reliably. The sensor information should be available at various locations simultaneously to take accurate decisions. This kind of requirement can be met by using the central servers and connecting the sensor networks through the controllers to the central servers. Most of the systems require features which are given by web server kind of architecture on wireless. Authentication (of the person commanding). Port numbers for each connecting application. But the deployment of the web server is costly and complex to maintain. Maintaining the wireless network has issues. GSM network is readily available wireless secured network.

PROJECT SURVEY EXISTING TECHNOLOGIES Majority of the companies in INDIA have not implemented Automation practices in industry. Except few large industries majority of the companies cannot afford to invest huge amount of money in the existing costly setups to meet the requirements of Industrial Automation. Existing methods widely use the following technologies to communicate the information from one end to the other end of the company. Using Bluetooth -- But it is limited to short range. Using Zigbee/ IEEE802.15.4 -- Range is up to only few Kms maximum. Using Wi-Fi -- Requires costly equipment setup and high power consumption.

All the methods discussed above are quite expensive and complex to implement and not very reliable. The availability of information at various nodes simultaneously is not achieved.

Bluetooth Technology Bluetooth Technology is a radio frequency (RF)-based, short-range connectivity technology that promises to change the face of computing and wireless communication. It is designed to be an inexpensive, wireless networking system for all classes of portable devices. The projected cost of the Radio chip was around $5. A complete Bluetooth system will require these elements:
3

An RF portion for receiving and transmitting data includes short-range radio transceiver, external antenna, and a clock reference (required for synchronization) A module with a baseband microprocessor. Memory An interface to the host device (such as a mobile phone.

an

Its normal range of operation is 10m (at 1mW transmit power) and can be increased up to 100m by increasing the transmit power to 100mW. The system operate in unlicensed 2.4 GHz frequency band, hence it can be used worldwide without any licensing issues. It provides an aggregate bit rate of approximately 1Mbps.

Zigbee Technology The Zigbee radio specification designed for low cost and power consumption than Bluetooth. The specification is based on IEEE 802.15.4 standard. The radio operates in the same ISM band as Bluetooth and is capable of connecting 255 devices per network. The specification supports data rates of up to 250Kbps at a range of up to 30m. These data rates are slower than Bluetooth, but in exchange the radio consumes significantly with low power with a large transmission range. The goal of Zigbee is to provide radio operation for months or years without recharging, thereby targeting applications such as sensor networks and inventory tags.

Wi-Fi Technology Wi-Fi is the name given by the Wi-Fi Alliance to the IEEE 802.11 suite of standards. 802.11 defined the initial standard for wireless local area networks (WLANs). But because of its costly equipment setup and high power consumption this technology is not preferred.

PROPOSED TECHNOLOGY

WHAT IS GSM TECHNOLOGY? The GSM network that is run by China Mobile Communication Corp. provides reliable communication quality with nationwide coverage. Short message service (SMS) that is ideal for intermittent small packet data transmission has now become the most widely used value added service based upon GSM standard. Meanwhile, the decreasing cost of GSM network devices such as mobile phones and GSM module has made them an attractive option for other wireless communication applications. By utilizing GSM SMS and assigning a unique address (SIM card number) to each remote control unit, data and commands can be transmitted in the wireless communication network. This paper presents design and implementation of a distributed monitoring and centralized controlling system for prefabricated substations. The system
4

completely meets the demand of low cost and high level automation by introducing the microprocessor based RTUs and mobile communication technology. GPRS supports worlds leading packet based internet protocols that makes highly efficient use of radio spectrum and enables high data speed. It enables any exiting IP or X.25 application to operate over a GSM

cellular connection. Its data speed varies from 115Kbps to 117Kbps but it is likely to average at 56Kbps. It was developed to enable GSM operators to meet the following key features: It is a step towards 3G. Higher bandwidth and therefore data speed. Seamless, immediate and continues connection to the internetalways on-line. New text and visual data content services. Packet switched rather than circuit switched which enable higher radio spectrum efficiency.

Fig: 1 General architecture of GSM network.


5

SYSTEM BLOCK DIAGRAM

Fig: 2

COMPONENTS REQUIED
TOOLS USED Table-1

Sl no. 1. 2. 3. 4. 5. HARWARE USED Micro-controller-AT89S51:

Tools Power Supply Relay Driver Circuit Biasing Circuit Keypad Sensor Module

No. 1 1 1 2 3

AT 89S51 IS THE MICROCONTROLLER. IT IS THE BRAIN OF MY PROJECT.

The device is

manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry- standard 8051 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S51 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S51 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM,

32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry- standard 80S51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S51 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S51 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset. LCD One of the most common devices attached to an 8051 is an LCD display. Some of the most common LCDs connected to the 8051 are 16x2 and 20x2 displays. This means 16.16 characters per line by 2 lines and 20 characters per line by 2 lines, respectively. In recent years the LCD is finding widespread use replacing LEDs. This is due to the following reasons Declining prices Ability to display numbers, characters and graphics. Incorporation of a refreshing controller into the LCD. Ease of programming.

Fortunately, a very popular standard exists which allows us to communicate with the vast majority of LCDs regardless of their manufacturer. The standard is referd to as HD44780U, which refers to the controller chip which receives data from an external source (in this case, the 8051) and communicates directly with the LCD. The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus. If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines plus the 4 lines for the data bus). If an 8-bit data bus is used the LCD will require a total of 11

The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or other which are compatible with HD44580. In this tutorial, we will discuss about character based LCDs, their interfacing with various microcontrollers, various interfaces (8-bit/4-bit), programming, special stuff and tricks you can do with these simple looking LCDs which can give a new look to your application. An LCD display is specifically manufactured to be used with microcontrollers, which means that it cannot be activated by standard IC circuits. It is used for displaying different messages on a miniature liquid crystal display The model described here is for its low price and great capabilities most frequently used in practice. It can display messages in two lines with 16 characters each. It displays all the letters of English alphabet, Greek letters, punctuation marks, mathematical symbols etc. In addition, it is possible to display symbols made up by the user. Other useful features include automatic message shift (left and right), cursor appearance, LED backlight etc. An LCD screen consists of two lines each containing 16 characters. Each character consists of 5x7 dot matrix. GSM MODEM A GSM modem is a specialized type of modem, which accepts a SIM card, and operates over a subscription to a mobile operator, just like a mobile phone. From the mobile operator perspective, a GSM modem looks just like a mobile phone. A GSM modem can be a dedicated modem device with a serial, USB or Bluetooth connection, or it may be a mobile phone that provides GSM modem capabilities. A GSM modem could also be a standard GSM mobile phone with the appropriate cable and software driver to connect to a serial port or USB port on computer. Any phone that supports the "extended AT command set" for sending/receiving SMS messages, as defined in the ETSI GSM 07.05 Specification can be supported by the Now SMS/MMS Gateway. In the proposed system we have used SIMCOM SIM300 GSM module.

SIM300 is a Tri-band GSM/GPRS engine that works on frequencies EGSM 900 MHz, DCS 1800 MHz and PCS1900MHz. SIM300 provides GPRS multi-slot class 10 capability and support the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4.With a tiny configuration of 40mm x 33mm x 2.85 mm , SIM300 can fit almost all the space requirement in your application, such as Smartphone, PDA phone and other mobile device. The physical interface to the mobile application is made through a 60 pins board-to-board connector, which provides all hardware interfaces between the module and customers boards. The SIM300 is designed with power saving technique, the current consumption to as low as 2.5mA in SLEEP mode. The SIM300 is integrated with the TCP/IP protocol, Extended TCP/IP AT commands are developed for customers to use the TCP/IP protocol easily, which is very useful for those data transfer applications.

MAX 232 Level Converters Since the RS232 is not compatible with todays Microprocessors and Microcontrollers, we need a line driver or voltage converter to convert RS232s signals to TTL voltage levels. One example of such a converter is MAX 232 from Maxim corp. The MAX232 converter converts from RS232 voltage levels to TTL voltage levels and vice versa. One advantage of the MAX232 chip is that it uses a +5v power source, which is the same as the source voltage for the microcontroller. In other words, with a single +5v power supply we can power both the microcontroller and MAX232, with no need for the dual power supplies that are common in many older systems. The MAX 232 has two sets of line drivers for transferring and receiving data.

DEVLOPMENT ENVIROMENT:The following software development tools we used to develop this project Keil Microvision.2 Topwin Orcad 9.2

Keil Microvision.2 This Software is basically used for writing Assembly Language programming. 8051 Embedded C kit provides Keil uvision3 evaluation version along with the kit. This is an IDE that combines project management, make facilities, source code editing, program debugging and complete simulation under one powerful environment. u vision includes traditional features like simple and complex breakpoints, watch windows and execution control as well as sophisticated features like trace capture, execution profiler, code coverage and logic analyzer. The Vision Debugger provides a number of ways to display variables and program objects. What is an Assembler? An assembler is a software tool designed to simplify the task of writing computer Programs. It translates symbolic code into executable object code. This object code may then be programmed into a microcontroller and executed. Assembly language programs translate directly into CPU instructions which instruct the processor what operations to perform. Therefore, to effectively write assembly programs, you should be familiar with both the microcomputer architecture and the assembly language.
10

TOP win This software is generally used for writing the HEX file into the Microcontroller. So that the Microcontroller can work according to the user definable programming.

Fig: 3

Orcad 9.2 This is another type one that is specially used to draw the Hardware Circuit Diagram for the development of any project. ORCAD is a suite of tools cadence for the design and layout of printed circuit board (PCBs). This tutorial covers version 9.2 of the ORCAD suite. This document will give you a crash course in designing an entire circuit from start to finish. This is very small and simple circuit, but it will demonstrate the major concepts and introduce the tools behind completing a PCB design. After you have completed the tutorial, you will know all the steps needed to make PCBs using ORCAD. This is not, however, a guide to the inner working of the ORCAD interface. You should use this document in conjuction with the online RCADnd tutorial.

11

What is Microcontroller? Microcontroller is a 8 bit processer meaning that the central processing unit can work on only 8 bits of data at a time. 4K (4096) BYTES of on-chip ROM (program memory). 128 bytes of on-chip RAM (THAT IS DATA MEMORY). Two timers, one serial port and 4 ports each of 8 bits wide all available in a single chip.8051 Microcontroller has 4 register bank (bank0, bank1, bank2, bank3. Two multiple code, 16 bit timer/counters are used.1 microsecond instruction cycle with 12 MHZ crystals are used. It has direct byte and bit addressability. It is available with 40 pins IC and DIP. 8051 microcontroller has only one data type 8 bits. Size of each register is also 8 bits. It is the job of the programmer to break down data larger than 8 bits (00H TO FFH or 0 to 255 in decimal). The data type can be positive or can be negative. It has the properties of bit address. Many microprocessors allow the program to access register and I/O port in byte size only. But in many applications we have to check a single bit. One unique and power full operation of 8051 microcontroller is single bit operation. Single bit operation allows the programmer to set, clear, move and compliment individual bit of a port, memory, or register.

Fig: 4

It is registers, RAM, and I/O ports that need to be bit-addressable. ROM, holding program code for execution, is not bit addressable. It has four ports each of 8 bits P0, P1, P2 and P3.The AT89C51 has 4K bytes of programmable flash. The port P0 covers the pin 32 to pin 39, the port P1 covers the pin 1 to pin 8, the port P2 covers the pin 21 to pin 28 and the port P3 covers the pin 10 to pin 17. Pin 9 is the reset pin. The reset is active high. Whenever the controller is given supply, the reset pin must be given a high signal to reset the controller and bring the program counter to the starting address 0x0000. The controller can be reset by manually connecting a switch or by connecting a combination of resistor and capacitor as shown in the circuit diagram. A 12 MHz crystal is connected between pin 18 pin 19. Pin 40 is VCC and pin 20 is ground. Pin 31, is connected to VCC as we are using the internal memory of the controller.

12

Role of the microcontroller in this project. Security system Microcontroller will control the LCD initialization and select the data register and command . Memory is connected to microcontroller using two pins. GSM connect through max232 to information passes. For giving signal to relay buzzer circuit. Collect information from sensor and give back to the LCD.

Why we should choose Microcontroller why not Microprocessor? It is very clear from figure that in microprocessor we have to interface additional. Circuitry for providing the function of memory and ports, for example we have to interface external RAM for data storage, ROM for program storage, programmable peripheral interface (PPI) 8255 for the Input Output ports, 8253 for timers, USART for serial port. While in the microcontroller RAM, ROM, I/O ports, timers and serial communication ports are in built. Because of this it is called as system on chip. So in micro-controller there is no necessity of additional circuitry which is interfaced in the microprocessor because memory and input output ports are inbuilt in the microcontroller. Microcontroller gives the satisfactory performance.

Structure of microcontroller MICROCONTROLLER 8051 ARCHITECTURE: It is 8-bit microcontroller, means MC 8051 can Read, Write and Process 8 bit data. This is mostly used microcontroller in the robotics, home appliances like mp3 player, washing machines, electronic iron and industries. Mostly used blocks in the architecture of 8051 are as follows: 128 Byte RAM for Data Storage.MC 8051 has 128 byte Random Access memory for data storage. Random access memory is non volatile memory. During execution for storing the data the RAM is used. RAM consists of the register banks, stack for temporary data storage. It also consists of some special function Register(SFR) which are used for some specific purpose like timer, input, output ports etc.Normally microcontroller has 256 byte RAM in which 128 byte is used for user space which is normally register.

13

Fig: 5

14

PIN DIAGRAM

Fig: 6 Description of each pin is discussed here: VCC 5V supply VSS GND XTAL2/XTALI are for oscillator input Port 0 32 to 39 AD0/AD7 and P0.0 to P0.7 Port 1 1 to 8 P1.0 to P1.7 Port 2 21 to 28 P2.0 to P2.7 and A 8 to A15 Port 3 10 to 17 P3.0 to P3.7
15

P 3.0 RXD Serial data input SBUF P 3.1 TXD Serial data output SBUF P 3.2 INT0 External interrupt 0 TCON 0.1 P 3.3 INT1 External interrupt 1 TCON 0.3 P 3.4 T0 External timer 0 input TMOD P 3.5 T1 External timer 1 input TMOD P 3.6 WR External memory write cycle Active LOW P 3.7 RD External memory read cycle Active LOW RST for Restarting 8051 ALE Address latch enable 1 Address on AD 0 to AD 7 0 Data on AD 0 to AD 7 PSEN Program store enable

TECHNICAL SPECIFICATION: Voltage - 12V AC/DC Operating Current 225 MA Contact Rating - 230V AC INTERFACING WITH DIFFERENT MODULES Interface with GSM The project explains interfacing of the AT89C51 microcontroller with the GSM MODULE and the HyperTerminal. HyperTerminal is a Windows application. The AT commands are sent by the HyperTerminal to the GSM module. The Information Response and/or Result Codes are received at the microcontroller and retransmitted to the HyperTerminal by the controller. A GSM module has an RS232 interface for serial communication with an external peripheral. In this case, the transmit pin (Tx) of the computers Serial port is connected with the receive pin (Rx) of the GSM modules RS-232 interface. The transmit pin (Tx) of the RS-232 of GSM module is connected to receive pin
16

(Rx) of microcontrollers serial transmission pin. And the serial transmit pin of the microcontroller is connected to the receive pin of the computers Serial port. Therefore the commands and their results are transmitted and received in a triangular fashion as depicted below.

Fig: 7 [In subsequent projects (see MC075 & MC076), the HyperTerminal will be replaced by the microcontroller itself; thus avoiding the need of using a Computer to establish an interface. This would lead to an independent GSM based system.] The microcontroller is programmed to receive and transmit data at a baud rate of 9600. For more details on setting the baud rate of microcontroller, refer serial communication with 8051. The controller can receive data signals either by polling or by making use of serial interrupt (ES). Serial interrupt has been explained in interrupt programming. In polling, the controller continuously scans serial port for incoming data from the GSM module. In this project, interrupt has been used for monitoring and controlling the flow of data by the controller instead of the polling method. Interfacing with LED LEDs is by far the most widely used means of taking output. They find huge application as indicators during experimentations to check the validity of results at different stages. They are very cheap and easily available in a variety of shape, size and colors. The principle of operation of LEDs is simple. The commonly available LEDs have a drop voltage of 1.7 V and need 10 mA to glow at full intensity. The following circuit describes how to glow a led.

17

Fig: 8

The value of resistance R can be calculated using the equation, R= (V-1.7)/10 mA. Since most of the controllers work on 5V, so substituting V= 5V, the value of resistance comes out to be 330 ohm. The resistance 220 ohm, 470 ohm is commonly used substitute in case 330 ohm is not available. AT89C51 is a 40 pin microcontroller which belongs to 8051 series of microcontroller .LEDs is connected to the port P0. LEDs need approximately 10mA current to flow through them in order to glow at maximum intensity. However the output of the controller is not sufficient enough to drive the LEDs, so if the positive leg of the LED is connected to the pin and the negative to ground as shown in the figure, the LED will not glow at full illumination. To overcome this problem LEDs are connected in the reverse order and they run on negative logic i.e., whenever 1 is given on any pin of the port, the LED will switch off and when logic 0 is provided the LED will glow at full intensity. As soon as we provide supply to the controller, the LEDs start blinking i.e., they become on for a certain time duration and then become off for the same time duration. This delay is provided by calling the delay function. The values inside the delay function have been set to provide a delay in multiples of 100 millisecond delays (millisecond).

18

Interfacing of LCD: To interface this LCD with microcontroller, two registers (Input and Output register) are provided in the LCD. These registers are selected by the combination of RS and RW signals.

Fig: 9

Input Register: Input Register is used while giving instructions and writing data to LCD. It holds the data/instruction temporarily before writing to DDRAM (Data Display RAM). When the LCD is in active mode (CS1 and CS2 high), the Input register can be selected by sending bits on RS and RW pins as shown in the following table. The data of input register is latched in at the falling edge (from high to low) of EN (Enable) signal and written into DDRAM automatically through internal operation. Output Register:
19

Output Register is used to read data from DDRAM and to check status data (busy check). When the LCD is in active mode (CS1 and CS2 high), the Output register can be selected by sending bits on RS and RW pins as shown in the following table. When R/W and RS are high, data is latched into output register and when R/W=H, RS=L, status data (busy check) can be read out.

R/W

RS L

Function Send Instruction Data Write (From Input Register to DDRAM) Status Check (Busy Read) Data Read (From DDRAM to Output Register)

L H L H H Table-2 The basic operation with graphical LCD requires following steps: 1. 2. 3. 4. LCD Initialization Page Selection Column Selection Data Display

All these steps have been explained in the following sections with corresponding instruction sets. Ckt diagram of the LCD interfaced

Fig: 10
20

LCD Initialization Before displaying anything on graphics LCD, it must be initialized, i.e., display must be put on and column/page selection be made. This is achieved by giving proper instructions to the LCD. To make Display On\Off the following set of instructions must be followed in order:

a) Put these values in Data Register DB7 0 Table-3 Data appears when D=1 and disappears when D=0. When the display is off, there is no effect on the data which is stored in DDRAM. b) CS1=1,CS2=1(to activate display of both halves of LCD) c) RS=0, R/W=0 (to select the instruction mode) d) EN=1 e) Delay f) EN=0 (to latch data into the input register) Display on/off function can also be used to blink data continuously on the LCD by switching the display with some delay. 2. Page selection Before writing any data, the page of LCD must be selected. Page can be selected through following steps: a) Put these values in Data Register DB7 1 DB6 0 DB5 1 DB4 1 DB3 1
21

DB6 0

DB5 1

DB4 1

DB3 1

DB2 1

DB1 1

DB0 D

DB2 X3

DB1 X2

DB0 X1

Table-4 Since there are a total of 8 pages (07), a particular page is selected by setting three bits (X1-X3). b) CS1=1, CS2=1(to activate display of both halves of LCD) c) RS=0, R/W=0 (to select the instruction mode) d) EN=1 e) Delay f) EN=0 (to latch data into the input register) For example, if X3=0, X2=1 and X1=0, then the second page is selected. Reading or writing operation is done on this page until next page is set. Depending on the column selection, the page is selected from either left or right half of the graphics LCD. 3. Column selection There are 128 [64 (=26) columns per half] in graphics LCD and they are automatically incremented. This means that after selecting a column, it increases on its own by one, after each write cycle. So it is easier to write data column by column. A column can be chosen through following instructions: a) Put these values in Data Register DB7 0 Table-5 The corresponding controller (CS1 or CS2) is selected depending on the Column number as shown below. DB6 1 DB5 Y5 DB4 Y4 DB3 Y3 DB2 Y2 DB1 Y1 DB0 Y0

22

Fig: 11 b) RS=0, R/W=0 (to select the instruction mode) c) EN=1 d) Delay e) EN=0 (to latch data into the input register) For example, if Page address is 0 and Column address is 0, then 0th column of page 0 is selected, i.e., the first pixel will be selected which is highlighted in the following diagram. 4) Display data After page and column selection, data can be sent to LCD for display. The programming steps for display data are as given below: a) Put the data values in Data Register. With every write cycle, data is written in one column and the

column then gets auto-incremented. A high data bit (DBx = 1) corresponds to activated (dark) pixel and low data bit (DBx = 0) corresponds to deactivated (light) pixel. Here MSB corresponds to 8th row in column and LSB to 1st row of column. b) c) d) e) f) If column<63 then (CS1=1 & CS2=0) else (CS1=0 & CS2=1) RS=1 and R/W=0 (to select write mode of LCD) EN=1 Delay EN=0 (to latch data into the input register)

If data port is given value 0x99 or 10011001 then column takes the values as shown below. The following points can be included in above programming steps for efficient programming: 1. While sending data to be written with array, one can specify the array limit as well. This limit

signifies the number of columns one wants to write at once. If the limit is 8, eight columns will be written at once and if it is 7, seven columns will be written in one go. 2. The condition if (column >127) can be used to return the control back to the main function if the The function for setting column should be called again if array limit condition doesnt fit in left page

limit exceeds the number of columns present in the LCD. 3.

and has to be extended to right page too.

23

4.

Though column address increases itself by one but one variable should be taken to check the

conditions (ii) & (iii) explained above. To use above functions, a simple experiment can be done to display alphabetic characters in different fonts. Here, the alphabet A is being displayed in different fonts. These shapes can be displayed by using their corresponding bitmap values shown in the above diagram. The connection of graphical LCD with AT89C52 is shown in circuit diagram. Also learn to display text/string and display image on Graphics LCD.

Interfacing of memories: EEPROM stands for electrically erasable programmable read only memory. It is a secondary storage device that once written (programmed) can hold data even when the power is removed. The EEPROM is a class of read only memory that can be electrically erased and reprogrammed. AT24C02 is a two wire 2Kbits serial EEPROM by Atmel. The memory is organized in 256 words of single byte each arranged in 32 pages of 8 bytes each. The addressing of memory locations requires eight bit addresses. AT24C02 is two-wire serially programmable i.e., for programming, the data and control signals are provided serially along with clock signals from the other wire. The read-write operations are accomplished by sending a set of control signals including the address and/or data bits. The control signals must be accompanied with proper clock signals. The AT24C02 has hard wire addressing of 3 bit length. This facilitates interfacing of a maximum of eight (23) 24C02 devices to a system thereby, incorporating a maximum 16Kbits memory. Multiple 24C02 devices can be connected to a microcontroller/microprocessor based system using I2C interface. The project demonstrates interfacing of a single 24C02 IC with AT89C51 (8051) microcontroller. Simple analog communication over the telephone wires to the typical USB cables for data exchange, we surely have come a long way in the field of communication. RS232 was the first milestone reached in this journey. It was a standard for electromechanical typewriters and modems for digital data exchange introduced in 1962 by the Radio Sector of EIA. It made the data exchange more reliable over analog channel. The standard defined voltage levels that made it immune to noise disturbances and reduced the error in data exchange. As the technology was growing many electronic devices were being developed during this time like computers, printers, test instrument etc. There came a time where manufacturers felt the need to exchange information between these electronic devices. For example data exchange between a computer and a printer or two computers. But there was no standard or method to accomplish this task. RS232 was the only available standard at the time which was used for data exchange. So, they thought of adopting this standard in electronic devices for digital communication

24

Memory An interface to the host device (such as a mobile phone).Its normal range of operation is 10m (at 1mW transmit power) and can be increased up to 100m by increasing the transmit power to 100mW. The system operate in unlicensed 2.4 GHz frequency band, hence it can be used worldwide without any licensing issues. It provides an aggregate bit rate of approximately 1Mbps. These memory devices are used to store the data for off line process. The AT24C02A provides 2048bits of serial electrically erasable and programmable read only memory (EEPROM) organized as 256words of 8 bits each. The device is optimized for use in many industrial and commercial applications where low power and low voltage operation are essential. The AT24C02A is available in space saving 8-pin PDIP.

POWER SUPPLY
The microcontroller and other devices get power supply from AC to Dc adapter through 7805, 5 volts regulator. The adapter output voltage will be 12V DC non-regulated. The 7805/7812 voltage regulators are used to convert 12 V to 5V/12V DC.

AC Power

AC/DC Adapter

Regulator (7805)

Filter
DC Output

Fig: 12

REGULATED POWER SUPPLY:

230 AC I/P Transformer Rectifier smoothing regulator

REGULATED 5V

Fig: 13

25

Components of Power Supply: SI NO 1. 2. 3. 4. 5. Table-6 Function of each block is described in more detail below: 1-Transformer steps down high voltage AC mains tow low voltage AC. 2-Rectifier converts AC to DC, but the DC output is varying. 3-Smoothing smoothes the D C from varying greatly to a small ripple. 4-Regulator eliminates ripple by setting DC output to fixed voltage. COMPONENTS USED Transformer Rectifier Capacitor Voltage Regulator Resistor TYPE 230V AC,RATING-18 V,1 AMP Bridge Rectifier Electrolytic 7805 , 7812 NOS USED 1 1 2 2 1

Fig: 14

26

VITAL ROLE OF POWER SUPPLY IN GSM BASED MANUFACTURING INDUSTRIAL AUTOMATION PROJECT The adapter output voltage will be 12V DC non-regulated. The 7805/7812 voltage regulators are used to convert 12 V to 5V/12V DC.

Fig: 15

Breaking this system down , we will first look at the ac voltage change and ac to dc conversion. Then, we will look at some simple dc regulation circuitry.

TRANSFORMER Transformer steps down high voltage AC (230 v ac) mains to low voltage AC.(18 v ac) Transformer rating is 18v,1 AMP In a rectifier, a center -tapped transformer and two diodes can form a full-wave rectifier that allows both half-cycles of the AC waveform to contribute to the direct current, making it smoother than a half-wave rectifier. Center-tapped transformers are also used for dual-voltage power supplies.

Center tapped transformer is used when the output DC current is high and the output voltage is low. Center tap is a connection made to a point halfway along a winding of a transformer.

Center-tapped transformers are also used for dual-voltage power supplies. When a center-tapped transformer is combined with a bridge (four diode) rectifier, it is possible to produce a positive and a negative voltage with respect to a ground at the tap. Dual voltage supplies are important for all sorts of electronics equipment.

27

Fig: 16

Fig: 17

RECTIFIER A rectifier is an electrical device that converts AC which periodically reverses direction to DC which flows in only one direction .Here, we have used bridge rectifier since low voltage AC (output of transformer) is not suitable for electronic circuit unless they include a rectifier and smoothing capacitor. Bridge rectifier produces full wave varying DC.A full wave rectifier can also be made from just two diodes if centre tapped transformer is used, but it is available in special packages containing the four diodes required. It is called a full wave rectifier because it uses the entire AC wave (both positive and negative section). 1.4 volt is used up in the bridge rectifier because each diode uses 0.7 volt when conducting and there are always two diode conducting. The maximum current they can pass rates bridge rectifiers and the maximum reverse voltage they can withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand the peak voltages).
28

Fig: 18 ELECTROLYTE CAPACITOR (SMOOTHING UNIT) Capacitors are used in power supply filter networks. The capacitors smooth out the bumpy AC to DC. Smoothing is performed by a large value electrolyte capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying dc voltage from the rectifier is falling. The diagram shows the unsmoothed varying dc and the smoothed DC. The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output.

Smoothing capacitor for 10% ripple, C= 5 * Io/Vs * f C=smoothing capacitor in farads (F) Io=output current from the supply in amps (A) Vs=supply voltage in volts, this is peak value of the unsmoothed DC f = frequency of AC supply in hertz

29

Fig: 19 The output from the transformer and rectifiers follows the sin waveform. The smoothing capacitor fills in the low voltage portions, so reducing the ripple voltage amplitude. The larger the capacitor (for a given load), the smaller the ripple voltage, but the higher the peak current through the rectifiers.

Fig: 20

VOLTAGE REGULATORS Because most circuits have been designed to only work with a very specific voltage level changes could greatly affect how the circuit works. To ensure that the output voltage of a power supply is always the same (regardless of the changes of input voltage and Load resistance) a Voltage Regulator is used .It is a semiconductor device that converts an input DC voltage to a fixed output DC voltage A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level .We have used 7805 and 7812 voltage regulators. These two come from 78xx family of self contained fixed linear voltage regulators. The 78xx line are positive voltage regulators, meaning that they are designed to produce a voltage that is positive relative to a common ground. Many of the fixed voltage regulator ICs has 3 leads and look like power transistors, such as 7805 regulator. They include a hole for attaching a heat sink if necessary. The 7805 IC is designed for a fixed voltage output of 5V and 7812 IC for a fixed voltage output of 12V.These have built in current limiting, thermal
30

shutdown, and safe operating area protection which makes them virtually immune to damage from output overloads.

Fig: 21

Fig: 22

fig: 23

fig: 24

31

Fig: 25

RELAY MODULE SI NO 1. 2. 3. 4. 5. Table-7 COMPONENTS USED Relay Transistor Diode Resistor Buzzer Piezoelectric Buzzer TYPE Electromechanical relay NPN Transistor Freewheeling diode NOS USED 1 1 2 1 1

Fig: 26

32

WHAT IS A RELAY? Relays are electromagnetically operated switches. An actuating current on a coil operates one or more galvanically separated contacts or load circuits.

HOW A RELAY WORKS?

Fig: 27

Current flowing through the coil of the relay creates a magnetic field which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two switch positions and most have double throw (changeover) switch contacts as shown in the diagram below

Fig : 28
33

Relays allow one circuit to switch a second circuit which can be completely separate from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit. There is no electrical connection inside the relay between the two circuits; the link is magnetic and mechanical. The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can be as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips) cannot provide this current and a transistor is usually used to amplify the small IC current to the larger value required for the relay coil. The maximum output current for the popular 555 timer IC is 200mA so these devices can supply relay coils directly without amplification. Relays are usually SPDT or DPDT but they can have many more sets of switch contacts, for example relays with 4 sets of changeover contacts are readily available.

Fig : 29 The animated picture shows a working relay with its coil and switch contacts. You can see a lever on the left being attracted by magnetism when the coil is switched on. This lever moves the switch contacts. There is one set of contacts (SPDT) in the foreground and another behind them, making the relay DPDT. ELECTROMECHANICAL RELAY The electromechanical relay is a remote controlled switch capable of switching multiple circuits either individually , simultaneously or in sequence. In this relay the switching element is a mechanical contact actuated by an electromagnet. The principal internal function of the electromechanical relay are: i. ii. iii. iv. Conversion of electrical current to a magnetic field. Conversion of the magnetic field into a mechanical force. This force operates the contact. Contacts switch and conduct electrical current.
34

Fig : 30

RELAY DRIVER CIRCUIT The relay operates at 12V and the microcontroller operates at 5V.when the coil energization is switched off ,a very high negative peak voltage is produced by the coil and it may reach more than 10-20 times the nominal coil voltage. And this cuurent will reach the microcontroller and cause damage to it. Inorder to protect the microcontroller from damage ,a relay driver circuit is provided.The main function of the relay driver circuit is to provide necessary current to the microcontroller and to energize the relay coil.

MCU CAN NOT DIRECTLY DRIVE RELAYS. SO WE NEED DRIVER CIRCUIT. DRIVER CIRCUIT IS USED TO DRIVE 4 CHANNEL RELAY. BC 547 IS USED IN DRIVER CIRCUIT. IF THE TRANSISTOR CONDUCTS THEN IT WILL OPERATE THE RELAY. THE TRANSISTOR WILL CONDUCT DEPENDS UPON THE MICROCONTROLLER SIGNAL.

Fig : 31
35

WE ARE USING 4 NOS. OF SPDT RELAYS o IT HAS 5 PIN. o IT WILL OPERATE ON 12V DC. o THE MAIN USE OF RELAY SECTION IS TO CONTROL 230 V AC. CIRCUIT DIAGRAM

Fig : 32

FLYWHEEL DIODES Normally DC relays are operated through semiconductor devices. due to the inductance of the coil ,high voltage peaks are induced9in the form of back emf) when the coil supply is switched off. To protect the relay control transistors against this surge voltage, protection in the form of flywheel diodes is provided. The diodes are connected parallel to the coil in reverse polarity to the coil supply. While discharging the back emf flywheel diode provides a low resistance path protecting the driving circuit. The back emf dies gradually by forming loops.

36

NPN TRANSISTOR Here the transistor operates as a switch .To operate the transistor as a switch ,the transistor needs to be turned either fully OFF(cut off) or fully ON(saturated).In practise ,when the transistor is turned OFF small leakage current flow through the transistor and when fully ON the device has a low resistance value causing a small saturation voltage(VCE) across it.

Fig : 33 In order the base current to flow, the base input terminal must be made more positive than the emitter by increasing it above 0.7 volts needed for a silicon device. By varying this base emitter voltage VBE, the base current is also altered and which in turn controls the amount of collector current flowing through the transistor. When maximum collector current flows the transistor is said to be saturated. The value of the base resistor determines how much input voltage is required and corresponding base current to switch the transistor fully ON. The transistor is driven into saturation(turned on) when a logic 1 is written on the port pin thus turning ON the relay.

RESISTORS When relays are controlled by semiconductor such as transistors, they require some type of voltage suppression device .Solid state circuits are vulnerable to voltage spikes. Voltage spikes slam against transistor destroying them. High ohm resistors are used instead of diodes. A resistor is more durable than a diode and can suppress voltage spikes similar to a diode but the resistor will allow current to flow through it whenever the relay is ON. Therefore, the resistance of the resistor must be fairly high inorder to prevent too much current flow in the circuit.

PIEZOELECTRIC BUZZER We have used a piezoelectric buzzer in our project. Early devices were based on an electromechanical system identical to an electric bell without the metal gong. Similarly, a relay may be connected to interrupt
37

its own actuating current, causing the contacts to buzz. Often these units were anchored to a wall or ceiling to use it as a sounding board. The word "buzzer" comes from the rasping noise that electromechanical buzzers made. Here we use this mechanical buzzer for the information that the password is wrong. The buzzer gives the sound only when the password is typed three times in the wrong way. WORKING OF A PIEZOELECTRIC BUZZER When a small DC voltage is applied to the input pins, it is first connected to an oscillating signal using the combination of resistor and transistor. These oscillating signals are amplified using the inductor coil. When the high voltage alternating signals are applied to the piezoelectric ceramic disc ,it causes mechanical expansion and contraction in radial direction. This causes the metal plate to bend in opposite direction. When metal plate bends and shrinks in opposite direction continuously it produces sound waves in the air.

Fig :33

This is the opposite side of the PCB having the necessary electronic components: :resistor, a transistor and an inductor. The input to the transistor is a low voltage DC signal, however inorder to produce sound the piezoceramic disc needs oscillations of high voltage. The transistor and resistor combination works as an oscillator circuit to produce low amplitude oscillations from the DC voltage .The magnitude of these oscillation is amplified by the inductor.

38

Fig:35 . The red lead is connected to the input the black lead is connected to ground. . KEYPAD We are using 8 keypad push button switches. This section is connected to P1 of Microcontroller. This section is the INPUT device, which is used for giving password to devices. Here we are using 8 serial keys to microcontroller.

Fig :36 LCD(LIQUID CRYSTAL DISPLAY) One of the most common devices attached to an 8051 is an LCD display. Some of the most common LCDs connected to the 8051 are 16x2 and 20x2 displays. This means 16.16 characters per line by 2 lines and 20 characters per line by 2 lines, respectively. In recent years the LCD is finding widespread use replacing LEDs. This is due to the following reasons
39

1. Declining prices 2. Ability to display numbers, characters and graphics. 3. Incorporation of a refreshing controller into the LCD. 4. Ease of programming. Fortunately, a very popular standard exists which allows us to communicate with the vast majority of LCDs regardless of their manufacturer. The standard is referred to as HD44780U, which refers to the controller chip which receives data from an external source (in this case, the 8051) and communicates directly with the LCD. The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus. If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines plus the 4 lines for the data bus). If an 8-bit data bus is used the LCD will require a total of 11.

The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or other which are compatible with HD44580. In this tutorial, we will discuss about character based LCDs, their interfacing with various microcontrollers, various interfaces (8-bit/4-bit), programming, special stuff and tricks you can do with these simple looking LCDs which can give a new look to your application. An LCD display is specifically manufactured to be used with microcontrollers, which means that it cannot be activated by standard IC circuits. It is used for displaying different messages on a miniature liquid crystal display. The model described here is for its low price and great capabilities most frequently used in practice. It can display messages in two lines with 16 characters each. It displays all the letters of English alphabet, Greek letters, punctuation marks, mathematical symbols etc. In addition, it is possible to display symbols made up by the user. Other useful features include automatic message shift (left and right), cursor appearance, LED backlight etc. An LCD screen consists of two lines each containing 16 characters. Each character consists of 5x7 dot matrix.

PIN DESCRIPTION The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters, whereas LCDs supporting more than 80 characters make use of 2 HD44780 controllers. 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). Pin description is shown in the table below.

40

Pin No. Pin no. 1 Pin no. 2 Pin no. 3 Pin no. 4 Pin no. 5 Pin no. 6 Pin no. 7 Pin no. 8 Pin no. 9 Pin no. 10

Name D7 D6 D5 D4 D3 D2 D1 D0 EN1 R/W

Description Data bus line 7 (MSB) Data bus line 6 Data bus line 5 Data bus line 4 Data bus line 3 Data bus line 2 Data bus line 1 Data bus line 0 (LSB) Enable signal for row 0 and 1 (1stcontroller) 0 = Write to LCD module 1 = Read from LCD module 0 = Instruction input 1 = Data input Contrast adjust Power supply (GND) Power supply (+5V) Enable signal for row 2 and 3 (2ndcontroller) Not Connected

Pin no. 11

RS

Pin no. 12 Pin no. 13 Pin no. 14 Pin no. 15 Pin no. 16 Table-8 Enable

VEE VSS VCC EN2 NC

The EN line is called "Enable." This control line is used to tell the LCD that you are sending it data. To send data to the LCD, your program should make sure this line is low (0) and then set the other two control lines and/or put data on the data bus. When the other lines are completely ready, bring EN high (1) and wait for the minimum amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.

Register select The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is
41

text data which should be displayed on the screen. For example, to display the letter "T" on the screen you would set RS high.

Read/Write(R/W) The RW line is the "Read/Write" control line. When RW is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are write commands--so RW will almost always be low. Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7. Above is the quite simple schematic. The LCD panel's Enable and Register Select is connected to the Control Port. The Control Port is an open collector / open drain output.

Fig :37 Connecting an LCD to a micro controller is very simple, requiring either bit or an 8-bit bus. A 4-bit interface saves I/O pins but requires that the command and data be split into 4-bit pieces, which are sent one after the other. Thus the saving in I/O lines comes at the price of more complicated software. To simplify understanding of the software the example uses a 8-bit interface. Three control lines are required in addition to the data line. The voltage at the V0 pin adjusts the contrast of the display. Normally this voltage is provided by an adjustable voltage divider.
42

CIRCUIT DIAGRAM

Fig :38

WORKING AND PRODUCT COUNT


In working and production count three sensors module are used. SL.NO COMPONENTS IR LED 1 2 3 4 5 6 Photo transistor Variable resistor 555 timer Resistor Capacitor NO. 1 1 1 1

Table-9
43

SENSOR MODULE Light Sensor (worker count): We are using two sensor modules, used for counting numbers of worker of the industry. LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. Normally the resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but when they are illuminated with light resistance drops dramatically. A Light Dependent Resistor ( LDR, photoconductor, or photocell) is a device which has a resistance which varies according to the amount of light falling on its surface.

Fig :39

A typical light dependent resistor is pictured above together with (on the right hand side) its circuit diagram symbol. Different LDR's have different specifications, however the LDR's we sell in the REUK Shop are fairly standard and have a resistance in total darkness of 1 MOhm, and a resistance of a couple of k Ohm in bright light (10-20kOhm @ 10 lux, 2-4kOhm @ 100 lux). On this section we are controlling Relay by LDR sensor. If anybody pass across the sensor then it will change the resistance up to 6k ohm. And this change resistance will give proper base voltage to Darlington transistor. And the output of this biasing circuit is connected to the relay. If the biasing circuit conduction then relay became operate, which cause a low pulse to microcontroller. IR Sensor (product count): For the counting of the product in the factory ewe use the sensor named TSOP 1738.

44

Fig :40 The TSOP1738 series are miniaturized receivers for infrared remote control systems. PIN diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR filter. The demodulated output signal can directly bedecoded by a microprocessor. TSOP17 is thestandard IR remote control receiver series, supportingall major transmission codes.The ultimate utilisation of the sensor is to count the finished product produced and carried by the conveyor here IR LED: An IR LED, also known as IR transmitter, is a special purpose LED that transmits infrared rays in the range of 760 nm wavelength. Such LEDs are usually made of gallium arsenide or alumunium gallium arsenide. They, along with IR receivers, are commonly used as sensors. The appearance is same as a common LED. Since the human eye cannot see the infrared radiations, it is not possible for a person to identify whether the IR LED is working or not. To overcome this problem, the camera on a cell phone can be used. The camera can show us the IR rays being emanated from the IR LED in a circuit.

Fig :41

45

fig :42

PHOTO TRANSISTOR: A photodiode is a type of photo detector capable of converting light into either current or voltage, depending upon the mode of operation.

Photodiodes are similar to regular semiconductor diodes except that they

may be either exposed or

packaged with a windows or optical fibre connection to allow light to reach the sensitive part of the device. Many diodes designed for use specifically as a photodiode will also use a PIN junction rather than the typical PN junction. The photo transistor is used for the amplification.

Fig :43
46

VARIABLE RESISTOR: An electronic component that is used to vary the amount of current that flows through a circuit. It works by sliding a wiper terminal across a resistive material, typically a thin film or chunk of carbon or a resistive wire made of nickel chromium or tungsten alloys. Potentiometers and rheostats are variable resistors in which the wiper terminals take the form of a dial or slider that the user does manipulate, such as the volume control of radio or music system. The variable resistor is measures distance to detect the object.

Fig :44 As the wiper is moved across the body of the device, the resistance increases between the wiper terminal and one end terminal and decreases between the wiper and the other end.

Fig :45

555TIMER The 555 timer is flexible, cheap, and easy to find.


47

It's also a great starting point for audio projects because its output can be wired directly to a speaker. The 8-pin 555 timer must be one of the most useful ICs ever made and it is used in many projects. With just a few external components it can be used to build many circuits. The 555 timer is used to create pulse.

Fig :46

A popular version is the NE555 and this is suitable in most cases where a '555 timer' is specified. The 556 is a dual version of the 555 housed in a 14-pin package, the two timers share the same power supply pins. The circuit diagrams on this page show a 555, but they could all be adapted to use one half of a 556. RESISTOR A resistor is a component of an circuit that resists the flow of electrical current. It has two terminals across which electricity must pass, and it is designed to drop the voltage of the current as it flows from one terminal to the other. Resistors are primarily used to create and maintain known safe currents within electrical components. Resistance is measured in ohms, after Ohm' law. This law states that electrical resistance is equal to the drop in voltage across the terminals of the resistor divided by the current being applied. A high ohm rating indicates a high resistance to current. This rating can be written in a number of different ways for example, 81R represents 81 ohms, while 81K represents 81,000 ohms. The amount of resistance offered by a resistor is determined by its physical construction. A carbon composition resistor has resistive carbon packed into a ceramic cylinder, while a carbon filmresistor consists of a similar ceramic tube, but has conductive carbon film wrapped around the outside. Metal film or metal
48

oxide resistors are made much the same way, but with metal instead of carbon. A wirewound resistor, made with metal wire wrapped around clay, plastic, or fiberglass tubing, offers resistance at higher power levels. Those used for applications that must withstand high temperatures are typically made of materials such as cermet, a ceramic-metal composite, ortantalum, a rare metal, so that they can endure the heat.

Fig :

fig :48

CAPACITOR A capacitor is a passive electronic component that stores f in form of an electrostatic field. In its simplest form, a capacitor consists of a conducting plates separated by an insulating material called the dielectric. The capacitance is directly proportional to the surface areas of the plates, and is inversely proportional to the separation between the plates. Capacitance also depends on the dielectric constant of the substance separating the plates.

Fig :49
49

DC MOTOR A DC motor is an electric motor that runs on direct current (DC) electricity. DC motors were used to run machinery, often eliminating the need for a local steam engine or internal combustion engine. DC motors can operate directly from rechargeable batteries, providing the motive power for the first electric vehicles. Today DC motors are still found in applications as small as toys and disk drives, or in large sizes to operate steel rolling mills and paper machines. Modern DC motors are nearly always operated in conjunction with power electronic devices. Lets start with how actually DC motor runs. Direction control of a DC motor is very simple, just reverse the polarity, means every DC motor has two terminals out. When we apply DC voltage with proper current to a motor, it rotates in a particular direction but when we reverse the connection of voltage between two terminals, motor rotates in another direction

Fig :50

The DC motor has two basic parts: the rotating part that is called the armature, and the stationary part that includes coils of wire called the field coils. The stationary part is also called the stator. The armature is made of coils of wire wrapped around the core, and the core has an extended shaft that rotates on bearings. The termination points are called the commutator , and this is where the brushes make electrical contact to bring electrical current from the stationary part to the rotating part of the machine.

50

Fig :51

GSM(GLOBAL SYSTEM FOR MOBILE COMMUNICATION)

Fig :52 GSM TECHNOLOGY: GSM, which stands for Global System for Mobile communications, reigns as the worlds most widely used cell phone technology. Cell phones use a cell phone service carriers GSM network by searching for cell phone towers in the nearby area.

The origins of GSM can be traced back to 1982 when the Grouped Special Mobile (GSM) was created by the European Conference of Postal and Telecommunications Administrations (CEPT) for the purpose of designing a pan-European mobile technology.

51

GSM supports voice calls and data transfer speeds of up to 9.6 Kbit/s, together with the transmission of SMS (Short Message Service). GSM operates in the 900MHz and 1.8GHz bands in Europe and the 1.9GHz and 850MHz bands in the US. The 850MHz band is also used for GSM and 3G in Australia, Canada and many South American countries. By having harmonized spectrum across most of the globe, GSMs international roaming capability

It allows users to access the same services when travelling abroad as at home. This gives consumers seamless and same number connectivity in more than 218 countries.

GSM is a globally accepted standard for digital cellular communications. GSM uses narrowband Time Division Multiple Access (TDMA) for voice and Short Messaging Service (SMS).

What is GSM? If you are in Europe, Asia or Japan and using a mobile phone then most probably you must be using GSM technology in your mobile phone.

GSM stands for Global System for Mobile Communication and is an open, digital cellular technology used for transmitting mobile voice and data services.

The GSM emerged from the idea of cell-based mobile radio systems at Bell Laboratories in the early 1970s.

The GSM is the name of a standardization group established in 1982 to create a common European mobile telephone standard.

The GSM standard is the most widely accepted standard and is implemented globally. The GSM is a circuit-switched system that divides each 200kHz channel into eight 25kHz time-slots. GSM operates in the 900MHz and 1.8GHz bands in Europe and the 1.9GHz and 850MHz bands in the US.

The GSM is owning a market share of more than 70 percent of the world's digital cellular subscribers.

The GSM makes use of narrowband Time Division Multiple Access (TDMA) technique for transmitting signals.

The GSM was developed using digital technology. It has an ability to carry 64 kbps to 120 Mbps of data rates.
52

Presently GSM support more than one billion mobile subscribers in more than 210 countries throughout of the world. The GSM provides basic to advanced voice and data services including Roaming service. Roaming is the ability to use your GSM phone number in another GSM network.

A GSM digitizes and compresses data, then sends it down through a channel with two other streams of user data, each in its own time slot. It operates at either the 900 MHz or 1,800 MHz frequency band.

Why GSM? The GSM study group aimed to provide the followings through the GSM:

Improved spectrum efficiency. International roaming. Low-cost mobile sets and base stations (BSs) High-quality speech Compatibility with Integrated Services Digital Network (ISDN) and other telephone company services.

Support for new services. Gsm specification Specifications for different Personal Communication Services (PCS) systems vary among the different PCS networks. The GSM specification is listed below with important characteristics.

Modulation:

Modulation is a form of change process where we change the input information into a suitable format for the transmission medium. We also changed the information by demodulating the signal at the receiving end.

The GSM uses Gaussian Minimum Shift Keying (GMSK) modulation method.

Access Methods:

Because radio spectrum is a limited resource shared by all users, a method must be devised to divide up the bandwidth among as many users as possible.

GSM chose a combination of TDMA/FDMA as its method. The FDMA part involves the division by frequency of the total 25 MHz bandwidth into 124 carrier frequencies of 200 kHz bandwidth.

53

One or more carrier frequencies are then assigned to each BS. Each of these carrier frequencies is then divided in time, using a TDMA scheme, into eight time slots. One time slot is used for transmission by the mobile and one for reception. They are separated in time so that the mobile unit does not receive and transmit at the same time.

Transmission Rate:

The total symbol rate for GSM at 1 bit per symbol in GMSK produces 270.833 K symbols/second. The gross transmission rate of the time slot is 22.8 Kbps.

GSM is a digital system with an over-the-air bit rate of 270 kbps.

Frequency Band:

The uplink frequency range specified for GSM is 933 - 960 MHz (basic 900 MHz band only). The downlink frequency band 890 - 915 MHz (basic 900 MHz band only).

Channel Spacing:

This indicates separation between adjacent carrier frequencies. In GSM, this is 200 kHz.

Speech Coding:

Speech is encoded at 13 kbps. Gsm is a TDMA based wireless network technology developed in Europe that is used throughout most of the world. GSM phones make use of a SIM card to identify the user's account. The use of the SIM card allows GSM network users to quickly move their phone number from one GSM phone to another by simply moving the SIM card. Currently GSM networks operate on the 850MHz, 900MHz, 1800MHz, and 1900MHz frequency bands. Devices that support all four bands are called quad-band, with those that support 3 or 2 bands called tri-band and dual-band, respectively. In the United States, Cingular operates on the 850 and 1900MHz bands, while T-Mobile operates only on the 1900MHz band.

Also known as: "Global System for Mobile Communications", "Groupe Special Mobile" TDMA stands for time division multiple access. TDMA is a multiplexing method that divides network connections into time slices, where each device on the TDMA network connection gets one or more time slices during which it can transmit or receive data. TDMA is often used to refer to early digital mobilephone networks that made use of TDMA multiplexing, such as the original
54

network implemented by AT&T/Cingular before it moved to GSM, which is itself based on TDMA technology.

Also known as: "Time Division Multiple Access

RS 232 CONVERTER (MAX 232N):

UART (Universal Asynchronous Receiver Transmitter) or USART (Universal Synchronous Asynchronous Receiver Transmitter) are one of the basic interface which you will find in almost all the controllers available in the market till date. This interface provide a cost effective simple and reliable communication between one controller to another controller or between a controller and PC.

RS 232 BASIC:

RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment).

Voltage Levels:

The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels. Valid signals are plus or minus 3 to 25 volts. The range near zero volts is not a valid RS-232 level; logic one is defined as a negative voltage, the signal condition is called marking, and has the functional significance of OFF. Logic zero is positive, the signal condition is spacing, and has the function ON. So a Logic Zero represented as +3V to +25V and Logic One represented as -3V to -25V.

Usually all the digial ICs works on TTL or CMOS voltage levels which cannot be used to communicate over RS-232 protocol. So a voltage or level converter is needed which can convert TTL to RS232 and RS232 to TTL voltage levels. The most commonly used RS-232 level converter is MAX232. This IC includes charge pump which can generate RS232voltage levels (-10V and +10V) from 5V power supply. It also includes two receiver and two transmitters and is capable of full-duplex UART/USART communication.

This is the device, which is used to convert TTL/RS232 vice versa. RS-232 pin-outs for IBM compatible computers are shown below. There are two configurations that are typically used: one for a 9-pin connector and the other for a 25-pin connector.

55

Table-10 SERIAL COMMUNICATION:

The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a typical hysteresis of 0.5 V, and can -V inputs. Each driver converts TTL/CMOS input levels into EIA-232 levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas Instruments

Fig:53

Diagram above shows the waveform in which the bits has to be transferred. First is the start bit.. then 8-bit data and at last a stop bit. There is a secret formula to calculate the delay time which is needed between bits to get correct baudrate. Below is a software implemented UART, which can be used in C as well as Assembly programs. It is written for Keil software. But with a little modification you can use it in your programs.
56

CIRCUIT DIAGRAM

Fig :54

57

Fig : 55 SIM 300: It is a GSM modem. And the interface techniques are RS232. It used for wireless Message communication 1:Tri-band (900/1800/1900) GPRS Class 10 2: 40x33x2.85mm 60-pin ENTERY bord to bord connecter

3: Sleep mode (about 2.5mA) 4: Embedded TCP/IP with transparent mode 5: Autobauding 6: Over-temperature automatic shutdown 7: SIM card detection function 8: All software version based on V10.0

58

CONNECTION OF SIM 300 & 8051

Fig : 56
59

Designed for global market, SIM300 is a Tri-band GSM/GPRS engine that works on frequencies EGSM 900 MHz, DCS 1800 MHz and PCS1900 MHz. SIM300 provides GPRS multi-slot class 10 capability and support the GPRS coding schemes CS-1, CS-2, CS-3 The physical interface between SIM300 and the mobile application is through a 60 pins board-toboard connector, which provides all hardware interfaces from module to customers boards except the RF antenna interface. The keypad and SPI LCD interface will give you the flexibility to develop customized applications. Two serial ports can help you easily develop your applications. Two audio channels include two microphones inputs and two speaker outputs. These audio interfaces can be easily configured by AT command. One ADC input SIM card Following is the reference circuit about SIM interface. We recommend an Electro-Static discharge device ST (www.st.com) ESDA6V1W5 or ON SEMI (www.onsemi.com) SMF05C for ESD ANTI. The resistors (R204-R206) showed in the figure 3 should be added in series on the IO line between the module and the SIM card for matching the impedance The SIM_PRESENCE pin is used for detecting the SIM card removal. Note: The pull up resistor R207 must be added. You can select the 8 pins SIM card. The reference circuit about SIM card illustrates as following figure.

60

AT COMMAND

Command AT+CMGD AT+CMGF

Description DELETE SMS MESSAGE SELECT SMS MESSAGE FORMAT

AT+CMGL

LIST SMS MESSAGES FROM PREFERRED STORE

AT+CMGR AT+CMGS AT+CMGW

READ SMS MESSAGE SEND SMS MESSAGE WRITE SMS MESSAGE TO MEMORY

AT+CMSS

SEND SMS MESSAGE FROM STORAGE

AT+CMGC AT+CNMI

SEND SMS COMMAND NEW SMS MESSAGE INDICATIONS

AT+CPMS

PREFERRED SMS MESSAGE STORAGE

AT+CRES AT+CSAS AT+CSCA

RESTORE SMS SETTINGS SAVE SMS SETTINGS SMS SERVICE CENTER ADDRESS

AT+CSCB

SELECT CELL BROADCAST SMS MESSAGES

AT+CSDH

SHOW SMS TEXT MODE PARAMETERS

AT+CSMP

SET SMS TEXT MODE PARAMETERS

AT+CSMS Table-11
61

SELECT MESSAGE SERVICE

PROGRAMME
Sensor port equ p1 KEYS EQU RELAY EQU rs equ en equ rw equ lcdport equ p2 PRDT EQU PRDTSTPSW WRKRSTP EQU

P1 P0.3 p0.1 p0.0 p0.2 P3.6 ;PRODUCT SENSOR EQU P3.4;PRODUCT COUNT STOP SWITCH P3.5;WORKER COUNT STOP

;=====================================worker init. EN1 L1 L2 ORG LJMP EQU P0.4;DC MOTOR ENABLE PIN EQU P0.5;DC MOTOR 1ST PIN EQU P0.6;DC MOTOR 2ND PIN 00H MAIN

SJMP PRODUCT ORG 30H ;{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{PRODUCT START{{{{{{{{{{{{{{{{{{{{{ PRODUCT: SETB IE.7 SETB IE.0 ACALL COMMAND2 mov dptr, #PRODUCT1 ;FOR PRROECT NAME........ acall dataa ACALL COMMAND2 MOV R7,#30H MOV A,R7 ACALL DATAWR I: JB PRDT,XXX1 SJMP XXX XXX1: JB PRDTSTPSW,I SJMP PFINISH
62

CJNE

XXX: INC R7 ACALL CO1 SJMP I CO1: R7, #31H , NXT20

;MOV A, R7 ACALL ADDR ACALL DATAWR ; ACALL DCSTART ;SETB RLY1 ;SETB RLY2 RET NXT20: CJNE R7, #32H , ;MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT30: CJNE R7, #33H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT40: CJNE R7, #34H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT50: CJNE R7, #35H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT60: CJNE R7, #36H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT70: CJNE R7, #37H ,

NXT30

NXT40

NXT50

NXT60

NXT70

NXT80
63

MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT80: CJNE R7, #38H , NXT90 MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT90: CJNE R7, #39H , NXT0A0 MOV A, R7 ACALL ADDR ACALL DATAWR ACALL sendsms;...................EDIT........... mov dptr,#message7 ;................. call senddata ;.................... RET NXT0A0: CJNE R7, #3AH , co1 MOV R7, #30H MOV A, #30H ACALL ADDR ACALL DATAWR RET PFINISH: acall command2 dptr, acall dataa ACALL sendsms mov dptr,#message7 call senddata mov scon,#50h mov tmod,#20h mov th1,#0fdh reti mov #PRODUCT2 ;FOR PRROECT NAME........

;.................

;{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{

64

;*********************************************PASSWORD START********************************************** MAIN: clr relay SETB IE.7 SETB IE.0 SETB IE.2 MOV KEYS, #0FFH MOV R1, #01H ACALL COMMAND2 MOV 30H, #11111110B ;1........INITIAL P.W=123 MOV 31H, #11111101B ; 2........ MOV 32H, #11111011B ; 3........ NEW2: MOV ACALL MOV ACALL MOV ACALL MOV ACALL MOV ACALL

KEYS, M 33H, A DISPLAY1 KEYS, M 34H, A DISPLAY2 KEYS, M

#0FFH ;1ST CHAR IN 33H #0FFH

#0FFH

MOV 35H, A ACALL DISPLAY3 ACALL COMP NEW4: CJNE R1, #03H, LJMP NEW3 COMP: MOV A, ;MOV R2, CJNE A, 33H, MOV A, CJNE A, 34H, MOV A, CJNE A, 35H, ACALL CORRECT NEW3: ACALL WRONG ;CPL RELAY ;ACALL DELAY ;CPL RELAY

NEW

;...........COUNTER SET 3

...........

30H 33H NEW4 31H NEW4 32H NEW4

65

SJMP MAIN ;==========================================================DISPLAY=========== ============================ CORRECT: ACALL COMMAND2 B_1: mov dptr, #mydata1 ;FOR PRROECT NAME........ BB_1: clr a movc a, @a+dptr jz CORRECTMSG ;jump a=0, acall datawr ;acall send inc dptr sjmp BB_1 CORRECTMSG: ACALL SENDSMS ;TMT MSG INITIAISATION...... mov dptr,#message4 ;MSG FOR CORRECT PASSWORD..... call senddata SJMP $ ;###########################################jUMP TO WORKER COUNT

;============================================================================ ============================== WRONG: ;============================================================================ ============================== setb relay ACALL COMMAND2 mov dptr, #mydata2 ;FOR PRROECT NAME........ BB_10: clr a movc a, @a+dptr jz R ;jump a=0, acall datawr ;acall send inc dptr sjmp BB_10 R: WRONGMSG: ACALL SENDSMS ;TMT MSG INITIAISATION...... mov dptr,#message5 ;MSG FOR CORRECT PASSWORD..... call senddata ;SJMP $ ;***********STOP.........
66

RET ;============================================================================ ================================

DISPLAY1: MOV A, #80H ACALL COMMAND MOV A,#"*" ACALL DATAWR ACALL DELAY0X RET DISPLAY2: MOV A, #81H ACALL COMMAND MOV A,#"*" ACALL DATAWR ACALL DELAY0X RET DISPLAY3: MOV A, #82H ACALL COMMAND MOV A,#"*" ACALL DATAWR ACALL DELAY0X RET NEW: ACALL COMMAND2 INC R1 LJMP NEW2

M: MOV CJNE A, PRESSED OR NOT SJMP M RE: RET ;**********************************PASSW0RD END********************************** ;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} A, KEYS #0FFH, RE ;CHK IF KEY IS

67

WORKER: WCOUNT: acall mov dptr,

command2

#WORKER1 ;FOR PRROECT NAME........ acall dataa ;============================================================================ ============== sjmp main2 MAIN2: acall command2

SETB IE.7 SETB IE.2 MOV R0,#30h MOV R7,#30h MOV P1,#0FFH ;===================================================================MAIN PRO.=========== main3: JB WRKRSTP,AX LJMP WORKERFINISH AX: mov a, sensorport cjne a, #10111111B, nxt sjmp enter nxt: cjne a, #01111111b, main3 sjmp exit ;********************************************************************* enter: MOV A, sensorport CJNE A, #01111111B, enter INC R7 ACALL COMP1 MOV sensorport, #0FFH ACALL DELAY0X LJMP MAIN3 ;============================================================= COMP1: CJNE R7, #31H , NXT2

68

;MOV A, R7 ACALL ADDR ACALL DATAWR ; ACALL DCSTART ; SETB RLY1 ; SETB RLY2 RET NXT2: CJNE R7, #32H , ;MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT3: CJNE R7, #33H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT4: CJNE R7, #34H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT5: CJNE R7, #35H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT6: CJNE R7, #36H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT7: CJNE R7, #37H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT8: CJNE R7, #38H , MOV A, R7

NXT3

NXT4

NXT5

NXT6

NXT7

NXT8

NXT9

69

ACALL ADDR ACALL DATAWR RET NXT9: CJNE R7, #39H , NXT0 MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT0: CJNE R7, #3AH , comp1 MOV R7, #30H MOV A, #30H ACALL ADDR ACALL DATAWR RET ;================================================ ;***************************************************** EXIT: MOV A, sensorport CJNE A, #10111111B, EXIT DEC R7 MOV sensorport, #0FFH ACALL DELAY0X ACALL COMP2 LJMP MAIN3 CJNE R7, #2AH , COMP2 SJMP NN COMP2: CJNE R7, #30H , NXT00 NN: MOV A, R7 ACALL ADDR ACALL DATAWR ;CLR RLY1 ;CLR RLY2 ;ACALL DCSTOP ; SJMP MAIN2 RET NXT00: CJNE R7, #31H , NXT21 MOV A, R7 ACALL ADDR ACALL DATAWR
70

RET NXT21: CJNE R7, #32H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT31: CJNE R7, #33H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT41: CJNE R7, #34H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT51: CJNE R7, #35H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT61: CJNE R7, #36H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT71: CJNE R7, #37H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT81: CJNE R7, #38H , MOV A, R7 ACALL ADDR ACALL DATAWR RET NXT91: CJNE R7, #39H , MOV A, R7

NXT31

NXT41

NXT51

NXT61

NXT71

NXT81

NXT91

NXT01

71

ACALL ADDR ACALL DATAWR RET NXT01: ;CJNE R7, #3AH , comp2 MOV R7, #30H MOV A, #30H ACALL ADDR ACALL DATAWR LJMP MAIN3 WORKERFINISH: acall command2

mov dptr,

#WORKER2 ;FOR PRROECT NAME........ acall dataa ACALL sendsms;...................EDIT........... mov dptr,#message6 ;................. call senddata mov scon,#50h mov tmod,#20h mov th1,#0fdh

reti ;{{{{{{{{{{{{{{{{cOMMON START{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ ;============================================== ADDR: MOV A, #80H ACALL COMMAND MOV RET A,R7

;****************************************************GSM****************************** *** GSMTMT: ;org 0000h ;clr p1.0 ; call sendsms ; setb p1.0 ;loop : jmp loop ;===================================================== sendsms: mov dptr,#message1 call senddata
72

call delay mov dptr,#message3 call senddata call delay

ret ;===================================================== message1: db "AT+CMGF=1", 0Dh, '$' message2: db "AT+CSCS=", '"', "GSM", '"', 0Dh, '$' message3: db "AT+CMGS=", '"', "+918260324996", '"', 0Dh, '$' message4: db "CORRECT PASSWORD.", 0Dh, 1Ah, '$' message5: db "WRONG PASSWORD. ", 0Dh, 1Ah, '$' message6: db " WORKERS =9" ,'$' message7: db " PRODUCTS =9", '$' ;===================================================== senddata : mov scon,#50h mov tmod,#20h mov th1,#0fdh mov tl1,#0fdh mov 39h,#00h setb tr1 senddata2: mov a,39h movc a,@a+dptr cjne a,#'$',senddata3 mov tmod,#11h ret senddata3 : mov sbuf,a jnb ti,$ clr ti inc 39h jmp senddata2 delay: MOV HERE3: here2: mov here: djnz djnz DJNZ ret
73

R2, mov r4, r4, r3, R2,

#30 r3, #200 #250 here here2 HERE3

;************************************************************************************** *****

;===========================GSM TMT END===================================================== dataa : mov 39h,#00h Bx: clr a mov a,39h movc jz acall ;acall inc sjmp b_x2: ret command: mov clr clr setb acall clr ret datawr: mov setb clr setb acall clr ret delay0X: mov h2:
74

a,@a+dptr ;jump a=0,

b_x2 datawr send 39h Bx

lcdport,a rs rw en delay0X en

lcdport,a rs rw en delay0X en

r4,#255

mov h:

r5,#255

djnz r5,h djnz r4,h2 ret

;==========================comm command2: mov dptr, #mycom h_1:;............................. clr a movc a, @a+dptr acall command acall delay0X jz xx ;jump a=0, ;acall send inc dptr sjmp h_1 xx: ret ;============================================================================ ==================

mycom:

db 38h,0eh,01,06,80h,0

mydata1:db "CORRECT PASSWORD",0 mydata2:db " WRONG PASSWORD ",0 PRODUCT1:db " PRODUCT COUNT ",0 PRODUCT2:db "COUNTING END ",0 WORKER1:db " WORKER COUNT. . ",0 WORKER2:db "COUNTING END ",0 mydata12:db "ENTER PASSWORD ",0 END

;}}}}}}}}}}}}}}}}}}COMMON END}}}}}}}}}}}}}}}}}}}}}}

75

FUTURE SCOPE
The microcontroller can be used for implementation of more of more complex tasks like controlling different systems in the industry. The project we have undertaken can be used as a reference or as a base for realizing a scheme to be implemented in other projects of greater level. The project itself can be modified to achieve a complete automation system which will then create a platform for the user to interface between himself and his industry.

RECOMMENDATION This project is a small implication of our concept in automating and monitoring system. The practical applications of this project are immense and can have vast level of implementation. This small concept can be used in fields such as weather forecasting, remote sensing, robotics, aeronautics, home automation, and many other related fields where continuous monitoring and regulation is needed. So this is not the end of the project but rather is a step towards exploring other possibilities that it brings with it. We recommend this project, which has tremendous applications and possibilities. The project work in the fact gives a lot of confidence to fight out in this challenging world.

APPLICATION Industrial Automation Visitor counting Security access system Home Automation

76

CONCLUSION

The project we have undertaken has helped us gain a better perspective on various aspects related to our course of study as well as practical knowledge of electronic equipments and communication. We became familiar with software analysis, designing, implementation, testing and maintenance concerned with our project. In this critical sensor monitoring, authentication is commanding the system and wireless network are challenges faced by the industries. As the user operates the system by a secret code the authorization problem has been solved. The GSM network used helps in controlling the system from a distant area. The microcontroller used helps in interfacing many input/output devices at a time. These extensive capabilities of the system are what make it so interesting. From the convenience of a simple cell phone, a user is able to control and monitor virtually any electrical devices. The end product will have a simplistic design making it easy for the users to interact with.

77

BIBLIOGRAPHY www.intel.com www.atmel.com www.maixm-ic.com www.8052.com www.keil.com www.arm.com www.simcom.com www.engineergarage.com Architecture and programming of micro controller 8051 A.J.Ayala. The 8051 microcontroller and Embedded systems Mazidi and Mazidi Intel micro book.

78

79

80

81

82

83

84

85

86

87

88

You might also like