Industrial counter

66

Transcript of Industrial counter

Page 1: Industrial counter

Chapter # 1: INTRODUCTION

Page 2: Industrial counter

1.1

Global System for Mobile Communication (GSM) is a set of ETSI standards

specifying the infrastructure for a digital cellular service. The GSM is the most popular

standard for mobile phones in the world. Over 2 billion people use GSM service

across more than 210 countries and territories. GSM uses narrow band “time division

multiple access” (TDMA), which allows eight simultaneous, calls on the same radio

frequency. Like other cellular standards GSM allows network operators to offer

roaming services which mean subscribers can use their phones all over the world.

GSM networks operate in four different radio frequencies. Most GSM networks

operate in the 900 MHz or 1800 MHz bands. Some countries in the Americas

(including the USA and Canada) use the 850 MHz and 1900 MHz bands because the

900 and 1800 MHz frequency bands were already allocated. GSM uses linear

predictive coding (LPC). The purpose of LPC is to reduce the bit rate. The LPC

provides parameters for a filter that mimics the vocal tract. The signal passes through

this filter, leaving behind a residual signal. Speech is encoded at 13kbit/s.

One of the key features of GSM is the “Subscriber Identity Module” (SIM), commonly

known as a SIM card. The SIM is a detachable smart card containing the user's

subscription information and phonebook.

GSM provides recommendations, not requirements. The GSM network is divided into

three major systems:

The Switching System (SS)

The Base Station System (BSS)

The Operation and Support System (OSS).

Elements

Page 3: Industrial counter

The Switching System (SS):-

The switching system (SS) is responsible for performing call processing and

subscriber-related functions. The switching system includes the following functional

units.

Home Location Register (HLR) — The HLR is a database used for storage and

management of subscriptions. The HLR is considered the most important

database, as it stores permanent data about subscribers, including a

subscriber's service profile, location information, and activity status. When an

individual buys a subscription from one of the PCS operators, he or she is

registered in the HLR of that operator.

Mobile Services Switching Center (MSC) — The MSC performs the telephony

switching functions of the system. It controls calls to and from other telephone

Page 4: Industrial counter

and data systems. It also performs such functions as toll ticketing, network

interfacing, common channel signaling, and others.

Visitor Location Register (VLR) — The VLR is a database that contains

temporary information about subscribers that is needed by the MSC in order to

service visiting subscribers. The VLR is always integrated with the MSC. When

a mobile station roams into a new MSC area, the VLR connected to that MSC

will request data about the mobile station from the HLR. Later, if the mobile

station makes a call, the VLR will have the information needed for call setup

without having to interrogate the HLR each time.

Authentication Center (AUC) — A unit called the AUC provides authentication

and encryption parameters that verify the user's identity and ensure the

confidentiality of each call. The AUC protects network operators from different

types of fraud found in today's cellular world.

Equipment Identity Register (EIR) — The EIR is a database that contains

information about the identity of mobile equipment that prevents calls from

stolen, unauthorized, or defective mobile stations. The AUC and EIR are

implemented as stand-alone nodes or as a combined AUC/EIR node.

The Base Station System (BSS):-

All radio-related functions are performed in the BSS, which consists of base station

controllers (BSCs) and the base transceiver stations (BTSs).

BSC — The BSC provides all the control functions and physical links between

the MSC and BTS. It is a high-capacity switch that provides functions such as

handover, cell configuration data, and control of radio frequency (RF) power

levels in base transceiver stations. A number of BSCs are served by an MSC.

BTS — The BTS handles the radio interface to the mobile station. The BTS is

the radio equipment (transceivers and antennas) needed to service each cell in

the network. A group of BTSs are controlled by a BSC.

Page 5: Industrial counter

The Operation and Support System (OSS):-

The operations and maintenance center (OMC) is connected to all equipment

in the switching system and to the BSC. The implementation of OMC is called the

operation and support system (OSS). The OSS is the functional entity from which the

network operator monitors and controls the system. The purpose of OSS is to offer the

customer cost-effective support for centralized, regional, and local operational and

maintenance activities that are required for a GSM network. An important function of

OSS is to provide a network overview and support the maintenance activities of

different operation and maintenance organizations.

Additional Functional Elements:-

Other functional elements shown in Figure 2 are as follows:

Message Center (MXE) — The MXE is a node that provides integrated voice,

fax, and data messaging. Specifically, the MXE handles short message service,

cell broadcast, voice mail, fax mail, e-mail, and notification.

Mobile Service Node (MSN) — The MSN is the node that handles the mobile

intelligent network (IN) services.

Gateway Mobile Services Switching Center (GMSC) — A gateway is a node

used to interconnect two networks. The gateway is often implemented in an

MSC. The MSC is then referred to as the GMSC.

GSM Interworking Unit (GIWU) — The GIWU consists of both hardware and software that provides an interface to various networks for data communications. Through the GIWU, users can alternate between speech and data during the same call. The GIWU hardware equipment is physically located at the MSC/VLR.

GSM: originally from Group Special Mobile) is the most popular standard for mobile phones in the world. The ubiquity of the GSM standard has been advantageous to both consumers (who benefit from the ability to roam and switch carriers without switching phones) and also to network operators (who can choose equipment from any of the many vendors implementing GSM.GSM also pioneered a low-cost alternative to voice calls, the Short message service (SMS, also called "text messaging"), which is now supported on other mobile standards as well.

Page 6: Industrial counter

Our project is also GSM based which operates on the function of SMS trough witch a text data can be send & receive on both sides. The main benefit of this hard ware is that it is totally GSM based so an owner can collect data any where every where he is so the main function of this hard ware is based on GSM there for is known as GSM BASED WIRELESS INDUSTRIAL COUNTER.

1.2 Counter• Every object which is passed from infra red or cuts infra red ray is counted

by a counter. The function of counter is to count the object and save the data. Basically we use a micro controller to count the object

• A microcontroller (also MCU or µC) is a computer-on-a-chip. It is a type of microprocessor emphasizing self-sufficiency and cost-effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC).

• In addition to all arithmetic and logic elements of a general purpose microprocessor, the microcontroller usually also integrates additional elements such as read-only and read-write memory, and input/output interfaces and perform the desire function.

Page 7: Industrial counter

Chapter # 2:

7

Page 8: Industrial counter

Hardware Components

2.1) Infrared:

Infrared (IR) radiation is electromagnetic radiation of a wavelength longer than that of visible light, but shorter than that of microwaves. The name means "below red" (from the Latin infra, "below"), red being the color of visible light with the longest wavelength. Infrared radiation has wavelengths between about 750 nm and 1 mm, spanning five orders of magnitude. Humans at normal body temperature can radiate at a wavelength of 10 microns.[1]

Infrared imaging is used extensively for both military and civilian purposes. Military applications include target acquisition, surveillance, night vision, homing and tracking. Non-military uses include thermal efficiency analysis, remote temperature sensing, short-ranged wireless communication, spectroscopy, and weather forecasting. Infrared astronomy uses sensor-equipped telescopes to penetrate dusty regions of space, such as molecular clouds; detect cool objects such as planets, and to view highly red-shifted objects from the early days of the universe.

An infrared detector

An infrared detector is a photo detector that reacts to infrared (IR) radiation. The two main types of detectors are thermal and photonic.

The thermal effects of the incident IR radiation can be followed through many temperature dependent phenomena. Bolometer and microbolometers are based on changes in resistance. Thermocouples and thermopiles use the thermoelectric effect. Golay cells follow thermal expansion. In IR spectrometers the pyroelectric detectors are the most widespread.

8

Page 9: Industrial counter

The response time and sensitivity of photonic detectors can be much higher, but usually these have to be cooled to cut thermal noise. The materials in these are semiconductors with narrow band gaps. Incident IR photons can cause electronic excitations. In photoconductive detectors, the resistivity of the detector element is monitored. Photovoltaic detectors contain a p-n junction on which photoelectric current appears upon illumination. A few detector materials:

2.2) LIQUID CRYSTAL DISPLAY (LCD):

LCD PIN Configuration:

Vcc, at pin 16 controls the background contrast.

Vcc, at pin 2 controls the display contrast.

Pin 7 - 14 gets input data.

Pin 1 and pin 3 controls the brightness of the display.

Pin 5, gets a read/write signal.

Pin 6, enable signal. Pin 4, data register select.

9

Page 10: Industrial counter

2.3) MICROCONTROLLER AT89C51: The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The devices manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pinout. 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 Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.

Features:• Compatible with MCS-51™ Products• 4K Bytes of In-System Reprogrammable Flash Memory– Endurance: 1,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

The AT89C51 provides the following standard features: 4Kbytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bittimer/counters, a five vector two-

10

Page 11: Industrial counter

level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 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 hardware reset.

PIN CONFIGURATIONS :

PIN Description

VCC

It is the Supply voltage used to operate the IC.

GNDGround potential, to provide the neutral point for the IC to function properly.

11

Page 12: Industrial counter

Port 0Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin

can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull ups are required during program verification.

Port 1Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1 output

buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 1 also receives the low-order address bytes during Flash programming and verification.

Port 2Port 2 is an 8-bit bi-directional I/O port with internal pull ups. The Port 2 output

buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the 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 uses 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

Port 3Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3 output

buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull ups. Port 3 also serves the functions of various special features of the AT89C51 as listed on the next page:

12

Page 13: Industrial counter

Port 3 also receives some control signals for Flash programming and verification.

RSTReset input. A high on this pin for two machine cycles while the oscillator is

running resets the device.

ALE/PROGAddress Latch Enable output pulse for latching the low byte of the address

during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.

PSENProgram Store Enable is the read strobe to external program memory. When

the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

EA/VPPExternal Access Enable. EA must be strapped to GND in order to enable the

device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP.

XTAL1

13

Page 14: Industrial counter

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2 Output from the inverting oscillator amplifier

2.4) MAX 232 GENERAL DESCRIPTION:

A MAX232 chip has long been using in many uC boards. It provides 2-channel RS232C port and requires external 10uF capacitors. Carefully check the polarity of capacitor when soldering the board. Serial RS-232 (V.24) communication works with voltages (-15V ... -3V for high

[sic]) and +3V ... +15V for low [sic]) which are not compatible with normal computer

logic voltages. On the other hand, classic TTL computer logic operates between

0V ... +5V (roughly 0V ... +0.8V for low, +2V ... +5V for high). Modern low-power

logic operates in the range of 0V ... +3.3V or even lower.

PACKAGING:-

The maximum RS-232 signal levels are far too high for computer logic

electronics, and the negative RS-232 voltage for high can't be grokked at all by

computer logic. Therefore, to receive serial data from an RS-232 interface the

voltage has to be reduced, and the low and high voltage level inverted. In the other

direction (sending data from some logic over RS-232) the low logic voltage has to be

"bumped up", and a negative voltage has to be generated, too.

14

Page 15: Industrial counter

RS-232 TTL Logic

------------------------------------------------------------

-15V ... -3V <-> +2V ... +5V <-> high

+3V ... +15V <-> 0V ... +0.8V <-> low

The MAX232 from Maxim was the first IC which in one package contains the

necessary drivers (two) and receivers (also two), to adapt the RS-232 signal voltage

levels to TTL logic. It became popular, because it just needs one voltage (+5V) and

generates the necessary RS-232 voltage levels (approx. -10V and +10V) internally.

This greatly simplified the design of circuitry. Circuitry designers no longer need to

design and build a power supply with three voltages (e.g. -12V, +5V, and +12V), but

could just provide one +5V power supply, e.g. with the help of a simple 78x05

voltage converter.

Fig: The MAX232 TTL Circuitry.

15

Page 16: Industrial counter

FUNCTION:-

It. has two internal charge-pumps that convert +5V to ±10V (unloaded)

for RS-232 driver operation. The first converter uses capacitor C1 to double the +5V

input to +10V on C3 at the V+ output. The second converter uses capacitor C2 to

invert +10V to -10V on C4 at the V- output .A small amount of power may be drawn

from the +10V (V+) and -10V (V-) outputs to power external circuitry (see the

Typical Operating Characteristics section),except on the MAX225 and MAX245–

MAX247, where these pins are not available. V+ and V- are not regulated, so the

output voltage drops with increasing load current. Do not load V+ and V- to a point

that violates the minimum ±5V EIA/TIA-232E driver output voltage when sourcing

current from V+ and V- to external circuitry.

16

Page 17: Industrial counter

2.5) LM 7804:

DESCRIPTION:

The LM7804 series of three terminal positive regulators are available in

the TO-220/D-PAK package and with several fixed output voltages, making them

useful in a wide range of applications. Each type employs internal current limiting,

thermal shut down and safe operating area protection, making it essentially

indestructible. If adequate heat sinking is provided, they can deliver over 1A output

current. Although designed primarily as fixed voltage regulators, these devices can

be used with external components to obtain adjustable voltages and currents.

FEATURES:

• Output Current up to 1A

• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V

• Thermal Overload Protection

• Short Circuit Protection

• Output Transistor Safe Operating Area Protection

WORKING:-

Voltage regulator limits the voltage that passes through it. Each

regulator has a voltage rating; For example, the 7805 IC (these regulators are often

considered to be ICs) is a 5-volt voltage regulator. What that means is that no matter

how many volts you put into it, it will output only 5 volts. This means that you can

17

Page 18: Industrial counter

connect a 9-volt battery, a 12-volt power supply, or virtually anything else that's over

5 volts, and have the 7805 give you a nice supply

of 5 volts out. There are also 7812 (12-volt) and 7815 (15-volt) three-pin regulators in

common use.

Bottom view Front view

The pin out for a three-pin voltage regulator is as follows:

1: Voltage in

2: Ground

3: Voltage out

For example, with a 9-volt battery, you'd connect the positive end to pin 1 and

the negative (or ground) end to pin 2. A 7805 would then give you +5 volts on pin

3.Voltage regulators are simple and useful. There are only two important drawbacks

to them: First, the input voltage must be higher than the output voltage. For example,

you cannot give a 7805 only 2 or 3 volts and expect it to give you 5 volts in return.

Generally, the input voltage must be at least 2 volts higher than the desired output

voltage, so a 7805 would require about 7 volts to work properly. The other problem:

The excess voltage is dissipated as heat. At low voltages (such as using a 9-volt

battery with a 7805), this is not a problem. At higher voltages, however, it becomes a

very real problem and you must have some way of controlling the temperature so

you don't melt your regulator. This is why most voltage regulators have a metal plate

with a hole in it; That plate is intended for attaching a heat sink to. Do not confuse

three-pin voltage regulators with a device known as a TRIAC (short for triode AC

18

Page 19: Industrial counter

switch). It is easy to associate them with each other, since they look similar (both

have three pins) and they both regulate power. However, the 78XX types of

regulators are used for regulating DC current, while TRIACs are used for AC current.

2.6) RELAY:

Transistors cannot switch AC or high voltages (such as mains electricity) and

they are not usually a good choice for switching large currents (> 5A). In these cases

a relay will be needed, but note that a low power transistor may still be needed to

switch the current for the relay's coil!

ADVANTAGES OF RELAYS: Relays can switch AC and DC, transistors can only switch DC.

Relays can switch high voltages, transistors cannot.

Relays are a better choice for switching large currents (> 5A).

Relays can switch many contacts at once.

DISADVANTAGES OF RELAYS: Relays are bulkier than transistors for switching small currents.

Relays cannot switch rapidly; transistors can switch many times per

second.

Relays use more power due to the current flowing through their coil.

Relays require more current than many chips can provide, so a low

power transistor may be needed to switch the current for the relay's coil.

19

Page 20: Industrial counter

Internal structure of relay

The function is same as that of a normal switch but here in relay no need to

press the switch to make it on or off manually, rather a +5volts DC or 0 volt( in our

case) will perform the function of making switch on or off respectively. When voltage

is applied to the pin of the coils, the coil becomes energized making the switch

closed and thus completing the circuit which is connected with the pins of the switch.

2.7) LIGHT EMITTING DIODE (LED):LED's are special diodes that emit light when connected in a circuit. They are

frequently used as "pilot" lights in electronic appliances to indicate whether the circuit

is closed or not. A clear (or often colored) epoxy case enclosed the heart of an LED,

the semi-conductor chip.

20

Page 21: Industrial counter

Fig: symbol of LED

LED’s must be connected the correct way round, the diagram may be labeled a

or + for anode and k or - for cathode. The negative side of an LED lead is indicated

in two ways:

1) By the flat side of the bulb.

2) By the shorter of the two wires extending from the LED.

If you can see inside the LED the cathode is the larger electrode (but this is not

an official identification method). The negative lead should be connected to the

negative terminal of a battery. LED's operate at relative low voltages between about

1 and 4 volts, and draw currents between about 10 and 40 mille amperes. Voltages

and currents substantially about these values can melt a LED chip. The most

important part of light emitting diode (LED) is

the semi-conductor chip located in the center of the bulb as shown below. The chip

has two regions separated by a junction. The p region is dominated by positive

electric charges, and the n region is dominated by negative electric charges. The

junction acts as a barrier to the flow of electrons between the p and n regions. Only

21

Page 22: Industrial counter

when sufficient voltage is applied to the semi-conductor chip, can the current flow

and the electron cross the junction into the p region. In the absence of the large

enough electric potential difference (voltage) across the LED leads, the junction

presents an electric potential barrier to the flow of electrons.

2.8) RS-232 MALE/FEMALE CONNECTOR:

DESCRIPTION:

RS-232 is interface for carry information between two devices distance

of up to 20 meters. The information is carry along patch wires higher voltage than is

standard 5V for greater interference immunity. Data transfer is asynchronous with

closely set transmission speed and synchronization by trailing edge start pulse.

PURPOSE OF RS-232:

The RS-232-C interface was developed for a single purpose,

unambiguously stated by its title: "Interface between Data Terminal Equipment and

Data Communications Equipment Employing Serial Binary Data Interchange." Every

word in the title is significant: it describes the interface between a terminal (DTE) to a

modem (DCE) for the transfer of serial data.

DB-9

VOLTAGE LEVELS:

RS-232 using two voltage levels. Logical 1 and 0. Logical 1 is

sometimes calling as marking estate or quiescent state too, logical 0 is calling as

space estate. Logical 1 is indicating negative level, while logical 0 is indicate positive

22

Page 23: Industrial counter

level. Allow voltage levels are state in table. The Noise Margin Issue Signals

traveling along the cable are attenuated and distorted as they pass. Attenuation

increases as the length of the cable increases. This effect is largely due to the

electrical capacitance of the cable. The maximum load capacitance is specified as

2500pf (Pico farad) by the standard. The capacitance of one meter of cable is

typically around 130pf, thus the maximum cable length is limited to around 17

meters.

Data signals

Level Transmitter Receiver

Logical 0 +5 V to +15 V +3 V to +25 V

Logical 1 -5 V to -15 V -3 V to -25 V

Undefined -3 V to +3 V

Pin Description

Pin Name Direction Description

1 CD <-- Carrier Detect

2 RXD <-- Receive Data

23

Page 24: Industrial counter

3 TXD --> Transmit Data

4 DTR --> Data Terminal Ready

5 GND --- System Ground

6 DSR <-- Data Set Ready

7 RTS --> Request to Send

8 CTS <-- Clear to Send

9 RI <-- Ring Indicator

Serial Cable:

A serial cable is a cable that can be used to transfer information between two devices using serial communication, often using the RS-232 standard. Serial cables may use D-subminiature connectors with 9 or 25 pins, but other connectors are used. A specially wired cable used for connecting two similar computer serial ports directly is known as a null modem.

Fig: The serial Male connector cable

24

Page 25: Industrial counter

2.9)Sony Ericsson T290i

The T290 will be available from early 2005 in various dual-band configurations, the T290i and T290c being 900/1800 GSM models, and the T290a 850/1900.

2.10) Transistor

The Product specification Supersedes data of 1997, May 01 to 1999, Apr 08. Philips Semiconductors Product specificationETE SEMICONDUCTORS2PA1015PNP general purpose transistor 2PA1015

25

Page 26: Industrial counter

FEATURESLow current (max. 150 mA)

Low voltage (max. 50 V).

APPLICATIONSGeneral purpose switching and amplification.

DESCRIPTION PNP transistor in a plastic TO-92; SOT54 package.

PINNING PIN DESCRIPTION1 base2 collector3 emitter

LIMITING VALUESIn accordance with the Absolute Maximum Rating System (IEC 134).

NoteTransistor mounted on an FR4 printed-circuit board.

SYMBOL PARAMETER CONDITIONS MIN. MAX. UNITVCBO collector-base voltage open emitter 50 VVCEO collector-emitter voltage open base 50 VVEBO emitter-base voltage open collector 5 VIC collector current (DC) 150 mAICM peak collector current 200 mAIBM peak base current 200 mAPtot total power dissipation Tamb 25 C; note 1 500 mWTstg storage temperature 65 +150 CTj junction temperature 150 CTamb operating ambient temperature 65 +150 C

THERMAL CHARACTERISTICSNote:1. Transistor mounted on an FR4 printed-circuit board.

CHARACTERISTICSTj = 25 °C unless otherwise specified.

SYMBOL PARAMETER CONDITIONS VALUE UNITRth j-a thermal resistance from junction to ambient note 1 250 K/W

SYMBOL PARAMETER CONDITIONS MIN. TYP. MAX. UNITICBO collector cut-off current IE = 0; VCB = -50 V - - -100 nAIEBO emitter cut-off current IC = 0; VEB = -5 V - - -100 nAhFE DC current gain IC = -2 mA; VCE = -6 V

26

Page 27: Industrial counter

2PA1015Y 120 - 2402PA1015GR 200 - 400hFE DC current gain IC = -150 mA; VCE = -6 V 25 - -VCEsat collector-emitter saturation voltage IC = -100 mA; IB = -10 mA - - -300 mVVBEsat base-emitter saturation voltage IC = -100 mA; IB = -10 mA - - -1.1 VCc collector capacitance IE = ie = 0; VCB = -10 V; f = 1 MHz - 4 7 pFfTTransition frequency IC = -1 mA; VCB = -10 V; f = 100 MHz 80 - - MHzF noise figure IC = -200 mA; VCE = -5 V; RS = 2 kW;f = 1 kHz; B = 200 Hz

Limiting values

Limiting values given are in accordance with the Absolute Maximum Rating System (IEC 134). Stress above one ormore of the limiting values may cause permanent damage to the device. These are stress ratings only and operationof the device at these or at any other conditions above those given in the Characteristics sections of the specificationis not implied. Exposure to limiting values for extended periods may affect device reliability.

2.11) Battery 9v

Batteries are all over the place -- in our cars, our PCs, Laptops, portable MP3 player and cell phones. A battery is essentially a can full of chemicals that produce electrons. Chemical reactions that produce electrons are called electrochemical reactions. it has two terminals. One terminal is marked (+), or positive, while the other is marked (-), or negative. In an AA, C or D cell (normal flashlight batteries), the ends of the battery are the terminals. In a large car battery, there are two heavy lead posts that act as the terminals.

Electrons collect on the negative terminal of the battery. If you connect a wire between the negative and positive terminals, the electrons will flow from the negative to the positive terminal as fast as they can (and wear out the battery very quickly -- this also tends to be dangerous, especially with large batteries, so it is not something you want to be doing). Normally, you connect some type of load to the battery using the wire. The load might be something like a light bulb or a motor or an electronic circuit like a radio.

Inside the battery itself, a chemical reaction produces the electrons. The speed of electron production by this chemical reaction (the battery's internal resistance)

27

Page 28: Industrial counter

controls how many electrons can flow between the terminals. Electrons flow from the battery into a wire, and

must travel from the negative to the positive terminal for the chemical reaction to take place. That is why a

battery can sit on a shelf for a year and still have plenty of power -- unless electrons are flowing from the

negative to the positive terminal, the chemical reaction does not take place. Once you connect a wire, the

reaction starts. The ability to harness this sort of reaction started with the voltaic pile.

Battery Arrangement and Power

In many devices that use batteries - such as portable radios and flashlights, you do not use just one cell at a time. You normally group them together serially to form higher voltages, or in parallel to form higher currents. In a serial arrangement, the voltages add up. In a parallel arrangement, the currents add up. The following diagram shows

these two arrangements:

The upper arrangement is called a parallel arrangement. Assume that each cell produces 1.5 volts, then four batteries in parallel will also produce 1.5 volts, but the current supplied will be four times that of a single cell. The lower arrangement is called a serial arrangement. The four voltages add together to produce 6 volts.

28

Page 29: Industrial counter

However, batteries are not quite that linear. For one thing, all batteries have a maximum current they can produce -- a 500 milliamp-hour battery cannot produce 30,000 milliamps for 1 second, because there is no way for the battery's chemical reactions to happen that quickly. And at higher current levels, batteries can produce a lot of heat, which wastes some of their power. Also, many battery chemistries have longer- or shorter-than-expected lives at very low current levels. But milliamp-hour ratings are somewhat linear over a normal range of use. Using the amp-hour rating, you can roughly estimate how long the battery will last under a given load.

If you arrange four of these 1.25-volt, 500 milliamp-hour batteries in a serial arrangement, you get 5 volts (1.25 x 4) at 500 milliamp-hours. If you arrange them in parallel, you get 1.25 volts at 2,000 (500 x 4) milliamp-hours.

Have you ever looked inside a normal 9-volt battery?

Manufacturers caution against disassembling batteries, to avoid personal injury. However, a partially disassembled 9-volt battery would look like this.

It contains six, very small batteries producing 1.5 volts each in a serial arrangement!

Batteries have proven to be one of the most important inventions of the 20th century and are becoming more so as we continue the shift toward a more mobile lifestyle. In the future, batteries will grow smaller, more powerful and longer lasting in order to keep up with our fast paced, portable world.

29

Page 30: Industrial counter

Chapter # 3:

30

Page 31: Industrial counter

Principal of operation

3.1)SCHEMATIC CIRCUIT DIAGRAM:

31

Page 32: Industrial counter

32

Page 33: Industrial counter

3.2) EXPLANATION OF SCHEMATIC DIAGRAME:

Schematic Diagram shows that infrared(IR) transmitter and infrared(IR) photo diode are connected oppositely to each other. The IR photo diode is connected with 100 Ohm resistor and PNP (A1015) transistor. The collector of a transistor is directly connected to a switch relay. This relay is further connected with pin #1 of microcontroller (89C52).Seven Segment 16*2 LCD Screen is used to display data.

Pin Configuration:

Pin # 22, 23 & 24 of the microcontroller is connected with pin # 4, 5 and 6 of LCD respectively these pins are control pins (RD, WR and CLR).similarly pin # 25, 26, 27 and 28 of microcontroller is connected with pin # 11, 12, 13 and 14 of LCD, these pins are Data pins for 4 bits data flow LED is connected one of the data pin which is also connected to pin # 40 of microcontroller. This LED blinks when data flows. Pin #1, 3 and 15 of LCD are GND and pin # 2 and 16 are connected to Vcc (5 volts). A colpitt oscillator is connected with pin # 18 and 19 of microcontroller pin # 20 of microcontroller is GND and pin # 9 is connected to auto reset. An IC MAX232 is connected with microcontroller though pin # 9 and 10 with pin# 10 and pin # 11.This IC is used to convert TTL level(low level) language into RS232 level(High level) language. Four capacitor of 10 micro farad are connected to IC though pin # 16 & 2,1 & 3,4 & 5 and 6 & GND. Pin # 15 is also GND. Pin # 7 & 8 are connected with pin # 2 &3 of DB 9 connector. Mobile phone is connected to DB 9 connecter through serial cable.

We use a voltage regulator (LM7805) which regulates 9 volts Vcc into 5 volts Vcc. It consists of three pins; pin # 1 is connected with diode (IN4007) which is directly connected to 9 volt battery. Pin # 2 is GND and pin# 3 supplies 5 volts Vcc to entire hardware.

33

Page 34: Industrial counter

3.3) Hardware Operation

The basic function of our hardware is to count the products and save the desired data and displays on LCD and Transmit via GSM as a text message.

Construction:It consists of a pair of transmitter and receiver infrared and photo diode which

sends its response to microcontroller while its being cut. Microcontroller saves the desire data after processing.A seven segment LCD Screen is used to display the desired data of microcontroller. it operates with 9 volts battery here a voltage regulator (LM 7805)is connected which converts 9 volts into 5 volts so all the hardware operates on 5 volts.. the unique function of our hardware is to connect it with GSM mobile, for this purpose we connect a mobile set (SonyEricsson T290i) via DB 9 Connector(male/female). This mobile is connected to our hardware which receives a text message from transmitter side and responds accordingly. Both mobiles transmitter and receiver are connected through GSM. So this hardware is used not only to display the data but it sends all the desired data every where you are so we can collect all the counter results via text message any time every where we are.

Function:To understand the function of hardware we installed it in the industry, here the

function of hardware is to count the products (e.g jam bottles).Initially we prepare the hardware for counting through auto reset usually we use a phase shift resister for this purpose when we connect mobile set with hardware and apply 5 volt Vcc though battery at that time the capacitor of phase shift resistor become recharge and make the pin # 9 of microcontroller zero, so the system become reset and prepare to operate.

Now the products are passing on conveyer belt we arrange the hardware at such manner that each product cuts or disturb infrared beam when any object cuts the beam at that

moment the base of the transistor becomes negative, here 5 volts Vcc from battery positively charges the switch relay due to which it becomes magnetize due to this effect the switch inside the relay become close and send zero to microcontroller through pin # 1.When an object passed through the beam, the microcontroller counts it one. This counting is incremented by the programming which is burn inside the microcontroller. The LCD screen is used to display the counting result which is sent from microcontroller through 4 bit data pins. To READ, WRITE, & CLEAR the data between LCD screen and microcontroller control pins are used. MAX232 IC is connected with microcontroller this IC works with four charged capacitor of 10 micro farad which are connected with IC through desired pins. The function of MAX232 is to convert TTL level(low level) language to RS232 level( high level) language and vise versa. For this purpose we connect a collpit oscillator with microcontroller which produces clock frequency.MAX232 IC is further connected to DB 9 connector through which we connect mobile set via serial cable. So due to MAX232.IC data can flow frequently between microcontroller and GSM mobile.

34

Page 35: Industrial counter

35

Page 36: Industrial counter

Chapter # 4

Hardware Implementation

4.1) Implementation on Industrial Scale:GSM based wireless industrial counter is very successfully implemented on industrial scale. For human being it’s difficult to count each product as they are many in number or countless. So this hardware counts each one product so accurately and easily. Moreover it save the desired data and also displays it on LCD screen. it informs us how many products are produced. As well as it gives us an idea that how many products are produced per hour or a day in our industry. We can manually check the past data of our factory. So this hardware is an ideal to get accurate results. Moreover it is economically in price. It is used worldwide on industrial scale.

4.2) Implementation for Military Purpose:

GSM BASED WIRELESS INDUSTRIAL COUNTER is not only use for industrial purpose we can use it for several purposes. now a days it is widely use for military purposes we can install it on sensitive areas such as borders and military areas so at that stage this hard ware not only counts but provide a useful information about military purpose.Its main benefit is the nature of infra red because infra red is an invisible light and when it is cut by any person it count it and send the desire data to micro controller which is shown on LCD display screen which acts as a security signal due to these benefits this hard ware have great importance in military and it also save men power. Now days this hard ware is installed on PAK AFGHAN border and is used for the counting of AFGHEN refugees crossing PAKISTAN border.

4.3) Implementation for Security Basis: Like military and industrial purposes GSM BASED WIRELESS INDUSTRIAL COUNTETR has great importance on security scale. There are many places, spots, and buildings which need great attention, like EMBASSY, AIR PORTS and MARKETS, in these places only related persons are allowed not every one so this problem can also be solved by this hard ware. It counts all

36

Page 37: Industrial counter

the persons entering and exit from the building or area and displays the desire data which acts as an information.

Chapter #5

37

Page 38: Industrial counter

HardwareImplementation via GSM

5.1) Implementation on Industrial Scale

GSM based wireless industrial counter operates very successfully to implement on industrial scale via GSM. It reduced the difficulty of counting. Because. For human being it’s difficult to count each product as they are many in number or countless. So this hardware counts each one product so accurately and easily. Moreover it save the desired data and also displays it on LCD screen. it informs us how many products are produced. As well as it gives us an idea that how many products are produced per hour or a day in our industry. We can manually check the past data of our factory this hard ware becomes more value able when it is implemented via GSM .because we can collect all the information of industry if we are not present there the data is send through mobile set in the form of a text message. So this hardware is an ideal to get accurate results. Moreover it is economical in price. It is used worldwide on industrial scale.

5.2) Implementation for Military Purposes:

GSM BASED WIRELESS INDUSTRIAL COUNTER is use for several purposes. it plays an important role in military activities specially when it is connected via GSM now a days it is widely use for military purposes we can install it on sensitive areas such as borders and military areas so at that stage this hard ware not only counts but provide a useful information about military purpose.Its main benefit is the nature of infra red because infra red is an invisible light and when it is cut by any person it count it and send the desire data to micro controller which is shown on LCD display screen which acts as a security signal. Moreover this data is transmitted to the entire receiver when he is far away from the site this is make possible only through GSM so a beneficial data is receive any where through GSM IN THE FORM OF A TEXT MESSAGE due to these benefits this hard ware have great importance in military and it also save men power.

38

Page 39: Industrial counter

5.2) Implementation for Security Basis:

GSM BASED WIRELESS INDUSTRIAL COUNTETR has great importance on security scale. It is installed on such places where great security and attention is required. here are many places, spots, and buildings which needs great attention .like EMBASSY, AIR PORTS and BANKS, in these places only related persons are allowed not every one so this problem can also be solved by this hard ware .it counts all the persons entering and exit from the building or area and displays the desire data which acts as an information. This information is send to the desire person who serves for security so there for a mobile set is used which is connected to the receivers set through GSM. Here the function of GSM makes the whole system more secures and accurate it transmits the desire information of building or area to the desire person whether he is present far away from the location. So we keep a complete check through this hard ware. So there for the value of hard ware is increased when it is connected through GSM.

39

Page 40: Industrial counter

Chapter# 6

40

Page 41: Industrial counter

Programming #include <lcd8bitx51.h> #include <String.h>

sbit Btn1 = P1^0; // For Up Counting sbit Btn2 = P1^1; //For Down Counting sbit btnMsg = P1^2; unsigned long int counter=0;//,count4,count5,count12,count13;// unsigned long int count11,count10,count9,count8,count7,counter8,count6, count1,count2,count3; code unsigned char segm[10]=

{48,49,50,51,52,53,54,55,56,57}; bit sync;

sbit led = P40;//////////////////////////////////////////////////////////////////////////////////unsigned char RecCh; //Received char from serial port

code unsigned char Command[5][25] = {"AT+CMGF=

1\r\n", //Enter Text Mode"AT+CPMS=

\"ME\"\r\n", //Memory SElection"AT+CNMI=

2,1,2,0,0\r\n", //Message Receive Attention"AT+CMGR

=1\r\n", //Read message from memory location 1"AT+CMGD

=1\r\n" //Delete Message from memory location 1};

bit bOk;unsigned char IndexOk;unsigned char IndexRes;unsigned char OK[3];bit bStartRecOk;unsigned char Response[5];bit bGetResponse;bit bSmsReceived;bit bExecuteCommand;unsigned char Com; //Received Command from SMSbit bReadChar;unsigned char BackSlash;unsigned char Index;

41

Page 42: Industrial counter

unsigned char Msg[3];unsigned char Number[20];bit bSendSms;

void InitSerial(){

SCON = 0x50; //mode 1, 10 bitTMOD = 0x20; //Timer 1 auto reload modeTH1 = 0xfd; //9600 baud rate over 11.0592MHz

crystal TH1 = 256 - ((Crystal/384)/Baud Rate)TR1 = 1; //Turn timer1 OnEA = 1; //Enable All InterruptsES = 1; //Enable Serial Port Interrupt

}//end void InitSerial()

serial() interrupt 4{

if(RI){

RecCh = SBUF;RI = 0;if(bReadChar){

if(BackSlash == 3 && RecCh != '"'){

Number[Index++] = RecCh;}if(BackSlash == 4){

Number[13] = '\0';Index = 0;

}if(BackSlash == 8){

Index++;if(Index == 3){

bExecuteCommand = 1;Com = RecCh;bReadChar = 0;BackSlash = 0;

}}

if(RecCh == '"')BackSlash++;

42

Page 43: Industrial counter

}//end if ReadCharelse if(RecCh == '+' && !bGetResponse){

IndexRes = 0;Response[IndexRes++] = RecCh;bGetResponse = 1;

}else if(bGetResponse){

Response[IndexRes++] = RecCh;if(IndexRes == 5){

if(Response[1] == 'C' && Response[2] == 'M' && Response[3] == 'T' && Response[4] == 'I')

{//Message Received SignalbSmsReceived = 1;

}else if(Response[1] == 'C' && Response[2] == 'M'

&& Response[3] == 'G' && Response[4] == 'R'){

//Read MessagebReadChar = 1;BackSlash = 0;Index = 0;

}bGetResponse = 0;

}}else if(RecCh == 'O' && !bStartRecOk){

bStartRecOk = 1;IndexOk = 0;OK[IndexOk++] = RecCh;

}else if(bStartRecOk){

OK[IndexOk++] = RecCh;if(RecCh == '\r'){

if(OK[0] == 'O' && OK[1] == 'K')bOk = 1;

bStartRecOk = 0;}

}}//end if RI

43

Page 44: Industrial counter

}//end serial() interrupt 4

void SendChar(unsigned char ch){

SBUF = ch;while(!TI){

}TI = 0;

}//end void SendChar(unsigned char ch)

void SendCommand(unsigned char n){

unsigned char i;for(i = 0; Command[n][i] != '\0'; i++)

SendChar(Command[n][i]);while(!bOk);bOk = 0;

}//end Send Command

void InitT100(){

//Give first 3 commandsSendCommand(0); //SendCommand(1);

}//end InitT100

void Initialize(){

InitSerial();InitT100();bOk = 0;IndexOk = 0;bStartRecOk = 0;bGetResponse = 0;bSmsReceived = 0;bExecuteCommand = 0;bReadChar = 0;bSendSms = 0;

}//end init

void StartUpDelay(){

unsigned int i;for(i = 0; i < 60000UL;)

44

Page 45: Industrial counter

{i++;

}}

void delay(){

for(i = 0; i < 33000;){

i++;}

}

void SendSMS(){

unsigned char i;unsigned char Signal[24] =

"AT+CMGS=\"03339231615\"\r\n";//03459084249unsigned long temp;for(i = 0; Signal[i] != '\0'; i++)

SendChar(Signal[i]); delay();

delay();delay();

delay();strcpy(Signal, "Meter Count: 00000000 ");temp = counter;for(i = 20; i > 12; i--){

Signal[i] = (temp % 10) + 48;temp /= 10;

}for(i = 0; i < 21; i++)

SendChar(Signal[i]);

SendChar(0x1A); //Cntrl+ZSendChar('\r');SendChar('\n');

while(!bOk);bOk = 0;

}//end SendSMS

void Display(){ unsigned long temp, temp2;

45

Page 46: Industrial counter

//************************************************************ temp=counter/10000000;

LocateLCD (2,7); PutCharLCD (segm[temp]);

//******************* temp=counter%10000000; temp2=temp/1000000;

LocateLCD (2,8); PutCharLCD (segm[temp2]);

//********************** temp=temp%1000000; temp2=temp/100000;

LocateLCD (2,9); PutCharLCD (segm[temp2]);

//*********************** temp=temp%100000; temp2=temp/10000;

LocateLCD (2,10); PutCharLCD (segm[temp2]);

//********************************** temp=temp%10000; temp2=temp/1000;

LocateLCD (2,11); PutCharLCD (segm[temp2]);

//********************************* temp=temp%1000; temp2=temp/100;

LocateLCD (2,12); PutCharLCD (segm[temp2]);

//********************************* temp=temp%100; temp2=temp/10;

LocateLCD (2,13); PutCharLCD (segm[temp2]);

//*********************************** temp=temp%10;

LocateLCD (2,14); PutCharLCD (segm[temp]);

//************************************************************}//////////////////////////////////////////////////////////////////////////////////void main() {// unsigned long temp, temp2; InitLCD_rimsDEV2763 ();

delay();

46

Page 47: Industrial counter

PrintLCD("METER READING ");NextLineLCD();PrintLCD("UNIT ");StartUpDelay();Initialize();counter = 0;

// InitLCD_rimsDEV2763 ();// PrintLCD(" energy metter ");// NextLineLCD();// PrintLCD("unit ");

sync=1;Display();

while(1) {

if(bSmsReceived){

bSmsReceived = 0;SendCommand(3); //ReadSmsSendCommand(4); //Delete SMS

}if(bExecuteCommand){

bExecuteCommand = 0;if(Com == 'c' || Com == 'C')

bSendSms = 1;else if(Com == 'a' || Com == 'A')

Led = 0;else if(Com == 'b' || Com == 'B')

Led = 1;}//end if bExecuteCommandif(bSendSms){

bSendSms = 0;SendSMS();

}//end if bSendSms

if(Btn1==0 ) { led1 = ~led1; counter++; if(counter==99999999) counter=0; sync=0; Display();

47

Page 48: Industrial counter

while(Btn1!=1); }//************************************************************ if(Btn2==0 ) { led2 = ~led2;

if(counter > 0) counter--;

if(counter==0) counter=99999999; sync=0; Display(); while(Btn2!=1); }

if(!btnMsg) { bSendSms = 1;

while(!btnMsg); }

} }//end of main

48

Page 49: Industrial counter

A

1. Advantages of Relays: 19

2. ALE/PROG 13B

3. Battery 9v 27

4. Battery Arrangement and Power 28

5. Bolo meters 8C

6. Construction: 31

7. Counter 6D

8. Disadvantages of Relays: 19

E9. EA/VPP 1310. Electrochemical reactions 27

11. Explanation of Schematic Diagrame 33

F

12. Function: 31

G13. GSM 6

H

14. Hardware Operation 31

I

15. Implementation for Military Purpose: 35

16. Implementation for Security Basis: 35

17. Implementation on Industrial Scale 35

18. Infrared 819. infrared detector 820. Internal structure of relay 20

L

21. LCD PIN Configuration: 9

22. Light Emitting Diode (LED): 20

23. Liquid Crystal Display (LCD): 9

24. LM 7804: 17

M

25. MAX 232 14

26. MAX232 TTL Circuitry. 15

27. Micro bolo meters 828. Microcontroller AT89C51 10

P

29. parallel arrangement, 28

30. photoconductive detectors 931. photonic detectors 932. Pin Configuration of Microcontroller 11

33. Pin Description of Microcontroller 11

34. Programming 40

35. PSEN 13R

36. Relay: 19

37. RS-232 Male/Female Connector: 22

38. RST 13S

39. Schematic Circuit Diagram: 32

40. serial arrangement 28

41. Serial Cable 24

42. Sony Ericsson T290i 25

T43. Thermocouples 844. thermopiles 845. Transistor 25

46. transistor 2PA1015 25

V

47. Voltage Levels: 22

X48. XTAL1 1449. XTAL2 14

49

Page 50: Industrial counter

BIBILOGRAPHY & REFRENCES:

Books:

Thomas L .Floyd, Digital Fundamentals.

Muhammad Ali Mazidi, The 8051 Microcontroller and Embedded systems, 2nd Edition.

Scott Machenzie, The 8051 Microcontroller.

B L Theraja, Electrical Technology.

K. Y. Tang, Alternating Current Circuits.

Golding and Widdis, Electrical measurements and measuring instruments.

Admiralty, Examples in Electrical Calculations.

B. W. Williams, Power Electronics.

Books from Reference Library.

Websites:

www.wikipedia.com

www.google.com

www.yahoo.com

www.keil.com

www.8052.com

www.DatasheetCatalog.com

50