Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

INDUSTRIAL PRODUCTION COUNTER USING AT89s52 MICROCONTROLLER

INTRODUCTION:
This project titled Industrial production counter using AT89s52 is designed and presented in order to count the production and management of daily production batches etc. The system identifies the entry/exit of the object. On the successful implementation of the system, it displays the number of objects produced or in the batch for production.

This system can be economically implemented in all the places where the production has to be counted and controlled.
Our system counts either entering or exiting goods in the industry or where it is placed

Depending upon the interrupt from the sensors, the system

identifies the entry/exit of the object.

On the successful implementation of the system, it displays the number of objects produced or in the batch for production
Since counting the production helps to maximize the efficiency

and effectiveness of the industry, it is helpful in maintaining the market demand and sales potential of an organization etc Other applications employing a pulse counter include bidirectional

visitor counters at Museums and other tourist spots and also in the feed back Circuitry of critical applications like digital blood pressure monitor system , Pacemaker and ECG and EEG etc.

HARDWARE DESCRIPTION: ATMEL 89s52 MICROCONTROLLER SENSORS COMPARATOR LCD MODULE IC MAX232

MICROCONTROLLER 8052(89s52):

The block diagram of microcontroller 8052(89s52) is shown below:

PIN

DIAGRAM OF THE 8052 MICROCONTROLLER:

SENSORS: Infrared Sensor: A Photodiode is a p-n junction or p-i-n structure. When an infrared photon of sufficient energy strikes the diode, it excites an electron thereby creating a mobile electron and a positively charged electron hole. Infra-Red emitter sends out IR pulses.

IR LED and Phototransistor POSITIONING OF SENSORS:-

The resistance of the sensor decreases when IR (infrared) light falls on it. A good sensor will have near zero resistance in presence of light and a very large resistance in absence of light.

LM324N is a comparator IC that digitizes the analog signal from the sensor array.

CONNECTING INFRARED MODULE WITH MICROCONTROLLER

Connecting Infrared module with Microcontroller


When the sensor/emitter pair is on shining surface sensor is on i.e. in low impedance mode which one can easily view as L.E.D. corresponding to that sensor doesnt glow.

Infra-Red Sensor Array:

Infra-Red Sensor array Black Wire - Output Voltage Red Wire - +5V Brown Wire - Gnd COMPARATOR: General Description on LM324: A comparator is a device which compares two voltages or currents and switches its output to indicate which is larger .

Pin Diagram of LM324

Function of the Comparator

LCD MODULE:

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data.

A command is an instruction given to LCD to do a predefined task like initializing it clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

Pin Diagram:

Pin Description:

Pin No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Function Ground (0V) Supply voltage; 5V (4.7V 5.3V) Contrast adjustment; through a variable Selects command register when low; and data register when high Low to write to the register; High to read from the register Sends data to data pins when a high to low pulse is given

Name Ground Vcc VEE Register Select Read/write Enable DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 Led+ Led-

8-bit data pins

Backlight VCC (5V) Backlight Ground (0V)

IC MAX 232: The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic levels during serial communication of microcontrollers with PC. The drivers (T1 & T2), also called transmitters, convert the TTL/CMOS input level into RS232 level.

Pin Diagram:

Pin Description:
Pin No 1

Function

Name
Capacitor 1 +

2
3 4 5 6 7 8 Output pin; outputs the serially transmitted data at RS232 logic level; connected to receiver pin of PC serial port Input pin; receives serially transmitted data at RS 232 logic level; connected to transmitter pin of PC serial port Capacitor connection pins

Capacitor 3 +
Capacitor 1 Capacitor 2 + Capacitor 2 Capacitor 4 T2 Out R2 In

9
10 11 12 13 14 15 16

Output pin; outputs the serially transmitted data at TTL logic level; connected to receiver pin of controller.
Input pins; receive the serial data at TTL logic level; connected to serial transmitter pin of controller. Output pin; outputs the serially transmitted data at TTL logic level; connected to receiver pin of controller. Input pin; receives serially transmitted data at RS 232 logic level; connected to transmitter pin of PC serial port Output pin; outputs the serially transmitted data at RS232 logic level; connected to receiver pin of PC serial port Ground (0V) Supply voltage; 5V (4.5V 5.5V)

R2 Out
T2 In T1 In R1 Out R1 In T1 Out Ground Vcc

CIRCUIT DESIGN AND OPERATION: WORKING OF CIRCUIT. BLOCK DIAGRAM. SCHEMATIC DIAGRAM. C PROGRAM.

BLOCK DIAGRAM:

SCHEMATIC DIAGRAM:

Transmit data pin (TXD) is specified at port pin P3.1.The microcontroller is connected to TIN (pin 11) of MAX232. TOUT (pin 14) of IC2 is connected to pin 2 of the COM port connector. The signals provided on these pins are TTL-level and must be boosted and inverted through a MAX232 converter to comply with RS-232 standard. The MAX232 has two internal charge pumps that convert +5V into +/-10V (unloaded) for RS-232 driver operation. The first converter uses capacitor C8 to double the +5V input to +10V on capacitor C10 at pin 2. The second converter uses capacitor C7 to invert +10V to -10V on capacitor C6 at pin 6. All the serial communication is controlled through special-function register SCON. This register contains mode-selection bits, ninth data bit6 for transmit and receive (TB8 and RB8), and serial-port interrupt bits (TI and RI). Serial communication requires standard baud rate. Timer-1 is configured in auto-reload mode to generate baud rate. A +5V power supply if delivered by an AC-to-DC adapter and regulated by IC 7805 (IC3). Capacitor C2 bypasses the ripples present in the regulated supply. LED1 acts as the power indicator and R2 limits the current through LED1. SOFTWARE: The software for this project is written in C language and compiled using Keil uVision4 compiler.

C PROGRAM:

The program has to identify an input from the sensors and increment the value of the count. The algorithm is shown below.
void Convert(unsigned int value) { x1 = value / 10; d1 = value % 10; x2 = x1 / 10; d2 = x1 % 10; x3 = x2 / 10; d3 = x2 % 10; d4 = x3 % 10; d1=d1|0x30; d2=d2|0x30; d3=d3|0x30; d4=d4|0x30;

lcdcmd(0xC7); lcdwrt(d4); lcdwrt(d3); lcdwrt(d2); lcdwrt(d1); Delay(1); SerialTx(d4); SerialTx(d3); SerialTx(d2); SerialTx(d1); Delay(1); SerialTx('\r'); SerialTx('\n'); LED=0; Delay(30); }

LCD initialization is done using the following . void LCDInit() { lcdcmd(0x38); Delay(10); lcdcmd(0x0E); Delay(10); lcdcmd(0x01); Delay(10); lcdcmd(0x0C); Delay(10); lcdcmd(0x80); Delay(10); return; }

The LCD command parameters are described using the below function.

void lcdcmd(unsigned char value) { LCD=value; rs=0; rw=0; en=1; Delay(1); en=0; return; }

Data is written to the LCD using the following function.

void lcdwrt(unsigned char value) { LCD=value; rs=1; rw=0; en=1; Delay(1); en=0; return; }

In addition to displaying on LCD the data is also sent serially to a computer from where production controlling is done. void Serial Tx(unsigned char value) { SBUF = value; while(TI==0); TI = 0; }

THANK U

You might also like