You are on page 1of 69

A Summer Internship Report On

DESIGNING A DIGITAL SPEEDOMETER FOR BH-III MODEL


From 02 June, 2010 to 02 0ctober, 2010

Scooters India Limited, Lucknow


Chandra Shekhar R140207014 Automotive Design Engineering

Mechanical Engineering Department College of Engineering University of Petroleum and Energy Studies, Dehradun

SCOOTERS INDIA LIMITED


(A Government of India Enterprise)

Summer Internship Project

INTERNSHIP REPORT
Design and development department Scooters India Limited Sarojini nagar, Lucknow
Submitted To: Mr. Gautam Chakraborty Senior manager, Design and Development

Submitted By:

Chandra Shekhar B.Tech, Automobile Design Engineering Roll No: R140207014 Batch: 2007-2011 University of Petroleum and Energy Studies

Duration: October, 2010)

4 months (2 June, 2010 to 2

TO WHOM IT MAY CONCERN


This is to certify that Mr. Chandra Shekhar student of B.Tech Automotive Design Engineering from University of petroleum & Energy Studies, Dehradun did his 4 month internship in Scooter India Limited, Lucknow from 2 June, 2010 to 2 October, 2010. During this period Mr. Chandra Shekhar was trained in the Design & Development Department and did his projects. He is a quick learner and carried all the tasks assigned to him efficiently during the course of his work. He took initiatives to learn to the duties involved in the above mentioned department and worked well with his colleagues. We wish him all the best in his future endeavors.

HR Manager, Scooters India Limited

ACKNOWLEDGEMENT

I am greatly indebted to my guides Mr. Hari Prakash B, Asst. Manager, Design & Development Department and Mr. Gautam Chakraborty, Senior Manager, Design & Development Department, Scooter India Limited, Lucknow, for providing me an opportunity to work under their guidance. Their unflinching support, suggestions and directions have helped in smooth progress of the project work. They have been a constant source of inspiration in all possible ways for the successful completion of my project.

I also acknowledge my sincere gratitude to all the engineers of the Design and Development Department in SIL, especially to Mr. Anwar Afar, Asst. Manager, Design and Development, for their support and co-operation throughout my project. I acknowledge my special thanks to Mr. Daljeet Singh, and my friends Deepak Yadav and Aakash for their intensive support and guidance throughout the project.

I also acknowledge the help render by HR Deptt. of SIL, especially to Mrs. Molly Chakraborty and all other non-technical staff of the SIL, Lucknow.

Finally acknowledge my sincere gratitude to Mr. Deepak Kumar, Course Coordinator, UPES, for having me provided all the facilities to complete this dissertation successfully.

CHANDRA SHEKHAR

ABSTRACT
Speedometer is an instrument to measure speed and distance in an automobile. The speedometer could be of mechanical or electronic types (embedded with an ECU or microcontroller). The mechanical one are subjected to errors over prolong usage due to wear and tear of the mechanical parts, and even costlier than digital type speedometers which are accurate and precise in their operation.

In this project, we will study how to design a low cost digital speedometer with the combination of a few digital circuits and an ECU or microcontroller unit to compute the results and displaying the output on a 7 segment LED. The components used are: 555 Timer A MRE (Magnetic Resistance Element) type sensor Counters Shift register Microcontroller BCD counters
6

7 segment LED

A study had been conducted on creating a pulse generator using 555 Timer, cascading two (4-bit) counters, cascading multiple BCD counters, and interfacing 7 segment LED with BCD counters and a detailed study has been carried on the microcontroller IC8051, its programming, interfacing with the peripheral circuitry and its time cycle for the accurate execution of the programme.

The digital speedometer is designed keeping the transmission system of the VIKRAM 450D and 750D (Passenger and Load carrier) at its core, but it is compatible with any automobile with minute changes in programming.

TABLE OF CONTENT

Chapter 1.0

Topic Abstract

Page No. 6

2.0 3.0 4.0 5.0 6.0

Introduction to Scooters India Limited Objective Methodology Mechanical aspects 5.1 Transmission system 5.2 Calculations Analog to Digital Conversion 6.1 Sensor unit 6.2 555 timer 6.3 Counters 6.4 Shift registers Microcontroller 7.1 IC 8051 7.2 Programming of 8051 Display 8.1 BCD counters 8.2 7 segment LED 8.3 Integration of the circuit

8 20 21 22 22 24 27 27 30 37 43 51 51 55 57 57 62 65

7.0

8.0

9.0

Conclusion

10.0

References

66

THE COMPANY PROFILE

Scooters India Limited was established by the Govt. of India and incorporated in 1972. It is situated on the National Highway (NH 25) at 16 Km from Lucknow and 5 Km from the airport and easily accessible from road, rail and air. The company bought over plant, machinery, design, drawing, documentation, copyright etc. lock, stock and barrel from M/s Innocenti of Italy. The company initially manufactured two wheeler scooters in the brand name of Vijai Super in the domestic and Lambretta in the international market. Later the company added another wheel and entered in to the three wheeler market with the brand name of VIKRAM in the domestic and LAMBRO in the international market. The company is a Government of India Enterprise under the Ministry of Heavy Industries and ISO 9001: 2000 certified. The company manufactures petrol, diesel, gas and electric three wheelers as its main stream of products. Apart from three wheelers, the company also manufactures a wide range of engineering goods for prestigious customers like, BHEL, Railways, Ordnance, and Aerospace etc. The company envisages going in a large scale to cater to its prospective customers of such engineering items. The company is implementing the modern manufacturing practices like Cellular Manufacturing, Single Minute Exchange of Dies, Total Productive Maintenance, Statistical Process Control, Advanced Production Scheduling and inducting modern Information Technology to improve its manufacturing activities, productivity, reduce throughput time, minimize inventory, produce Just in Time so as to achieve manufacturing competitiveness and delivery of the quality products to its customers. The Strategic Sourcing has resulted in improving the quality of supplied items and smoothen the supply chain and establish long term business relationship with its suppliers.

VISION
To grow into an environment friendly and globally competitive company constantly striving to meet the changing needs of customer through constantly improving existing products, adding new products and expanding customer base.

MISSION
To fulfill customer's needs for economic and safe mode of road transport and quality engineering products through contemporary technologies.

THE MANUFACTURING PROCESS


9

The company has an integrated manufacturing plant offering total manufacturing solutions for engineering items in general and automobile components in particular within its capacity range.

MACHINE SHOP
Milling, Boring, Turning, Drilling, Reaming, Hobbing, Shaping, shaving, Broaching, Grinding, Honing, Lapping, Thread Milling & Grinding, Thread & serration rolling, Knurling, Cam Milling, Copy Turning, Induction hardening, Magnetic crack detection, General Purpose, Special Purpose and CNC machines.

HEAT TREATMENT
Washing, Hardening, Tempering, Case Carburising, Case hardening, Oil Quenching

DIE CASTING SHOP


Aluminium and Zinc Alloy Pressure die Casting

SURFACE TREATMENT & PAINT


Pre-treatment line with 12 tank dipping process for Degreasing, De-rusting, Rinsing, Activation, Phosphating, Passivation and Dry off Oven. Electrostatic Painting, Powder Coating

FOUNDRY SHOP
Induction furnace, Green Sand and Shell Moulding, Core Shooters, Shot Blasting, Hand Moulding

WELDING SHOP
Spot & Projection welding, Seam welding, Arc welding, MIG welding, Tube Cutting & Bending, Plasma cutting

PRESS SHOP
Shearing, Blanking, Piercing, Bending, Forming, Notching, Flaring, Squeezing, Drawing, Flattening, Punching, Trimming, Deep Drawing.

ENGINE ASSEMBLY
Conveyorised Engine and Gear Box assembly, Crank Shaft assembly, Magneto assembly,

GENERAL ASSEMBLY
Point Assembly customers products of

VEHICLE ASSEMBLY
Conveyorised Vehicle Assembly, Point Subassembly

FOUNDRY

10

Foundry, the most modern in this part of the country, can produce all grades of Grey Cast iron and S.G. iron castings with state of the art nodularisation process. The foundry has enough capacity to cater to the sophisticated castings requirements of the company and other prestigious customers like, BHEL, Railways, BEML, HAL, Ordnance Factories etc.

Induction Melting Furnace of 1.0 Ton capacity. Electronic Carbon and Silicon Analyser.

Shell Moulding facility includes three machines with a capacity to produce castings in a weight range of 500 gm. to 6 kg on a platen plate of 450x600 mm.

FACILITIES PROD

Three Core Shooter machines to produce cores for the shell moulds.

Green sand moulding facility includes two nos. Jolt Squeeze machines for castings up to 300x450x125 mm. in the weight range of 100 gms. to 6 kg.

Isothermal Annealing Furnace of 3 tons capacity for annealing of casings

DIE CASTING
Pattern shop in Foundry

11

The biggest Pressure Die Casting shop in this part of the country handles both Aluminum and Zinc Alloys. The metal is prepared in oil fired melting furnace and fed to electrically heated temperature controlled holding furnaces for the die casting machines. The molten metal from the holding furnace is poured into the machine through hand ladles. The shop is capable of producing aluminum and zinc alloy die castings in single and multi impression dies. The shop is assisted by chemical and metallurgical labs as also with a die maintenance section. The companys Tool Room manufactures and supplies the Die-casting dies for the shop.

Pressure die casting machines of 250, 400 and 1000


tons locking pressure.

PROD FACILITIES

Electrically heated temperature controlled holding furnaces of 75Kg and 150 Kg capacity

Two oil fired furnaces of 500 kg. metal melting capacity.

Shop is capable of producing aluminum die castings from 100 grams up to 5 kg in weight.

Die repair and maintenance section.

MACHINING

12

SIL has one of the biggest machine shops comprising of about 450 machines - Special Purpose and General Purpose in nature from indigenous as well as renowned manufacturers all over the world. A variety of operations like turning, copy turning, drilling, tapping, boring, grinding, honing, lapping, milling, thread milling, broaching, burnishing, gear shaping, hobbing, shaving, etc. are carried out there. The shop is well equipped to undertake manufacturing of spiral, helical and worm gears.

various types of centre, capstan, drum, turret and copy turning lathes, single and multi-spindle bar and chucking semiautomatic and automatic machines including a battery of HMT Mini-chuckers, drilling, precision boring, facing and centering machines,

FACILITIES PROD

various types of general purpose milling, cam milling, thread rolling, thread grinding and spline grinding machines grinding machines for surface, internal, external, cylindrical, face, profile and center less grinding operations, Micromatic honing machines, Centre lapping, cylindrical lapping and centre less super finishing machines, Horizontal and vertical, internal and external broaching machines for keyway, serrations, splines and profiles, Gear shaping, hobbing, tooth chamfering, shaving, grinding, honing machines and Gear Noise Testing machine well equipped to undertake manufacturing HEAThelical and worm gears, TREATMENT of spur,

13

The Heat Treatment shop is equipped with pollution free modern PLC controlled threestage Washing Machine and Sealed Quench Furnace of 500 Kg. capacity inclusive of fixture weight. Preparatory to heat treatment washing of items placed in jigs is done by dipping followed by spraying with temperature controlled hot alkaline solution in the first and second stages respectively and hot air drying in the third stage of the machine. The Sealed Quench Furnace is used for various operations like carburizing, case hardening, carbonitriding, direct hardening, annealing and normalizing of a wide variety of steels. Inspection of metallurgical properties of the heat treated items is invariably done before dispatching for use or to customers.

Three- stage Washing Machine Sealed Quench Furnace for: ocase carburizing,
o o ing, o o direct a hardening, case carbonitrid hardening,

FACILITIES

SHEET METAL FORMING


nnealing o norm The press shop is equipped with presses ranging to carry out all types of press operations namely shearing, blanking, piercing, bending, forming, drawing, deep drawing, flanging, curling alizing

14

etc. Components ranging from washer to cabin roof, door (1000 x 1200 mm), petrol tanks are processed in this shop.

PROD

Shearing machines of 3000 x 6 & 2500 x 3 mm. size Single action mechanical presses ranging from 15 tons to 200 tons capacity 170 ton double action presses 300 ton friction screw presses 450 and 550 ton press to accommodate multi station dies 10 ton EOT crane and fork lifts to handle dies Auxiliary shop for maintenance of tools and dies

FACILITIES

WELDING

15

The Welding shop is well equipped to carry out a variety of spot, projection, MIG, TIG, seam, arc and gas welding and brazing operations are extensively used. Close tolerance on welded structures are achieved through use of welding fixtures and receiver gauges.

Spot welding machines of 10, 15, 20, 25, 90, 100, 130 KVA capacity Portable spot welding machines

Projection welding machines of 50, 250, 300, 500 KVA capacity

FACILITIES PROD

MIG welding machines of a range of MMR ratings TIG welding machine Seam welding machines 100 KVA capacity Arc welding machines Abrasive cut off machines Pipe bending machines Manual sheet bending machine Plasma cutting machine

ASSEMBLY

16

The components manufactured in plant as well as those bought have to be finally assembled to make the product. The main assemblies viz. Engine, Gear Box and Vehicle for the three wheelers are done on speed adjustable conveyors where the conveyor speed can be adjusted to meet increasing demand. The sub-assemblies are done on point assembly fixtures. The requirements of the customers for their products are taken up in the general assembly section on point assembly fixtures.

PRODUCT

17

QUALITY
Quality is the heart and soul of the company, ISO 9001: 2000 certification is just a milestone with a clear concept in the minds of everyone in the company that Quality is the need of the hour and what customer expects. Quality in companys product is assured through following departments: 1. Incoming Quality 2. In-process Quality 3. Customer Quality The Central Laboratory is well equipped with chemical and metallurgical testing facilities including Universal Tensile Testing machine, Ericsson Cupping Tester, Hardness Testing machines, Shore Hardness Tester, Metallurgical Microscope, Salt Spray Tester etc.

DESIGN
Design department is the Prime Mover for the organization as the business today is customer driven. The department remains in constant touch with the customers to transplant their needs and thinking on the drawing board nay on the computer screen. The departments CAD Lab. is well equipped with latest Pro-Engineer Wildfire-3, Autodesk Inventor AIP-10 Professional and Auto CAD software systems. The prototype development and testing section has advanced instrumentation, testing rigs, engine dynamometers, exhaust gas analyser, vibration analyser and manufacturing facilities for prototypes, the companys R&D is recognized by the Ministry of Science and Technology, Govt. of India. It has the distinctions of developing first zero pollution electric 3-wheeler in the world

18

SUPPORTING DEPARTMENTS
The manufacturing activities in the company are well supported by various cross functional departments which regularly interact with each other as a cohesive team to enhance product quality and value to customers.

INFORMATI ON TECHNOLO GY PPC

MAINTENAN CE

DESIGN INDUSTRIAL ENGINEERIN G

TOOL ROOM

MANUFACTURI NG
PROUCTION ENGINEERI NG MARKETI NG MATERIA LS HUMAN RESOUR CE

MAINTENANCE The department has three functional areas of mechanical, electrical and civil maintenance sections which have established their capability over the years to fully meet the requirements of total productive maintenance, reliability and availability of the manufacturing facilities and upkeep of the plant and factory premises. The department has its exclusive maintenance workshops, air supply, water supply and uninterrupted power supply through a 33 KV substation.
19

INDUSTRIAL ENGINEERING The department caters to the plant, machinery and infrastructure requirements of the company, renewal and replacements etc. It has its separate fabrication section to manufacture supply material handling equipments which may be required urgently for use in the company.

PRODUCTION ENGINEERING The department plans and defines the processes, sequence of operations, related tooling design, jigs fixtures, press tools, foundry tooling, gauges etc., prepares standards for manufacturing of the existing and new products, trouble shooting of production problems and continuously improving the tooling and processes with latest technology. The department takes make or buy decisions, cost reduction and value engineering. It also arranges to provide all the relevant drawings and documentation to all the concerned user departments of the company. PRODUCTION PLANNING AND CONTROL The PPC department plans and makes available all the input materials for manufacturing the products as per the requirements of the customers received through the Marketing department. It ensures smooth flow of materials movement amongst the various manufacturing areas. INFORMATION TECHNOLOGY The entire company is equipped with Information Technology using latest software to provide facilities to all user departments and has connectivity with all regional offices. The information is updated on the companys website. MATERIALS The Materials department comprises of the purchase and stores functions. The department arranges for all the direct, indirect, consumables and capital goods requirements of the company at the right time, quality and quantity. The department is managed by qualified engineering and other personnel. MARKETING The Marketing department deals with the marketing and service requirements of its products through an all India network of its regional offices, dealers and service personnel for prompt and efficient delivery of its products and services. It provides regular feed back to the company on customer requirements and works for enhancing customer satisfaction. HUMAN RESOURCES
20

The quality has moved from product to process to people. Only good quality people can work out quality processes and provide quality product and services. Keeping this in view, the company has made HRD a key functional area.

OBJECTIVE
Designing a digital speedometer for the model VIKRAM 450D and 750D passenger and load carrier BH-III.

21

METHODOLOGY
The flow chart below explain the adopted methodology

22

Unit 5.Mechanical aspects


5.1 Transmission system

23

To design the digital speedometer the detailed study of the transmission system is obligatory. The speedometer is to be designed for the VIKRAM 450D and 750D BS-III model the block diagram of the transmission system is shown in the Fig 5.1.

Engine EOP

Lay Shaft Gears N1 N3

TOP

G1

Dog Clutch N3

Drive pinion N3

Reverse Gear sprocket

N4 N4 N4 N2 N2 PT wheel Cluster Gears Speedo pinion G2 N6 Speedo Crown Crown wheel Wheel N5

G3

N6

G4

N7

Fig 5.1 Transmission System (450D)

Description
The block diagram in Fig 5.1 gives a detail overview of the transmission system of the MODEL 450 D, where as D stand for diesel fueled engine
24

N - represent the RPM (Revolution per minute) G for gears

Table 5.1 Gear name EOP (engine output gear) PT wheel G1 G2 G3 G4 Speedo crown Speedo pinion Pinion Crown wheel Number of teeth 35 68 23 22 9 12 5 15 12 37

The fig 5.2 provides us the details about the gears in the gear box assembly, one of them is known as cluster gear and the other four gears are mounted on the lay shaft known as lat shaft gears. The 4, 3, 2 and 1 are the top, third, second and first gears respectively.

Lay shaft

Lay shaft Gears

Clusters Gears PT Wheel Shaft 4 3 2 1

Fig 5.2 Constant Mesh Gears Table 5.2 Cluster Gears 4 Pitch circle dia (mm) 65.23
25

Number of teeth 26

3 2 1 Table 5.3 Lay Shaft Gears 4 3 2 1

48.77 35.28 20.79

19 14 9

Pitch circle dia (mm) 73.09 89.85 103.33 117.33

Number of teeth 29 35 41 51

Transmission system layout for VIKRAM 750D model is similar except that the EOP is replaced with a flange and the instead of flywheel it is equipped with Dry Clutch. The detail of the gear ratios are given in the table 5.3 and 5.4 Table 5.3 Cluster Gears 4 3 2 1 Number of teeth 24 19 14 10

Table 5.4 Lay Shaft Gears 4 3 2 1 Number of teeth 31 35 41 50

Table 5.5 Gear name G1 G2 Number of teeth 23 22


26

G3 G4 Speedo crown Speedo pinion Pinion Crown wheel

8 14 10 15 10 41

5.2 Calculation
1.

Ratio of N5/N7

Now as we know that the gear G4 is the final speedodrive unit gear which enables us calculate the speed and distance. Here we will calculate the ratio of number of wheel rotation to that of G4 Formulae used are Pitch (P) of two gear in mesh is constant

P1 = d1/T1

and

P 2= d2/T2

P1 = P2
And the ratio of RPM is given by

d1/d1 = T1/T2

5.1

N1/N2 = d2/d1 = T2/T1 =

/2

5.2

The ratio of N5 by N7 is given by the relation

N5/N7 = N5/N3 X N3/N4 X N4/N6 X N6/N7

5.3

27

Using relation 1.2

N5/N7 = T3/T5 X T4/T3 X T6/T4 X T7/T6


Ratio for VIKRAM 450D Model

5.4

N5/N7 = 0.5436

5.5

Ratio for model 750D:

N5/N7 = 0.6124

2.

Number of revolution of wheel (N5) in 1 km


When, wheel diameter is 474 mm, Radius, R is 237 mm Distance travelled in 1 revolution = 2R Distance travelled = 1.48836 m Number of revolution in 1 km = 1000/1.48836 = 671.8804 So revolution of G4 w.r.t N5 is determined by using the relation 5.4 For 450D model

N7 = 1235.98
For 750D model

5.6

N7 = 1097.12

5.6a

Note: The relation 5.6 and 5.6a is used in the microcontroller programming for the calculation of the distance.

28

3.

Speed

For the calculation of speed we have used a combination 555 Timer and binary counters whose input is feed continuously microcontroller. As the microcontroller can handle a maximum of 8 bit of data at a time so the value for the minimum value of speed is display with the maximum number of count in the accumulator of the microcontroller.

Here, we count the number of pulse passed in one revolution of the gear G4 in the cascaded counter IC 7493, as the 555 Timer frequency and time period is known the time elapsed from one revolution to another is measured. So first of all we will have to calculate the frequency of 555 Timer for the calculation of the speed.

Formulae used are:


Relation .52 and 5.5 V5 = r5*5 T=2 /

For model 450D Table 5.6 Velocity at wheels (km/hr) V5 50 45 1 Angular velocity at wheel (rad/s) 5 58.5654 52.7426 1.1720 Angular velocity of G4 Time elapsed in (rad/s); 7= 5/0.5436 one revolution of G4 (seconds) T7 7 107.736 0.05832 97.024 2.155 0.06475 2.91563

Where, V5 - velocity at wheels 5 - angular velocity of wheels

29

T7 - time elapsed in 1 rev of G4 r - radius

So, when the vehicle is moving with velocity 1 km/hr the time elapsed in one revolution is 2.91563 sec and at the same time the counters must count the value 255 (11111111B, is maximum 8 bit binary combination), which will be the time period of the 555 Timer.

Time period = 2.91563/255 = 0.01143 sec

5.7

For model 750D Table 5.7 Velocity at wheels (km/hr) V5 50 45 1 Angular velocity at wheel (rad/s) 5 58.5654 52.7426 1.1720 Angular velocity of G4 Time elapsed in (rad/s); 7= 5/0.6124 one revolution of G4 (seconds) T7 7 95.632 0.06570 86.124 1.913 0.07295 3.28446

Where, V5 - velocity at wheels 5 - angular velocity of wheels T7 - time elapsed in 1 rev of G4 r - radius

So, when the vehicle is moving with velocity 1 km/hr the time elapsed in one revolution is 3.28446 sec and at the same time the counters must count the value 255 (11111111B, is maximum 8 bit binary combination), which will be the time period of the 555 Timer.
30

Time period = 3.28446/255 = 0.0128802 sec

5.7a

Unit 6.Analog to Digital Conversion


6.1 Sensor unit
The analog signal is to be converted into an equivalent digital signal. The two possible ways could be: 1. LED-Diode type sensor 2. MRE type sensor In this unit both the methods are explained in detail

LED-Diode Type Sensor


As explained in the mechanical aspects unit the rpm and angular velocity of the final drive gear G7 is to be measured for the calculation of speed and distance. All other variable are minimized and the results is dependent on the value obtained from sensor unit.

31

Description
A circular disc of fixed cross-section is mounted of the final drive gear shaft and a hole according to the diameter of the LED is drawn into the disc, a LED is mounted on one side of the disc symmetric to the hole and a photo diode is fixed parallely with the hole and the LED. The output pin of the photo diode in given to the OpAmp, as the output voltage is very low, it amplifies it to the desired voltage level of the circuitry. The output of the OpAmp is given to the pin1 of the IC 7404 (this IC is used as a delay function). The disc mounted on the G7 shaft rotates with the motion of the vehicle and when the LED and the hole are in line a voltage drop occurs and a voltage is produced at the output pin of photo diode

The circuit diagram is shown below

VCC (+5V) Hole G7


OpAm p

To Pin1 IC 7404

Crosssectional diode view of disc

Photo

Disc

LED
32

Fig 6.1 LED Type Sensor

Magnetic Resistance Element Type Sensor


The MIRE is driven by the output shaft on the transmission or output gear on a transaxle. This sensor uses a magnetic ring that revolves when the output shaft is turning. The MIRE senses the changing magnetic field this signal is conditioned inside the VSS to a digital wave. Here instead of a complete magnetic ring we use just a magnetic element which is coupled with the gear G4 which produces a signal every revolution. The circuit points 1, 2, 3 and 4 are kept at constant voltage. The point 2 and 4 are given to the comparator which is capable of detecting even the slightest change in magnetic field indicating by a voltage drop at the output. The circuit diagram is shown below:

Gear G4

Constant voltage Circuit

Vss

1 N S 2
MRE

4 33

To Pin1 IC7404

Comparator

Fig 6.2 MRE Sensor

6.2 Astable Multivibrator using 555 Timer IC

Fig 6.3 555 Timer IC The 555 has 8 pins and is usually packaged in an 8-lead Plastic Dual-in-Line Package (PDIP) as shown in Figure 1. Table 1 shows the typical characteristics of a 555 timer IC. The 555 is also available in the SOIC, MSOP, and metal can packages. The 555 timer is a very popular and versatile integrated circuit that includes 23transister 2 diodes 16 resisters 8-pin DIP (Dual In-line Package).

The dual version (two 555 timers in one IC package) of the 555 is called the 556. The quad version (four 555 timers in one IC package) of the 555 is called the 558.
34

The 555 timer may be operated in three primary modes: 1. As a monostable multivibrator, wherein it outputs a single pulse of predetermined pulse width; 2. As an astable multivibrator, wherein it outputs a continuous square wave of defined frequency; 3. As a bistable multivibrator, wherein it operates like a flip-flop. The 555 internals include two comparators, which sense voltage levels, and a flip-flop, which remembers which state it's supposed to be in. It's not necessary to dwell on these bits, so long as we understand how to use the chip as a whole.

Pin Diagram 555 timer IC

Fig 6.4 555 Timer pin diagram Table 6.1 Pin No. 1 2 3 GND is still the system ground. Trigger' is activated when given a signal less than 1/3 of the Vcc. Activating Trigger' sends the output to HIGH, and begins charging a storage cap (not pictured.) Out is the square wave output. Sometimes we'll want the square wave, sometimes we'll look elsewhere for the signal we want. Description/Function

35

Reset' resets the waveform. We won't be using it. Note, however, that the bar above the word Reset in the diagram indicates that the pin is active LOW. To deactivate the Reset', we'll need to tie it HIGH, to Vcc. Control is pictured on the pinout, but not on our schematic, since we won't be using it and can safely leave it unconnected. Threshold is activated when given a signal more than 2/3 of the Vcc. Activating Threshold sends the output to LOW, and begins discharging the storage cap. Threshold and Trigger' work in tandem to keep the output oscillating back and forth

Discharge provides a path to drain the storage capacitor, which happens when Threshold is activated. Vcc is the V+ of the system. We'll typically use 5-6V.

Table6.2 Typical Characteristics of the 555 Timer IC Supply voltage (VCC) Supply current @ VCC = +5 V; open output Supply current @ VCC = +15 V; open output Maximum Output Current Power Consumption Output Rise Time Output Fall Time Operating Temperature 4.5 V to 16 V 3 mA to 6 mA 10 mA to 15 mA 200 mA 600 mW 100 nano sec 100 nano sec 0 C to 70 C

555 Timer in Astable Multivibrator Mode


The 555 timer can generate a very wide frequency range, depending on the values of R1, R2 and C. The following figure shows how to choose the timing resistors

36

Fig 6.5 555 Timer in Astable Mode

Circuit Description
In the 555 Oscillator fig 6.5, pin 2 and pin 6 are connected together allowing the circuit

to re-trigger itself on each and every cycle allowing it to operate as a free running oscillator.

Pin 8 and 4 are shorted through Vcc, and the register R1 is employed between pin 8 and

pin 7. A zener diode (4148) is connected between pin 7 and pin 2, so that the capacitor C1 charges only through R1 register.

During each cycle capacitor, C charges up through timing resistors, R1 and discharges

itself through resistor R2 which is connected to Discharge terminal, pin 7.


37

Then the capacitor charges up to 2/3Vcc (the upper comparator limit) which is determined by the

T1=0.693(R1*C)

6.1

And discharges itself down to 1/3Vcc (the lower comparator limit) determined by the

T2=0.693(R2*C)

6.2

This results in an output waveform whose voltage level is approximately equal to Vcc 1.5V and whose output "ON" and "OFF" time periods are determined by the capacitor and resistors combinations.

upper limit = 2*Vcc/3 = 0.693*R*C1 lower limit = Vcc/3 = 0.693*R*C1

Design Equations

Period: 0.693*(R1+R2)*C Frequency: 1.44 / ((R1+R2)*C) Duty cycle: Time High / Time Low: (R1+R2) / R2

Where, R is in 's and C in Farads. When connected as an Astable Multivibrator, the output from the 555 Oscillator will continue indefinitely charging and discharging between 2/3Vcc and 1/3Vcc until the power supply is removed. As with the Monostable Multivibrator these charge and discharge times and therefore the frequency are independent of the supply voltage.

The output is in the form of a square wave as shown in the fig 6.6

38

Fig 6.6

Square wave

NOTE: R1 and R2 must not be circuit must accordance Best results are obtained with capacitors of 1000pF or larger, but used with lower values of R1 and R2.

minimum value less than 1K; the be designed in with the graph fig. smaller values can be

Fig 6.7 R Vs Hz graph


The maximum operating frequency is around 1 MHz, but best operation is

obtained below 300 kHz. The minimum operating frequency is limited only by the size and leakage of the capacitor you use. For instance, a 10F capacitor and a 3.3 M resistor will give a time interval of 23.1 seconds if the leakage of the capacitor is low enough. By making R2 large with respect to R1, we can get an essentially symmetrical square-wave output. For instance, if R1 is 1K and R2 is 1M, the difference in charging and discharging resistance is only 0.1%, and good symmetry results. Any symmetry
39

you want from 50% through 99.9% can be obtained by a selection of the ratio of R1 and R2. Only a small frequency variation occurs due to power supply variation but variation due to temperature changes is large, so any precise instrumentation project require more stable crystal clock.

Theoretical Design Calculation


An Astable 555 Oscillator is constructed using the following components, Time period = 11.43 ms (450D) and 12.88 ms (750D)

R1 = R2 =????K and capacitor C = 10uF. Calculate the resistance value for the given time period of the 555 oscillator and the duty cycle of the output waveform. T1 - Charge time ("ON") is calculated as: 5.715 ms (450D) and 6.44 ms (750D)

T2 - Discharge time ("OFF") is calculated as: 5.715 ms (450D) and 6.44 ms (750D)

The resistance is given by relation 5.1 and 5.2 R1 = T1/0.693*C = 1.649 K (450D) And K) The Output Frequency: 450D - 87.48 Hz and 750D 77.63 Hz and 1.858 K (750D)

R1 = R2 = 1.649 K (450D) and 1.858 K (750D) (use a variable register of 2

Giving a Duty Cycle value of: 50% As the timing capacitor, C charges through resistors R1 and discharges through resistor R2 the output duty cycle can be varied between 50 and 100% by changing the value of resistor R2, but is kept 50% by short circuiting R2 via zener diode (IC4148). But in other cases decreasing the value of R2 the duty cycle increases towards 100% and by increasing R2 the duty cycle reduces towards 50%. If resistor, R2 is very large relative to resistor R1 the output frequency of the 555 Oscillator circuit will determined by R2.C only. The problem with this
40

basic Astable 555 Oscillator circuit is that the duty cycle, the "Mark-to-Space" ratio will never go below 50% as the presence of resistor R2 prevents this. In other words we cannot make the "ON" time shorter than the "OFF" time as (R1 + R2)C will always be greater than R1*C.

Lab Procedures
Creating a clock source In this part, we will connect the 555 timer to generate an oscillator which can be used as a clock source.
1. Use astable multivibrator circuit configuration given (use a 5-volt supply), determine

values for R1, R2 and C to obtain a frequency between desired frequency in Hz. 2. A zener (IC4148) diode is used to obtain the duty cycle of 50%. Show your calculation. R1 = 1.649K (450D) R2 = 1.649K (450D) C = 10 F

and and

1.858 K (750D) 1.858 K (750D)

Charge time (output high) = 5.715 ms (450D) Discharge time (output low) = 5.715 ms (450D)

and

6.44 ms (750D)

and

6.44 ms (750D)

Period = 11.43 ms (450D) and 12.88 ms (750D) Frequency = 450D - 87.48 Hz and 750D 77.63 Hz 2. Assemble the circuit. 3. Use an oscilloscope to display the output waveform. Obtain following data from The output waveform is displayed by using an oscilloscope. Period = ______________sec. Frequency = _____________sec. If it is not close to your calculated value, make necessary adjustments and attempt to explain why??

6.3 COUNTERS
In digital logic and computing, a counter is a device which stores (and sometimes displays) the number of times a particular event or process has occurred, often in relationship to a clock signal. In practice, there are two types of counters:

Up counters, which increase (increment) in value


41

Down counters, which decrease (decrement) in value

In electronics, counters can be implemented quite easily using register-type circuits such as the flip-flop and a wide variety of designs exist, e.g.: Asynchronous (ripple) counter changing state bits are used as clocks to subsequent state flip-flops

Synchronous counter all state bits change under control of a single clock Decade counter counts through ten states per stage Updown counter counts both up and down, under command of a control input Ring counter formed by a shift register with feedback connection in a ring Johnson counter a twisted ring counter Cascaded counter

Each is useful for different applications. Usually, counter circuits are digital in nature, and count in natural binary. Many types of counter circuit are available as digital building blocks, for example a number of chips in the 4000 series implement different counters.

Occasionally there are advantages to using a counting sequence other than the natural binary sequencesuch as the binary coded decimal counter, a linear feedback shift register counter, or a Gray-code counter. Counters are useful for digital clocks and timers, and in oven timers, VCR clocks, etc.

Asynchronous (ripple) counter


No state

42

J clock Q0

J Q0

Fig 6.8 Ripple counter

An asynchronous (ripple) counter is a single D-type flip-flop, with its D (data) input fed from its own inverted output. This circuit can store one bit, and hence can count from zero to one before it overflows (starts over from 0). This counter will increment once for every clock cycle and takes two clock cycles to overflow, so every cycle it will alternate between a transition from 0 to 1 and a transition from 1 to 0. Notice that this creates a new clock with a 50% duty cycle at exactly half the frequency of the input clock. If this output is then used as the clock signal for a similarly arranged D flip-flop (remembering to invert the output to the input), you will get another 1 bit counter that counts half as fast. Putting them together yields a two bit counter: Table 6.1 Cycle 0 1 2 3 4 Q1 0 0 1 1 0
43

Q0 0 1 0 1 0

(Q1:Q0)dec 0 1 2 3 0

You can continue to add additional flip-flops, always inverting the output to its own input, and using the output from the previous flip-flop as the clock signal. The result is called a ripple counter, which can count to 2n-1 where n is the number of bits (flip-flop stages) in the counter. Ripple counters suffer from unstable outputs as the overflows "ripple" from stage to stage, but they do find frequent application as dividers for clock signals, where the instantaneous count is unimportant, but the division ratio overall is. (To clarify this, a 1-bit counter is exactly equivalent to a divide by two circuit; the output frequency is exactly half that of the input when fed with a regular train of clock pulses). The use of flip-flop outputs as clocks leads to timing skew between the count data bits, making this ripple technique incompatible with normal synchronous circuit design styles.

Synchronous counter

Fig 6.9 A 4-bit synchronous counter using JK flip-flops A simple way of implementing the logic for each bit of an ascending counter (which is what is depicted in the image to the right) is for each bit to toggle when all of the less significant bits are at a logic high state. For example, bit 1 toggles when bit 0 is logic high; bit 2 toggles when both bit 1 and bit 0 are logic high; bit 3 toggles when bit 2, bit 1 and bit 0 are all high; and so on.

44

Synchronous counters can also be implemented with hardware finite state machines, which are more complex but allow for smoother, more stable transitions. Hardware based counters are of this type.

Decade counter
A decade counter is one that counts in decimal digits, rather than binary. A decimal counter may have each digit binary encoded (that is, it may count in binary-coded decimal, as the7490 integrated circuit did) or other binary encodings (such as the bi-quinary encoding of the 7490 integrated circuit). Alternatively, it may have a "fully decoded" or one-hot output code in which each output goes high in turn; the 4017 was such a circuit. The latter type of circuit finds applications in multiplexers and demultiplexers, or wherever a scanning type of behaviour is useful. Similar counters with different numbers of outputs are also common. The decade counter is also known as a mod-counter.

Updown counter
A counter that can change state in either direction, under the control of an updown selector input, is known as an updown counter. When the selector is in the up state, the counter increments its value, when the selector is in the down state, the counter decrements the count. Of the above counters we have to use two 4 bit ripple counter for counting the pulse generated from 555 timer and the BCD counters for the display of the distance and speed. The description of ripple counter 7493 and cascading it for 8 bit counting circuit is explained below in detail. The BCD counter and its application will be discussed in detail later.

IC 7493
Pin diagram 7493

1 45

1 1 1 1 1

2 3 4 5 6 7 9 8

Fig 5.10 Pin diagram IC 7493

Pin Description
Table 5.2 PIN NUMBER 1 2 3 4,6,7,13 5 8 9 10 11 12 14 FUNCTION Clock B, clock to internal next JK flip-flop Reset pin 1 termed as R01 Reset pin 2 termed as R02 Dont care pins Vcc ( +5V to +15V) Output QC Output QB Ground (GND) Output QD Output QA Clock A, this is the enable clock
14

Cascading 1 Counters
CLKA CLKB To Pin 3 of 555 Timer To Pin 4 of IC 46

R01 (2) 12 R02 (3) 11 5 9 IC-

14 1 CLKA CLKB IC-7493(2) LSB MSB R01 (2) 12 R02 (3) 11 5 9 LS MSB

HIGH

Fig 6.11 Cascading counter NOTE: Only intersecting lines of the same color are shorted The circuit shows the pin connection for cascading two 4 bit counters, the resultant output is 8 bit binary a decimal equivalent up to 255 counts can be obtained.

Circuit Description
The counter connected with the 555 timer is the primary counter and the other one is secondary counter Pin 12 and 8 of each counter are shorted which provides the clock pulse to the next JK flip-flop in the IC 7493
47

Pin 11 of primary counter is connected with the Pin 14 of the secondary counter as the enable clock, the Pin 11 of IC-7493 facilitate cascading of counters Reset/count function table Table 6.3 R01 H L X R02 H X L QD L Count Count QC L Count Count QB L Count Count QA L Count Count

For the counter to count at least one of the reset pin must be available with LOW input, to reset the counter both the R01 and R02 must be high.

6.4 Shift Registers


In digital circuits, a shift register is a cascade of flip flops, sharing the same clock, which has the output of anyone but the last flip-flop connected to the "data" input of the next one in the chain, resulting in a circuit that shifts by one position the one-dimensional "bit array" stored in it, shifting in the data present at its input and shifting out the last bit in the array, when enabled to do so by a transition of the clock input. More generally, a shift register may be multi dimensional, such that its "data in" input and stage outputs are themselves bit arrays: this is implemented simply by running several shift registers of the same bit-length in parallel. Shift registers can have both parallel and serial inputs and outputs. These are often configured as serial-in, parallel-out (SIPO) or as parallel-in, serial-out (PISO). There are also types that have both serial and parallel input and types with serial and parallel output. There are also bi-directional shift registers which allow shifting in both directions: LR or RL. The serial input and last output of a shift register can also be connected together to create a circular shift register.

48

Serial-in, parallel-out (SIPO)


This configuration allows conversion from serial to parallel format. Data is input serially, as described in the SISO section above. Once the data has been input, it may be either read off at each output simultaneously, or it can be shifted out and replaced.

Fig 6.12 4-bit SISO Shift Register

Parallel-in, serial-out (PISO)


This configuration has the data input on lines D1 through D4 in parallel format. To write the data to the register, the Write/Shift control line must be held LOW. To shift the data, the W/S control line is brought HIGH and the registers are clocked. The arrangement now acts as a PISO shift register, with D1 as the Data Input. However, as long as the number of clock cycles is not more than the length of the data-string, the Data Output, Q, will be the parallel data read off in order.

49

Fig 6.13 4-Bit PISO Shift Register

Serial-in, serial-out (SISO)


These are the simplest kind of shift registers. The data string is presented at 'Data In', and is shifted right one stage each time 'Data Advance' is brought high. At each advance, the bit on the far left (i.e. 'Data In') is shifted into the first- flip-flops output. The bit on the far right (i.e. 'Data Out') is shifted out and lost. The data are stored after each flip-flop on the 'Q' output, so there are four storage 'slots' available in this arrangement, hence it is a 4-Bit Register. To give an idea of the shifting pattern, imagine that the register holds 0000 (so all storage slots are empty). As 'Data In' presents 1, 0, 1, 1, 0, 0, 0, 0 (in that order, with a pulse at 'Data Advance' each time.. So the serial output of the entire register is 10110000.This arrangement performs destructive readout - each datum is lost once it been shifted out of the right-most bit. Table 6.4 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 0
50

0 0 0 0 1 0 1 1 0

Parallel In Parallel Out (PIPO)


This type of shift registers take up the parallel load at a clock and the data is output parallely at the same clock pulse, as shown in the fig 2.8

Parallel load CLK


1 0 0 1
1

Parallel output

1
1

Fig 6.14 4-bit PIPO Shift Register

IC 74198
Description
The 198 features synchronous parallel load ,hold, shift right and shift left modes, as determined by the select (S0, S1)inputs. State changes are initiated by th rising edge of the clock. An asynchronous Master Reset (MR) input overrides all other input and clears the registers. The 198 is useful for serial-serial, serial-parallel, parallel-serial and parallel register transfer. Parallel in/parallel out Synchronous parallel load Shift right and shift left capability Asynchronous overriding clear

51

Pin diagram

Fig 5.15 Pin diagram IC 74198

Pin description
Table 6.5 Pin no 1,23 2 3, 5, 7, 9, 15, 17, 21 and 23 4, 6, 8, 10, 14, 18, 20 and 22 11 12 13 22 24 Description/Function S0,S1, mode select inputs DSR, Serial data input (shift right) P0-P7, Parallel data input Q0-Q7,Flip-flop outputs Clock GND MR (Master Reset, active low) DSL, Serial data input (shift left) Vcc (+5V to +15V)
52

Mode select table


Table 6.6 MR L H H H H X CP X S0* X H L H L S1* X H H L L Response Asynchronous reset; output = low Parallel Load; Pn Shift Right; DSR Shift Left; DSL Hold Q0, Q0 Q7, Q7 Qn Q1, etc. Q6, etc.

Circuit daigram for connection with counters and microcontroller


HIGH Vcc

1 24 4 3 6 5 8 7 10 9 14 15 16 17 Fig 6.16 53

23

Output from ICs 7493

To IC 8051 Pin1-Pin7

To Sensor Pulse

GND

Unit 7.Microcontrollers
Microcontrollers are embedded processors. The fixed amount of on-chip ROM, RAM, and number of I/O ports makes them ideal for many applications in which cost and space are critical. In many applications, the space it takes, the power it consumes, and the price per unit are much more critical considerations than the computing power Microcontroller has CPU (microprocessor) RAM ROM I/O ports Timer ADC and other peripherals 8-bit microcontrollers Motorolas 6811 Intels 8051 Zilogs Z8 Microchips PIC There are also 16-bit and 32-bitmicrocontrollers made by various chip makers.Meeting the computing needs of the task at hand efficiently and cost effectively Speed Packaging Power consumption The amount of RAM and ROM on chip The number of I/O pins and the timer on chip How easy to upgrade to higher performance or lower power-consumption versions Cost per unit

7.1 IC 8051
The 8051 is an 8-bit processor, the CPU can work on only 8 bits of data at a Time. The 8051 had 128 bytes of RAM 4K bytes of on-chip ROM Two timers One serial port Four I/O ports, each 8 bits wide 6 interrupt sources

54

Architecture of 8051

Fig 7.1 Architecture of 8051

55

Pin diagram

Fig 7.2 Pin diagram IC 8051

Pin description
Table 7.1 Pin No. 1, 2, 3, 4, 5, 6, 7 and 8 9 10 11 12 13 Description/Function Port 1, input/output data pins RST (Reset) P3.0; RXD (Serial input port) P3.1; TXD (Serial output port) P3.2; INT0 (External interrupt 0) P3.3; INT1 (External interrupt 1)
56

14 15 16 17 18 19 20 21, 22, 23, 24, 25, 26, 27 and 28 29 30 31 32, 33, 34, 35, 36, 37, 38 and 39 40 Where,

P3.4; T0 (Timer 0 external input) P3.5; T1 (Timer 1 external input) P3.6; WR (external data memory write strobe) P3.7; RD (external data memory read strobe) XTAL2, Input to the inverting oscillator amplifier XTAL1, Output from the inverting oscillator amplifier Vss , GND Port 2/High order Address Lines for external data or program memory PSEN (read strobe to external program memory) ALE (address latch enable) PROG (programming an external EEPROM, active low) EA (external access enable) Port 0/ Low order address lines for external data or program memory Vcc (5V to 15V)

PORT

Port number

Pin Number

57

7.2 Programming
The microcontroller can understand only LLL (Low Level Language, i.e. 0s and 1s), the following programme will calculate the speed and distance and will display the output on a 7 Segment LED when burned into the microcontroller IC 8051. Instruction and its functioning are explained in the programme.

MAIN:

ORG 0000H MOV R1, #00H MOV R2, #00H

// LOAD PC WTH ADDRESS OOOOH // FOR DISTANCE CALCUTATION

START 1:

MOV R3, #0D4H (#4AH) MOV R4, #04H (#04H)

//constant for distance model 450D is 1236 //for 750D, constant is 1098 //CLEAR ACCUMULATOR //FOR INITIALIZING THE PORT //data is send to the port1 latch //input from the port //value of accumulator is stored in register R0 //as well as is stored in registers R7 //A and R0 are put to XOR gate to check whether // any data is obtained using a jump condition

CHECK:

CLR A MOV A, #0FFH MOV P1, A MOV A, P1 MOV R0, A MOV R7, A XRL A, R0 JZ CHECK MOV R0, #00H SJUMP SPEED SJUMP DISTANCE SJUMP CHECK

//call subroutine SPEED //call subroutine DISTANCE //jump to CHECK //move the counter value in R7 to ACC //move the value to register B
58

SPEED:

MOV A, R7 MOV F0, A

MOV A, #0FFH DIV AB MOV R0, A SETB P2.2 CLR P2.2 LOOP: SETB P2.0 CLR P2.0 DJNZ R0, LOOP CLR A RET DISTANCE: DJNZ R3, NEXT DJNZ R4, NEXT INC R2 CJNE R2, #00H, NEXT1 INC R1 NEXT1: SETB P2.1 CLR P2.1 SJUMP AGAIN NEXT: RET

//FFH is hex code = 255D const for speed //calculated speed //store the results in register R0 //reset the speed display unit //clear the bit //calculate the speed

//loop runs until the speed is displayed //clear accumulator //return from subroutine SPEED //decrement R3, jump if not zero to NEXT // decrement R4, jump if not zero to NEXT //increment register R2, if R4 is zero //compare R2 with zero, jump to NEXZT1 if //not //equal //increment R1 //provide a positive pulse to the distance counter //clear the pulse //jump too AGAIN //return from subroutine DISTANCE

Note: To program the microcontroller for any vehicle just register values of R3 and R4
are needed to be altered and an appropriate frequency of 555 Timer must be selected, as calculated for the given model.

59

Unit 8 Display
7.1 BCD COUNTERS
In computing and electronic systems, binary-coded decimal (BCD) (sometimes called natural binary-coded decimal, NBCD) or, in its most common modern implementation, packed decimal, is an encoding for decimal numbers in which each digit is represented by its own binary sequence. Its main virtue is that it allows easy conversion to decimal digits for printing or display, and allows faster decimal calculations. Its drawbacks are a small increase in the complexity of circuits needed to implement mathematical operations. Uncompressed BCD is also a relatively inefficient encodingit occupies more space than a purely binary representation. In BCD, a digit is usually represented by four bits which, in general, represent the decimal digits 0 through 9. Other bit combinations are sometimes used for a sign or other indications (e.g., error or overflow). Although uncompressed BCD is not as widely used as it once was, decimal fixedpoint and floating-point are still important and continue to be used in financial, commercial, and industrial computing. Recent decimal floating-point representations use base-10 exponents, but not BCD encodings. Current hardware implementations, however, convert the compressed decimal encodings to BCD internally before carrying out computations. Software implementations of decimal arithmetic typically use BCD or some other 10n base, depending on the operation. Basics To encode a decimal number using the common BCD encoding, each decimal digit are stored in a 4-bit nibble: Table 8.1 Decimal: 0 BCD: 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001

Thus, the BCD encoding for the number 127 would be: 0001 0010 0111 Whereas the pure binary number would be: 0111 1111
60

BCD in Electronics
BCD is very common in electronic systems where a numeric value is to be displayed, especially in systems consisting solely of digital logic, and not containing a microprocessor. By utilizing BCD, the manipulation of numerical data for display can be greatly simplified by treating each digit as a separate single sub-circuit. This matches much more closely the physical reality of display hardwarea designer might choose to use a series of separate identical sevensegment displays to build a metering circuit, for example. If the numeric quantity were stored and manipulated as pure binary, interfacing to such a display would require complex circuitry. Therefore, in cases where the calculations are relatively simple working throughout with BCD can lead to a simpler overall system than converting to binary. The same argument applies when hardware of this type uses an embedded microcontroller or other small processor. Often, smaller code results when representing numbers internally in BCD format, since a conversion from or to binary representation can be expensive on such limited processors. For these applications, some small processors feature BCD arithmetic modes, which assist when writing routines that manipulate BCD quantities.

Table 8.2 Sign Digit A B C D E F BCD 8421 1010 1011 1100 1101 1110 1111 Sign + + + + Unsigned Preferred Preferred Notes

No matter how many bytes wide a word is, there is always an even number of nibbles because each byte has two of them. Therefore, a word of n bytes can contain up to (2n) 1

61

decimal digits, which is always an odd number of digits. A decimal number with d digits requires (d+1) bytes of storage space.

IC 4033
Description
The 4033B are monolithic integrated circuits, available in 16-lead dual in-line plastic or ceramic package and plastic micro package. The each consist of a 5-stage Johnson decade counter and an output decoder which converts the Johnson code to a 7-segment decoded output for driving one stage in a numerical display. These devices are particularly advantageous in display applications where power dissipation low and/or low package count are important. Input types are CLOCK, RESET, & CLOCK INHIBIT; outputs are CARRY OUT and the seven decoded outputs (a, b, c, d, e, f, and g), additional inputs and outputs. Signals peculiar to the HCC/HCF4033B are RIPPLE-BLANKING INPUT AND LAMP TEST INPUT and a RIPPLEBLANKING OUTPUT.

Fig 8.1 Pin diagram IC 4033

Pin description
Table 8.3 Pin Number 1 2 3 4 5 8 14 Description/Function Clock Clock Inhibit Ripple Blanking IN Ripple Blanking OUT Carry Out VSS, GND Lamp Test
62

15 16 10, 12, 13, 9, 11, 6, 7

Reset VDD, Supply Voltage Output to 7 segment LED (a,b,c,d,e,f,g,h)

Cascading IC 4033
To Pin 1 of the next 4033 in series

To 7 segment LED
10 12 13 9 11 6 7 5

IC 4033 (2)

16

14

15

To 7 segment LED
10 12 13 9 11 6 7 5

IC 4033 (1)

16

14

15

To Microcontroller (8051)
63

VDD 5V to 15V

Reset HIGH

Fig 8.2 Cascaded IC 4033B

8.2 7 Segment LED (IC SP5503 HI-LITE)


Description The 14.2 mm (0.56) LED seven segment displays are designed for viewing distances and speed. These devices use the industry standard package and pinout. Both the numeric and 1 overflow devices features a right hand decimal point. All devices are available as either common cathode or common anode. Pin diagram

Fig 8.3 IC SP5503

64

Fig 7.4

INTEGRATING THE CIRCUIT

Pin14 (of first 7493)

555
PinTimer 3

Counter Circuit (Two 7493)

Sensor output Sensor Unit

IC 7404

74198
Shift Register

30F =

= 30F Crystal 12MHz

Pin18

Pin19

Microcontroller IC 8051
Pin21 Pin23 65 Pin22

It is a group of three 4033B to display speed connected with Pin21 of IC8051

It is a group of five 4033B to display distance is connected with Pin22 of IC8051

7 Segment LED Fig 8.5 Circuit integration Note: For pin connections refer the previous chapters

7 Segment LED

Circuit Description
When a voltage drop occurs across the photo diode or the magnetic pip unit, as the voltage drop is very low it is given to the Operational amplifier which amplifies the voltage upto 5V.
The output is provided to the Pin1 of the IC 7404 and also to the Pin11 of IC 74198 (shift

register).
IC7404 is used to create a propagation delay so that data is transferred to the shift register

before the next pulse.

Pin4 of the IC7404 is connected to each of the IC 7493 which resets the counter for every positive edge of the pulse and at the same time 555 timer which is connected to IC7493(1) via Pin3 to Pin14, provides a clock to the counter which is incremented in a time interval of 27.231ms.

The Pin11 of the IC74198 is connected directly to the sensor pulse, which enable the IC to input and output data, the Pin1 and 23 are made HIGH which select the PIPO mode for the IC.
Pin31 of IC8051 must be connected with Pin40 of IC8051, when the programme is

written in the internal Flash memory of the microcontroller.


The Pins 4, 6, 8, 10, 14, 16, 18, 20 are the input data pins of IC74198 which are

connected to Pins 12, 9, 8, 11,12, 9, 8 and 11 of IC7493 (1) and IC7493(2) respectively

The Pins 3, 5, 7, 9, 15, 17, 19 and 21 are connected to the Port1 of IC8051 i.e. Pins 1, 2, 3, 4, 5, 6, 7 and 8.

66

The Pin21 of IC8051 is given to the IC4033B Pin1 for the display of speed similar the

Pin22 is connected to Pin1 of another set of cascaded IC4033B for displaying distance
Pin23 of IC8051 is connected with Pin15 of each IC4033B used for displaying speed

which reset the counters after each display to zero for the next output, while the same pins of cascaded IC4033B are kept untouched for distance.

7 segment LED ICSP5503 is attached with each of the IC4033B via Pins 10, 12, 13, 9, 11, 6 and 7 to Pins 7, 6, 4, 2, 1, 9 and 10 of ICSP5503 with a resistance of 220 ohm across each pin. And the Pin5 of each ICSP5503 is grounded for common cathode.

Functioning
The 555 timer acts as a astable pulse generator and the counter counts the number of pulse passed in each revolution of the gear G4. It pass the count to the shift register which shift them into the microcontroller, where the speed and distance are calculated using a definite programming module and are display on the 7 segment LED. This system is capable of displaying speed upto 50km/hr and distance upto 99999 km.

Conclusion
1. Cost reduction The former conventional type mechanical model and the new digital model.

Cost comparison Mechanical model (in Rupees) 250-300 Digital model (in rupees) 400-600

But a lot of cost which adds in warranty due to wear and tear of the various parts like the control cable, and various consequential problems like to check the required torque of the control cable, to monitor the spring tension for speedometer and many more will be eliminated by adopting the new digital speedometer. The digital speedometer could made much cheaper and with less circuitry by using an advanced microcontroller like ATMEGA16

67

2. Compatibility

Its compatible with all the existing model of the VIKRAM and could be embedded on any vehicle with slight modification in programming after a detail study of the transmission system of the vehicle.

3. Accurate and precise

The system is much more accurate than the conventional mechanical speedometer, it will calculate the speed accurately throughout its operation and will produce no error as long as it is used, which is far-far better than the mechanical speedometer.

4. Upgradation LED display could be improvised to LCD display Upgrading 8051 to ATMEGA16 or any other 16 bit microcontroller, for better accuracy and for high speed vehicles

References
1. Jain and Floyd, Digital Fundamental, 2005 2. Dr. Morrison, Digital Electronics,1998 3. Hall, Dauglas, Microprocessors and microcontrollers 4. Ali Mazidi, Muhammad and Gillispie Mazidi, Janice, The 8051 Microcontroller and

Embedded System, 2000.


68

5. Electronics, Electronics for You, Magazine, June 2010 and August 2010. 6. Web links:

www.wikipedia.com www.google.com www.raio.com.tw www.itgear.in www.alldatasheet.com Electronics Club Home Page www.efy.com Mahesh Wankhedes Online Tutorial http://8051 Tutorial Timers - 8052.com - Copy.htm http://8051 microcontroller hardware interfacing tutorials- basic circuit for 8051.htm Interfacing 7-segment display using 7447 decoder electrofriends.com.htm Electronics-Tutorials.ws/555 Oscillator (Astable Multivibrator).htm, Written by Wayne Storr. www.electrofriends.com http://The 8051 Instruction Set - Architecture and Programming of 8051 MCU mikroElektronika.htm

7. Reference books

Microcontrollers with Nano Watt Technology 74HC590 8-bit binary counter with output register; 3-state

69

You might also like