You are on page 1of 56

EMBEDDED BASED CEMENT BAG LOADING SYSTEM

CONTENTS
CHAPTER

PAGE NO

1

INTRODUCTION

3

1.1

Overview on Dalmia Cement (B) Ltd.

3

1.2

Embedded Based Cement Bag Loading SystemOverview

6

2

METHODOLOGY

7

2.1

Problem Statement

8

2.1

Idea Implementation

9

2.2

Block Diagram

10

3

CIRCUIT DESCRIPTION

11

3.1

Power supply Circuit Diagram

11

3.2

Schematic Circuit Diagram

12

3.3

Algorithm and Flow Chart

25, 26

3.4

Programming Code

27

4

OUTCOME

31

5

CONCLUSION

34

6

BIBLIOGRAPHY

35

ST. JOSEPH’S COLLEGE

1

DEPARTMENT OF ELECTRONICS

EMBEDDED BASED CEMENT BAG LOADING SYSTEM

CHAPTER
7

PAGE NO
APPENDIX

37

 AT89C51 MICRO CONTROLLER

38

 LIQUID CRYSTAL DISPLAY (16*1)

46

 555 OPERATION

53

ST. JOSEPH’S COLLEGE

2

DEPARTMENT OF ELECTRONICS

EMBEDDED BASED CEMENT BAG LOADING SYSTEM

1.INTRODUCTION
1.1.OVERVIEW ON DALMIA CEMENT (B) LTD
DALMIA CEMENT BHARATH LIMITED
DALMIA PURAM
Only in the year 1914, India entered of cement
manufacturing. Now there are many cement factories spreader all over
India expect west Bengal, ASSAM and KASHMIR. Shri. Ramkrishna
Dalmia, a daring foresighted pioneer in the industrialization of India
planned to establish Many cement factories in different parts of the
country and act upon it by establish cement plans at Dalmia Nagar in
Bihar, Karachi, Dalmia Dadri, Dondal in Punjab, Sawai Modhapur in
Rajastan and Dalmia puram in Tamilnadu.
Dalmia cement Bharath limited, is the largest and
leading cement manufacturing company in tamilnadu. It is located in
Trichy-Chennai chord line and it is 45 kilometres north east of Trichy
town. DCBL, commenced its production in the year 1939, with and

ST. JOSEPH’S COLLEGE

3

DEPARTMENT OF ELECTRONICS

EMBEDDED BASED CEMENT BAG LOADING SYSTEM

installed capacity of 250 tones of clinker per day produced from the
Polsius Lepol kiln, a semidry process technology. In 1949 the second wet
process UNAX KILAN was installed. These two plants added to raise
the installed capacity to 1250 tones per day. To increase the capacity by
200 tones per day mini cement plant viz., VERTICAL SHAFT KILN
(VSK) of fuel slurry process technology was launched in the year 19811982. This is the first cement plant in asia which absorbed this
technology, in the year 1987 the company has completed in
modernization by installing 1500 TPD dry process KILD KILN with
PRE CALCINATOR technology with computerized control system. In
this KILN heat energy utilization is optimum and power consumption is
comparatively low. In addition, a 110KV sub station was erected in the
year 1982.
In order to augment the power position and to meet
any future power cut, four captive generator sets were installed having
15 MVA Capacity in Dalmia Puram works. After modernization the
installed capacity in the production of cinker reached 1950 tones per day.
And hence wet process kilns UNAX and folks.

ST. JOSEPH’S COLLEGE

4

DEPARTMENT OF ELECTRONICS

EMBEDDED BASED CEMENT BAG LOADING SYSTEM

TYPES OF CEMENT PRODUCED:
OPC

-

Ordinary Portland Cement

PPC

-

Portland Pozzaolana Cement

GPHSSC

-

Grey Portland High Strength Special
Cement

OWC

-

Oil Well Cement

PSC

-

Portland Slag Cement

DALMIAPURAM UNIT HAS A LOT OF FIRST TO ITS CREDITS
1) It was first to introduce the vertical roller mill technology in India
conserving valuable energy
2) This unit is a pioneer in the production of high strength special
cement required for manufacture of concrete railway sleeper as
also in manufacture of oil well cement required in oil drilling
corporation
3) It was first to install captive power generator which can run on
heavy fuel oil thus saving scarce and valuable light distillated like
diesel

ST. JOSEPH’S COLLEGE

5

DEPARTMENT OF ELECTRONICS

EMBEDDED BASED CEMENT BAG LOADING SYSTEM This project has been selected in order to rectify the problem while counting and loading the cement bags. In order to automate. A cement bag has been identified by means of sensor and has interfaced to the micro controller to count the number of cement bags.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 4) It was the first to introduce fuel shurry process through VERTICAL SHAFT KILN Technology. Now a days they count the cement bags manually and loaded in to the vehicle. In order to overcome these drawbacks the cement bag counting and loading system should be automated. JOSEPH’S COLLEGE 6 DEPARTMENT OF ELECTRONICS . This method of counting may cause an error and consumes more time .1. 1. the embedded based cement bag counting and loading system has been developed. this would cause a big problem in marketing and distribution. The required number of cement bags has been delivered from the ST.

EMBEDDED BASED CEMENT BAG LOADING SYSTEM keyboard through the hostport to the microcontroller. And thus this system has the control of counting and loading the cement bags.2. IDEA IMPLEMENTATION 9 2.1. JOSEPH’S COLLEGE 7 DEPARTMENT OF ELECTRONICS . PROBLEM STATEMENT 8 2. BLOCK DIAGRAM 10 ST. CHAPTER 2 2.3.

This would cause to reduce the economy of that concern. ST.1. This work is time consuming one. And there was a chance of miscounting.PROBLEM STATEMENT: In order to achieve very rapid marketing and product distribution from the manufacturing area to the agencies. should not take much time in packing section of Dalmia cement Factory. JOSEPH’S COLLEGE 8 DEPARTMENT OF ELECTRONICS .EMBEDDED BASED CEMENT BAG LOADING SYSTEM 2. This manual method deploys more number of employees ultimately this rises the production cost. The Cement bag which are packed form the rotary backer is kept on the conveyer belt and counted manually and loaded in to the lorry as well. To overcome these difficulties the cement bag loading system should be automated.

after counting this cement bag the counted value has been displayed on the display section. When the count has been attained the reference value it in the duty of micro controller to stop the conveyer. JOSEPH’S COLLEGE 9 DEPARTMENT OF ELECTRONICS .EMBEDDED BASED CEMENT BAG LOADING SYSTEM 2. The occurance of cement bag on the conveyer belt is identified by the sensor. The number of cement bag which are going to be loaded in to the vehicle has been specified as a reference. The Embedded system has been constructed using the AT89C51 Micro Controller. IMPLEMENTATION To automate the cement bag loading system here the embedded system has been used.2. from a PC to Micro Controller through the host port. ST. and is counted by the AT89C51 Microcontroller. The vehicle in which the cement bag would be loaded can be identified by the micro switch which are placed on the loading system has been interfaced to the controller to activate conveyer belt Motor. which will stop the loading cement bag.

. Vehicle Sensor .EMBEDDED BASED CEMENT BAG LOADING SYSTEM 2. JOSEPH’S COLLEGE 10 DEPARTMENT OF ELECTRONICS .3. BLOCK DIAGRAM Light Source Conveyer Belt Light Detector .3 (A) ST. 555 Circuit Motor µC PC LCD Host Port FIG : 2. .

This 5V DC supply is given to the various IC’s which is used in the Water Spray Control System. The circuit diagram of the power supply section is given below.POWER SUPPLY CIRCUIT DIAGRAM POWER SUPPLY SECTION Here the process need a 5V DC power supply for the Microcontroller. LCD.CIRCUIT DESCRIPTION 3.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 3. This output is given to a Regulator IC 7805. Analog to Digital converter. JOSEPH’S COLLEGE 11 + 1000F/ 25 V IC 7805 2 3 + Vout DEPARTMENT OF ELECTRONICS . Driver IC. This IC gives a constant output of 5V DC. ST.. and Multiplexer.1. So. 12V 600 mA D1 _ 230Vac 50 HZ D2 D3 1N 4001X4 1 + D4 . the power supply has designed with a Bridge rectifier which has an output of 12V.

EMBEDDED BASED CEMENT BAG LOADING SYSTEM Figure 3. JOSEPH’S COLLEGE 12 DEPARTMENT OF ELECTRONICS .SCHEMATIC CIRCUIT DIAGRAM ST.2.1(A) 3.

JOSEPH’S COLLEGE 13 DEPARTMENT OF ELECTRONICS .(A) It includes different parts as follows.1 VEHICLE MONITORING SECTION: In this project load cell must be implemented so as to check the vehicle is present or not.2.1. Since the availability of the load cell is hard and cost effectiveness. 3. the entire weight along with cement bags will be measured it will compared with the weight of cement bags loaded that has been counted by the sensor circuitary. more over Cement bag count checking can be accomplished Initially the weight of the vehicle will be measured after loading process. I make use of single toggle switch to indicate the presence of vehicle. ST.EMBEDDED BASED CEMENT BAG LOADING SYSTEM The over all circuit diagram of Embedded Based Cement Bag loading System is as shown in figure 3.

this will seize the data bus.1. ST.1. to make a job ease. JOSEPH’S COLLEGE 14 DEPARTMENT OF ELECTRONICS .3 HOST PORT INTERFACE SECTION: The data from host computer must reach the system. The detector circuit is LDR it has 2M Ohm.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 3. Address of the data bus in the parallel is 378H similarly to implement hand shaking mode. So as to transfer the data from host to system. 3.2 CEMENT BAG SENSING SECTION: This part will sense the number of cement bags that has been passed. of course it can be done with the help of serial port. when it is kept in dark otherwise it will provide 900 ohm. The address of status bus is 37AH. This project uses control bus of the parallel port. so as to accommodate the ambient condition necessary arrangement has made. The address of control bus in 379H. This project makes use of light source and light detector circuit. I choose parallel port.

4 MOTOR SECTION: The motor used in these project is DC motor which substitutes the conveyer motor.4(a) ASTABLE MULTIVIBRATOR USING 555IC: The device is connected for astable operation as shown in the figure 3. If the reset pin is at ground state the entire circuit will be deactivate.2.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 3. So I have used an interface circuit which in corporates 555IC with which speed of the motor can be controlled. 3. Energizing the circuit is done with the help of reset pin of 555IC. In order to activate this pin must be provided with high state.1.For better understanding. JOSEPH’S COLLEGE 15 DEPARTMENT OF ELECTRONICS . the complete diagram of astable multivibrator with detailed internal diagram of 555 is shown in ST. Even switching circuit may be used to drive the motor section. The output from the micro controller section may not drive the DC motor. The difficulty of switching circuit is speed of motor remains constant by making use of interface circuit we can alter the speed by varying the resistance RA and RB.1.

When the power supply Vcc is connected.pin 7 of discharging transistor Q1 is connected to the junction of RA and RB. This in turn makes transistor Q1 on and capacitor C starts discharging towards ground through RB and transistor Q1 with a time constant RB C.Resistors RA and RB must be be large enough to limit this current and prevent damage to the discharge transistor Q1.During this time.the timing resistor is now split into two resistors RA and RB.EMBEDDED BASED CEMENT BAG LOADING SYSTEM Figure 3.Current also flows into transistor Q1 through RA. ST.Comparing with monostable operation.the external capacitor C charges towards Vcc with a time constant(RA+RB)C.Set S=1 and this combination makes Q=0 which is unclamped the timing capacitor C.The minimum value of RA is approximately equal to Vcc/0.2.2A is the maximum current through the on transistor Q1.output(pin 3) is high (equals Vcc) as reset R=0.When the capacitor voltage equals Vcc the upper comparator triggers the control flip-flop so that Q =1. JOSEPH’S COLLEGE 16 DEPARTMENT OF ELECTRONICS .2 where 0.

JOSEPH’S COLLEGE 17 DEPARTMENT OF ELECTRONICS . as it reaches Vcc/3 the lower comparator is triggered and at this stage S=1. (C) shows the timing sequence and capacitor voltage waveform.Now Q=0 unclamps the external timing capacitor C. (B) Astable Multivibrator Using 555 Timer During the discharge of the timing capacitor C. which turns Q=0.R=0.2. ST.It may be calculated as follows.Figure 2.3.The length of time that the output remains HIGH is the time for the capacitor to charge from (1/3)Vcc to (2/3)Vcc.EMBEDDED BASED CEMENT BAG LOADING SYSTEM FIG: 3. The capacitor C is thus periodically charged and discharged between (2/3) Vcc and (1/3)Vcc repectively.

2 (C) Functional Diagram of Astable Multivibrator Using 555 Timer The capacitor voltage for a low pass RC circuit subjected to a step input of Vcc volts given by.1.1.EMBEDDED BASED CEMENT BAG LOADING SYSTEM FIG : 3. JOSEPH’S COLLEGE 18 -------(3.1) The time t1 taken by the circuit to charge from 0 to (2/3)Vcc is. vc=Vcc(1-e-t/RC) --------(3.2) DEPARTMENT OF ELECTRONICS . (2/3) vcc=Vcc(1-e-t1/RC) ST.

4) The output is low while the capacitor discharges from (2/3)Vcc to (1/3)Vcc And the voltage across the capacitor is given by (1/3) vcc=(2/3)Vcce-t/RC solving we get t=0.EMBEDDED BASED CEMENT BAG LOADING SYSTEM t1=1.1.1.405RC So the time to charge from (1/3)Vcc to (2/3)Vcc is tHIGH=t1-t2 tHIGH=0.3) t2=0.68(RA+2RB)C So.09RC and the time t2 to charge from 0 to (1/3)Vcc is.5) DEPARTMENT OF ELECTRONICS . f =1/T=1.(3. (1/3) vcc=Vcc(1-e-t1/RC) ---------(3.69(RA+RB)C --------(3.45 (RA+2RB) C ST.1.69RC Therefore the total time T=tHIGH+tLOW Or T=0. JOSEPH’S COLLEGE 19 ------.

2. when the transistor Q1 is on. RB and C ST. 1M capacitance in F 0. the output goes low. The duty cycle D of a circuit is defined as the ratio of ON time period T = (t ON + tOFF) in this circuit.2 (D) a graph of the various combination of (R A+2RB) and C necessary to produce a given stable output frequency.1M 0. JOSEPH’S COLLEGE 20 DEPARTMENT OF ELECTRONICS .1 10M 10k 1k 0.01 0. 3.EMBEDDED BASED CEMENT BAG LOADING SYSTEM Shows FIG 3.1 (RA+2RB) 0. Frequency Dependence of RA.001 1 10 100 1k 10k 100k Astable frequency in Hz FIG.

2 is connected to vehicle sensor. the port1.5 MICRO CONTROLLER INTERFACE SECTION: The port1. the port1.1. JOSEPH’S COLLEGE 21 DEPARTMENT OF ELECTRONICS . ST.5(a) DISPLAY SECTION: In order to display the require statement that a user would use to display.4 is connected to status port.3 is connected to reset pin of the 555IC and the Entire port3 is connected to display section.1.1 is connected to light sensor. a Liquid Crystal Display (LCD) has selected. A 16*1 LCD has interfaced to the AT89C51 micro controller. Entire port2 is connected to data bus.5 is connected to control port the prot1. Port1.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 3. 3.

EMBEDDED BASED CEMENT BAG LOADING SYSTEM The block diagram of 16*1 LCD as follows.LER RS R/W LCD PANEL SEGMENT DRIVER V0 Vdd Vss FIG : 3.2. JOSEPH’S COLLEGE 22 DEPARTMENT OF ELECTRONICS . R K /\/\/\ LED BACK LIGHT A DB0-DB7 E DOT MATRIX LCD CONTROL – . (E) Block Diagram of (16X1) LCD ST.

EMBEDDED BASED CEMENT BAG LOADING SYSTEM PIN CONFIGURATION OF LCD (16X1): PIN. JOSEPH’S COLLEGE 23 DEPARTMENT OF ELECTRONICS . NO SYMBOL FUNCTION 1 Vss GROUND 2 Vdd +5 V 3 Vo CONTRAST PIN FOR LCD 4 RS REGISTER SELECT 5 R/W READ/WRITE 6 E ENABLE 7 DB0 DATABUS 8 DB1 DATABUS 9 DB2 DATABUS 10 DB3 DATABUS 11 DB4 DATABUS 12 DB5 DATABUS 13 DB6 DATABUS 14 DB7 DATABUS 15 A ANODE 16 K CATHODE ST.

Each read and write operation can be achieved when Enable pin (E) is activated. Read and write operation can be achieved through R/W pin. The backlight of LCD can be easily activated when applying forward voltage to its terminals. JOSEPH’S COLLEGE 24 DEPARTMENT OF ELECTRONICS . If it is set. ST. the data bus has data otherwise it is command word. The power supply pins can be supplied by the + 5v D>C> The RS (register select) pin decides whether the data bus has the data or control word.EMBEDDED BASED CEMENT BAG LOADING SYSTEM The function of LCD can be easily understood by the pin configuration of LCD.

STEP 7. ST. Switch of the conveyer motor.3(a) ALGORITHM: STEP 1. Enter the number of cement bags STEP 4.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 3. Count the number of cement bags and check whether it is equal to the reference value STEP 6. Display the counted value of cement bag. Activate the conveyer belt motor STEP 5. Initialize the LCD STEP 2. JOSEPH’S COLLEGE 25 DEPARTMENT OF ELECTRONICS . Check whether the vehicle is present or not STEP 3.

3(b) FLOW CHART START INITIALIZE LCD NO IS LORRY ? YES ENTER THE NUMBER OF BAGS (REFERENCE) ACTIVATE THE MOTOR COUNT THE NUMBER OF BAGS NO IS C>REF YES DEACTIVATE THE MOTOR DISPLAY THE NUMBER OF BAGS STOP ST.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 3. JOSEPH’S COLLEGE 26 DEPARTMENT OF ELECTRONICS .

3.3 DEACTIVATE THE MOTOR LJMP START ST. $2 JNB P1. $6 SETB P1.PROGRAMMING CODE Table 3. P2 RPT MOV A. RPT MOTOR IS COUNT VALUE = REFERENCE VALUE CLK P1.4 $1 $2 $3 CHECK THE STATUS OF PC JNB P1.1.5. $4 $5 $6 JB P1. R2 LCALL DISP $4 JNB P1.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 3.1. $5 JNB P1.4. $3 MOV R2.4 SEND INTR TO PC TO GET NUMBER OF CEMENT BAGS (DATA) SETB P1. $1 JB P1.1.5. JOSEPH’S COLLEGE 27 DEPARTMENT OF ELECTRONICS . R2.5.4 COMMENTS CHECK THE VEHICLE SENSOR BIT CLR P1.4(a) LABEL MNEMONICS $o JB P1.3 GET DATA FROM PC DISPLAY THE DATA IN LCD COUNT THE NUMBER OF CEMENT BAGS ACTIVATE THE CONVEYER DJNZ.$o START SETB P1.

1 CLR P0.2 MOV P2.right cursor MOV A. A SETB P0. #0EH ACALL CMD CALL LONGDELAY clear display MOV A. #01H ACALL CMD CALL LONGDELAY shift . #06H ACALL CMD CALL LONGDELAY MOV A. #38H (16X1) LCD solution control word initialization ACALL CMD CALL LONGDELAY increment cursor MOV A. #81H data location to be displayed ACALL CMD CALL LONGDELAY CMD ‘RS’ pin control for command Word ‘R/ W’ pin control for Command Word ‘E’ pin control for command Word CLR P0.0 CLR P0.EMBEDDED BASED CEMENT BAG LOADING SYSTEM LCD PROGRAM: LABEL MNEMONICS INITIALI-ZATION COMMENTS MOV A. JOSEPH’S COLLEGE 28 DEPARTMENT OF ELECTRONICS .2 NOP ST.

2 NOP NOP CLR P0. #FFH C00 NOP MOV R1. A SETB P0. #FFH C01 NOP ST.2 Delay Program calling CALL DELAY CALL DELAY RET LCWR CLR P0.2 Check LCD is busy or not CALL BUSY CALL DELAY CALL DELAY MOV R0. JOSEPH’S COLLEGE 29 DEPARTMENT OF ELECTRONICS .1 Data word CLR P0.2 SETB P0.EMBEDDED BASED CEMENT BAG LOADING SYSTEM LABEL MNEMONICS COMMENTS NOP CLR P0.0 LCD initializing for CLR P0.0 MOV P2.

C00 RET BUSY CLR P0. C01 DJNZ R0.2 CALL DELAY CALL DELAY RET DELAY MOV R5. #00H NOP NOP DJNZ R6. JOSEPH’S COLLEGE 30 DEPARTMENT OF ELECTRONICS .EMBEDDED BASED CEMENT BAG LOADING SYSTEM LABEL MNEMONICS COMMNETS DJNZ R1. $ CLR P0. LOOP1 RET ST.7.2 SETB P0. $ RET LONG DELAY LOOP1 MOV R6.1 CLR P0.0 SETB P0.2 JB P1. #00H NOP DJNZ R5.

When implementing this technique the response of the IR detector has not satisfied the desire. ST. But in the commercial market availability is rare and costlier. a load cell was decided to use. This would cause to change the vehicle sensing system to switch. To count the cement bag a photo detective technique has been used. In which the cement bag has to be loaded. In order to know the presence of vehicle.OUTCOME Embedded based cement bag loading system has been Constructed after several difficulties. It consists of infrared light source and detector. JOSEPH’S COLLEGE 31 DEPARTMENT OF ELECTRONICS . It has a very poor range in order to rectify this problem an LDR(Light Dependent Resistor) has been decided as a sensor and a normal light source act as source.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 4.

3V Table(4.1(a)) To display the number of cement bags 7-segment display section has decided to use. To overcome this problem LCD (Liquid Crystal Display) has been decided to use. JOSEPH’S COLLEGE 32 DEPARTMENT OF ELECTRONICS .EMBEDDED BASED CEMENT BAG LOADING SYSTEM 4.1RESPONSE OF LDR: VOLTAGE ACROSS THE LDR(V) FUNCTION WHEN THE CEMENT BAG CUT THIS SOURCE AT NORMAL 3. ST. Finally. While interfacing the 7-segment section to the AT89C51 Micro Controller there has been a storage of port pins.8 0. the embedded based cement bag loading system has been constructed successfully.

ST. JOSEPH’S COLLEGE 33 DEPARTMENT OF ELECTRONICS .EMBEDDED BASED CEMENT BAG LOADING SYSTEM FURTHER DEVELOPMENT:  The embedded based cement bag loading system can be improved when implementing a wireless technology through Ethernet for remote sensing  And it can be implemented with load cell in order to fully atomize.

ST.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 5. JOSEPH’S COLLEGE 34 DEPARTMENT OF ELECTRONICS . it can be implemented in the real time system. Since the project has several advantages as mentioned above. it will reduces man power  It may be implemented in any quality control system for counting  Since it has be automated.CONCLUSION  Since the system has been automated. time consumption will drastically reduce  The reliability of this system will be higher when compared with manual system  If this system is implemented high level security can be achieved.

JOSEPH’S COLLEGE 35 DEPARTMENT OF ELECTRONICS .EMBEDDED BASED CEMENT BAG LOADING SYSTEM CHAPTER 6 ST.

EMBEDDED BASED CEMENT BAG LOADING SYSTEM 6.alldatasheets. BIBLIOGRAPHY BOOKS REFERRED: THE MICROCONTROLLER AND EMBEDDED SYSTEM – MUHAMMAD ALI MAZIDI PROGRAMMING AND CUSTOMIZING THE 8051 MICROCONTROLLER .com ST.ROY CHOUDRY WEBSITES: www.MYKE PREDKO LINEAR INTEGRATED CIRCUITS . JOSEPH’S COLLEGE 36 DEPARTMENT OF ELECTRONICS .retron.electronicsforu.com www.com www.

EMBEDDED BASED CEMENT BAG LOADING SYSTEM CHAPTER 7 ST. JOSEPH’S COLLEGE 37 DEPARTMENT OF ELECTRONICS .

4. By combining a versatile 8-bit CPU with Flash on a monolithic chip. FEATURES • Compatible with MCS-51™ Products • 4K Bytes of In-System Reprogramable Flash Memory – Endurance: 1. The onchip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.000 Write/Erase Cycles • Fully Static Operation: 0 Hz to 24 MHz • Three-Level Program Memory Lock • 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 ST. the Atmel AT89C51 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications. The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry standard MCS-51™ instruction set and pin out as shown in fig 2.EMBEDDED BASED CEMENT BAG LOADING SYSTEM i) MICRO CONTROLLER 89C51 GENERAL DESCRIPTION The AT89C51 is a low-power. high-performance CMOS 8-bit microcomputer with 4Kbytes of Flash Programmable and Erasable Read Only Memory (PEROM). JOSEPH’S COLLEGE 38 DEPARTMENT OF ELECTRONICS .

down operation. and power.EMBEDDED BASED CEMENT BAG LOADING SYSTEM PIN CONFIGURATION PIN CONFIGURATION Ground (VSS) : 0 V reference. JOSEPH’S COLLEGE 39 DEPARTMENT OF ELECTRONICS . ST. Power Supply (VDD): This is the power supply voltage for normal. idle.

port 1 pins that are externally pulled low will source current because of the internal pull-ups. Port 0 is also the multiplexed low-order address and data bus during accesses to external program and data memory. As inputs.  T2EX(P1. JOSEPH’S COLLEGE 40 DEPARTMENT OF ELECTRONICS . it uses ST. port 2 pins that are externally being pulled low will source current because of the internal pull-ups. Port 2: Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. 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). Port 1 pins that have 1s written to them are pulled high by the internal pull-ups and can be used as inputs.EMBEDDED BASED CEMENT BAG LOADING SYSTEM Port 0: Port 0 is an open-drain.1):Timer/Counter2 reload/capture/direction control.  T2 (P1. In this application. Port 1: Port 1 is an 8-bit bi-directional I/O port with internal pull-ups.0): Timer/Counter2 external count input/clock out. Port 2 pins that have 1s written to them are pulled high by the internal pull-ups and can be used as inputs. In this application. bi-directional I/O port. it uses strong internal pull-ups when emitting 1s. As inputs. Port 0 pins that have 1s written tothem float and can be used as high-impedance inputs.

 T1 (P3.4): Timer 0 external input.  INT0 (P3.  T0 (P3. As inputs.3): External interrupt.5): Timer 1 external input. Port 3 pins that have 1s written to them are pulled high by the internal pull-ups and can be used as inputs.  INT1 (P3.2): External interrupt.1): Serial output port.6): External data memory write strobe. port 3 pins that are externally being pulled low will source current because of the pull-ups. port 2 emits the contents of the P2 special function register. Port 3: Port 3 is an 8-bit bi-directional I/O port with internal pull-ups.  WR (P3. Port 3 also serves the special features of the as listed below:  RxD (P3.  TxD (P3. During accesses to external data memory that use 8-bit addresses (MOV @Ri). ST.0): Serial input port. JOSEPH’S COLLEGE 41 DEPARTMENT OF ELECTRONICS .EMBEDDED BASED CEMENT BAG LOADING SYSTEM strong internal pull-ups when emitting 1s.

With this bit set. An internal diffused resistor to VSS permits a power-on reset using only an external capacitor to VCC. ALE can be disabled by setting SFR auxiliary.7): External data memory read strobe. JOSEPH’S COLLEGE 42 DEPARTMENT OF ELECTRONICS . In normal operation. Note that one ALE pulse is skipped during each access to external data memory. PSEN is not activated during fetches from internal program memory. ALE will be active only during a MOVX instruction. ST. ALE is emitted at a constant rate of 1/6 the oscillator frequency. and can be used for external timing or clocking. PSEN is activated twice each machine cycle. Address Latch: Output pulse for latching the low byte of the address Enable (ALE) during an access to external memory. resets the device.EMBEDDED BASED CEMENT BAG LOADING SYSTEM  RD (P3. except that two PSEN activations are skipped during each access to external data memory. Program Store: The read strobe to external program memory. Reset (RST): A high on this pin for two machine cycles while the oscillator is running. When Enable (PSEN) Executing code from the external program memory.0.

NOTE To avoid “latch-up” effect at power-on. respectively. ST.5 V. Crystal 2(XTAL2): Output from the inverting oscillator amplifier. Crystal 1(XTAL1): Input to the inverting oscillator amplifier and input to the internal clock generator circuits. The value on the EA pin is latched when RST is released and any subsequent changes have no effect. 3FFFH for 16 k devices. JOSEPH’S COLLEGE 43 DEPARTMENT OF ELECTRONICS . the voltage on any pin (other than VPP) at any time must not be higher than VCC + 0.00 V programming supply voltage (VPP) during FLASH programming.5 V or VSS – 0. If EA is held high. the device executes from internal program memory unless the program counter contains an address greater than 0FFFH for 4 k devices. This pin also receives the 12. and 7FFFH for 32 k devices.EMBEDDED BASED CEMENT BAG LOADING SYSTEM External Access Enable/Programming Supply Voltage (EA/VPP): EA must be externally held low to enable the device to fetch code from external program memory locations 0000H to the maximum internal memory boundary. 1FFFH for 8 k devices.

EMBEDDED BASED CEMENT BAG LOADING SYSTEM ARCHITECTURE OF 89C51 ST. JOSEPH’S COLLEGE 44 DEPARTMENT OF ELECTRONICS .

ST. JOSEPH’S COLLEGE 45 DEPARTMENT OF ELECTRONICS . To drive the device from an external clock source. respectively.EMBEDDED BASED CEMENT BAG LOADING SYSTEM OSCILLATOR CHARACTERISTICS XTAL1 and XTAL2 are the input and output. as shown in figure. OSCILLATOR CONNECTION Either a quartz crystal or ceramic resonator may be used. XTAL2 should be left unconnected while XTAL1 is driven as shown in figure. of an inverting amplifier which can be configured for use asan on-chip oscillator.

LCD (LIQUID CRYSTAL DISPLAY) This section describes the operation modes of LCD and then describes how to program and interface an LCD to an AT 89C51. 2. which are limited to numbers and a few characters only. This is in contrast to LED’s. This is due to the following reasons: 1. but minimum and maximum voltage high and low time specifications must be observed. The ability to display numbers. ST. Low cost. since the input to the internal clocking circuitry is through a divide-by-two flipflop.EMBEDDED BASED CEMENT BAG LOADING SYSTEM EXTERNAL CLOCK DRIVE CONFIGURATION There are no requirements on the duty cycle of the external clock signal. characters. JOSEPH’S COLLEGE 46 DEPARTMENT OF ELECTRONICS . 7. and graphics.2. FEATURES: In recent years the LCD is finding widespread use in replacing LEDs (seven segment LEDs or other multisegment LEDs).

LCD PIN DIAGRAM: Vs s Vdd Vo RS R /W EN DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 L+ L- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 L A M P E X 1 6 1 0 6 FIG 7. In contrast.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 3. the LED must be refreshed by the CPU (or in some other way) to keep displaying the data. 4. Incorporation of a refreshing controller into the LCD. JOSEPH’S COLLEGE 47 DEPARTMENT OF ELECTRONICS . thereby relieving the CPU of the task of refreshing the LCD.2 LCD PIN DIAGRAM ST. Ease of programming for characters and graphics.

2 LCD PIN DESCRIPTION ST.EMBEDDED BASED CEMENT BAG LOADING SYSTEM DESCRIPTION: The LCD has 16 pins. JOSEPH’S COLLEGE 48 DEPARTMENT OF ELECTRONICS . RS=1 to select data register 4 RS I 5 R/W I 6 E I/O 7 DB0 I/O The 8-bit data bus 8 DB1 I/O The 8-bit data bus 9 DB2 I/O The 8-bit data bus 10 DB3 I/O The 8-bit data bus 11 DB4 I/O The 8-bit data bus 12 DB5 I/O The 8-bit data bus 13 DB6 I/O The 8-bit data bus 14 15 16 DB7 L+ L- I/O - The 8-bit data bus Back Light Back Light R/W=0 for write R/W=1 for read Enable FIG 7. The function of each pin is given in the following table 7.2 PIN SYMBOL 1 I/O Vss --- DESCRIPTION Ground 2 VDD --- +5V power supply 3 VO --- Power supply to control contrast RS=0 to select command register.

BITS: Normally there are eight data bits available in the LCD.1 ms RS 0 R/W DB7 0 0 0 0 0 DB6 0 DB5 1 DB4 0 0 1 0 WAIT FOR MORE THAN 100 s ST.EMBEDDED BASED CEMENT BAG LOADING SYSTEM INTERFACING 4. Here there are only four data bits are used to interface LCD with the microcontroller. POWER ON WAIT FOR MORE THAN 15 ms FOR VDD RS R/W DB7 DB6 DB5 DB4 0 TO 0 RISE 0 0TO 14. The following procedure helps how to interface a 4-bit. JOSEPH’S COLLEGE RS 0 R/W DB7 0 0 DB6 0 0 0 0 A 0 49 DB5 1 DB4 0 1 0 DEPARTMENT OF ELECTRONICS .5V 0 WAIT FOR MORE THAN 4.

EMBEDDED BASED CEMENT BAG LOADING SYSTEM A RS R/W DB7 DB6 DB5 DB4 0 0 0 0 1 0 0 0 N F * * 0 0 0 0 0 1 0 0 S/C R/L * * 0 0 0 0 0 0 0 0 0 1 1/D SH 0 0 0 0 0 0 0 0 0 0 0 1 FUNCTION SET CURSOR DISPLAY SHIFT ENTRY MODE SET CLEAR DISPLAY INITIALIZATION ENDS ABBREVIATIONS: I/D = 1 Increment I/D = 0 Decrement S=1 Accompanies display shift S/C = 1 Display shift S/C = 0 Cursor move R/L = 1 Shift to the right R/L = 0 Shift to the left DL = 1 8 bits DL = 0 4 bits N=0 1 line ST. JOSEPH’S COLLEGE 50 DEPARTMENT OF ELECTRONICS .

2 P 1 .4 A T 8 9 C 5 1 P 1 .1 P 1 .2 MICROCONTROLLER WITH LCD ST.5 P 1 .3 P 1 .7 1 V ss 2 V dd 3 V o 4 R S 5 R /W 6 E N 7 D B 0 L 8 D B 1 9 D B 2 C 10 D B 3 11 D B 4 D 12 D B 5 13 D B 6 14 D B 7 15 L+ 16 L- FIG 7. JOSEPH’S COLLEGE 51 DEPARTMENT OF ELECTRONICS .EMBEDDED BASED CEMENT BAG LOADING SYSTEM F=1 5x10 dots F=0 5x7 dots HOW TO CONNECT MICROCONTROLLER WITH LCD? +V cc 10 K P R E S E T R S R /W E N P 1 .6 P 1 .

RS. VDD. DB0-DB7. the DB4 -DB7 is connected with P1. From the data bits DB0 – DB7. VO.EMBEDDED BASED CEMENT BAG LOADING SYSTEM CIRCUIT DESCRIPTION: There are sixteen pins available in the LCD. VDD and VO are connected with GND. The microcontroller has connected with the LCD through Port 1. EN. +VCC and 10K Preset. The following program shows the LCD initialization with microcontroller. and P1. They are V SS. P1. and EN. R/W.1. R/W.3 are connected with RS. The VSS.2.4 – P1. The port pins P1. ST. L+ and L-.7. JOSEPH’S COLLEGE 52 DEPARTMENT OF ELECTRONICS .

8-pin circular style.EMBEDDED BASED CEMENT BAG LOADING SYSTEM 7. The 555 timer can be used with supply voltage in the range of +5v to +18v and can drive load up to 200mA.TO-99 can or 8-pin mini DIP or as 14-oin DIP. There is also available counter timer such as Exira’s XR-2240 which contains a 555 timer plus a programmable binary counter in a single 16-pin package. A single 555 counter can provide time delay ranging from microseconds to hours whereas counter timer can have a maximum timing range of days. Because of the wide range of ST. JOSEPH’S COLLEGE 53 DEPARTMENT OF ELECTRONICS . Introduction The 555 timer is a highly stable device for generating accurate time delay or oscillation.It is compatible with both TTL and CMOS logic circuits.3. Signifies corporation first introduced this device as the SE555/NE 555 and it is available in two package styles.

JOSEPH’S COLLEGE 54 DEPARTMENT OF ELECTRONICS . the 555 timer is versatile and easy to use in various applications. they also aid ST. pulse generator. monoshot multivibrator. providing bias voltage of (2/3)Vcc to the upper comparator(UC) and (1/3)Vcc to the lower comparator(LC).where Vcc is the supply voltage. Since these two voltages fix the necessary comparator threshold voltage.3.7. Referring to Fig.EMBEDDED BASED CEMENT BAG LOADING SYSTEM supply voltage.7. burglar alarm. Various applications include oscillator. three 5k internal resistors act as voltage divider. traffic light control and voltage monitor etc Ground Vcc Trigger Discharge Output 555 Threshold Reset control voltage Description of Functional Diagram Figure 7.3 gives the pin diagram and fig. ramp and square wave generator.3 gives the functional diagram for 555 IC timer.

the output of the lower comparator goes HIGH and sets the FF.In applications where no such modulation is intended. as the trigger passes through (Vcc/3). by applying a modulation voltage to the control voltage input terminal (pin5). This makes the output LOW because of power amplifier.01F) be connected between control voltage terminal(pin 5) and ground to by-pass nose or ripple from the supply. ST.It is possible to vary time electronically too. when the threshold voltage at pin 6 passes through (2/3) Vcc. At the negative going edge of the trigger. the output Q of the control flipflop (FF) is HIGH. JOSEPH’S COLLEGE 55 DEPARTMENT OF ELECTRONICS . In the standby state. During the positive excursion. A negative going trigger pulse is applied to pin 2 and should have its dc level greater than the threshold level of the lower comparator. it is recommended by manufacturers that a capacitor (0.EMBEDDED BASED CEMENT BAG LOADING SYSTEM in determining the timing interval . which is basically an inverter. the output of the upper comparator goes HIGH and resets the FF.

it is returned to Vcc. which overrides the effect of any instruction coming to FF from lower comparator. And the transistor Q1.EMBEDDED BASED CEMENT BAG LOADING SYSTEM The reset input (pin 4) provides a mechanism to reset the FF in a manner.4V. ST. JOSEPH’S COLLEGE 56 DEPARTMENT OF ELECTRONICS . The transistor Q2 serves as a buffer to isolate the reset input from the FF. This overriding reset is effective when the reset input is less than about 0.The transistor Q2 is driven by an internal reference voltage Vref obtained from the supply voltage Vcc. When reset this reset is not used.