chandu 2003

86
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 1

Upload: gaurav-arora

Post on 14-Sep-2014

125 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: chandu 2003

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 ShekharR140207014

Automotive Design Engineering

Mechanical Engineering Department

College of Engineering

University of Petroleum and Energy Studies, Dehradun

1

Page 2: chandu 2003

SCOOTERS INDIA LIMITED (A Government of India Enterprise)

Summer Internship Project

2

Page 3: chandu 2003

INTERNSHIP REPORTDesign 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: 4 months (2 June, 2010 to 2 October, 2010)

3

Page 4: chandu 2003

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

4

Page 5: chandu 2003

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

5

Page 6: chandu 2003

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 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.

6

Page 7: chandu 2003

TABLE OF CONTENTChapter Topic Page No.

1.0 Abstract 6

2.0 Introduction to Scooters India Limited 8

3.0 Objective 20

4.0 Methodology 21

5.0 Mechanical aspects 5.1 Transmission system5.2 Calculations

222224

6.0 Analog to Digital Conversion 6.1 Sensor unit6.2 555 timer6.3 Counters6.4 Shift registers

2727303743

7.0 Microcontroller 7.1 IC 80517.2 Programming of 8051

515155

8.0 Display 8.1 BCD counters8.2 7 segment LED8.3 Integration of the circuit

575762

9.0 Conclusion 65

10.0 References 66

THE COMPANY PROFILE

7

Page 8: chandu 2003

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

8

Page 9: chandu 2003

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.

FOUNDRY

9

MACHINE SHOPMilling, 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.

MACHINE SHOPMilling, 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 TREATMENTWashing, Hardening, Tempering, Case Carburising, Case hardening, Oil Quenching

HEAT TREATMENTWashing, Hardening, Tempering, Case Carburising, Case hardening, Oil Quenching

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

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

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

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

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

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

ENGINE ASSEMBLYConveyorised Engine and Gear Box assembly, Crank Shaft assembly, Magneto assembly,

ENGINE ASSEMBLYConveyorised Engine and Gear Box assembly, Crank Shaft assembly, Magneto assembly,

SURFACE TREATMENT & PAINTPre-treatment line with 12 tank dipping process for Degreasing, De-rusting, Rinsing, Activation, Phosphating, Passivation and Dry off Oven.

Electrostatic Painting, Powder Coating

SURFACE TREATMENT & PAINTPre-treatment line with 12 tank dipping process for Degreasing, De-rusting, Rinsing, Activation, Phosphating, Passivation and Dry off Oven.

Electrostatic Painting, Powder Coating

DIE CASTING SHOPAluminium and Zinc Alloy Pressure die Casting

DIE CASTING SHOPAluminium and Zinc Alloy Pressure die Casting

VEHICLE ASSEMBLYConveyorised Vehicle Assembly, Point Sub-assembly

VEHICLE ASSEMBLYConveyorised Vehicle Assembly, Point Sub-assembly

GENERAL ASSEMBLYPoint Assembly of customer’s products

GENERAL ASSEMBLYPoint Assembly of customer’s products

Page 10: chandu 2003

PRODUCT RANGE

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.

DIE CASTING

10

FACILITIES

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.

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

Pattern shop in Foundry

Assisted by well equipped Tool Room of the company for foundry tooling.

Page 11: chandu 2003

PRODUCT RANGE

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 company’s Tool Room manufactures and supplies the Die-casting dies for the shop.

MACHINING

11

FACILITIES

Pressure die casting machines of 250, 400 and 1000 tons locking pressure.

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.

Shop is assisted by chemical and metallurgical labs and Tool Room for pressure Die casting Die manufacturing.

Page 12: chandu 2003

PRODUCT RANGE

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.

HEAT TREATMENT

12

FACILITIES

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,

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 of spur, helical and worm gears,

Miscellaneous machines like Magnetic crack

detection machine, marking and balancing machines

Page 13: chandu 2003

The Heat Treatment shop is equipped with pollution free modern PLC controlled three- stage 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.

SHEET METAL FORMING

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

13

FACILITIES

Three- stage Washing Machine

Sealed Quench Furnace for:

o case carburizing,

o case hardening,

ocarbonitriding,

odirect hardening,

oannealing

onormalizing

of a wide variety of steels

Hardness testing machines

Facility for checking case depth and Microstructure

Page 14: chandu 2003

PRODUCT RANGE

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

WELDING

14

FACILITIES

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

Page 15: chandu 2003

PRODUCT RANGE

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.

ASSEMBLY

15

FACILITIES

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

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

Electrode drying machine

Number punching machine

Page 16: chandu 2003

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 RANGE

QUALITY

16

Page 17: chandu 2003

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 company’s product is assured through following departments:

1. Incoming Quality2. In-process Quality3. 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 department’s 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 company’s 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

SUPPORTING DEPARTMENTS

17

Page 18: chandu 2003

MANUFACTURINGMANUFACTURING

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.

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.

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

18

DESIGNDESIGN

MARKETING

MARKETING

PROUCTION ENGINEERING

PROUCTION ENGINEERING

TOOL ROOMTOOL ROOM

MAINTENANCEMAINTENANCE

PPCPPC

HUMAN RESOURCE

HUMAN RESOURCE

INDUSTRIAL ENGINEERING

INDUSTRIAL ENGINEERING

MATERIALSMATERIALS

INFORMATION TECHNOLOGY

INFORMATION TECHNOLOGY

Page 19: chandu 2003

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 company’s 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

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.

19

Page 20: chandu 2003

OBJECTIVE

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

20

Page 21: chandu 2003

METHODOLOGYThe flow chart below explain the adopted methodology

21

Page 22: chandu 2003

Unit 5.Mechanical aspects

5.1 Transmission system

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 TOP G1 Dog Clutch Drive pinion

Reverse Gear N1 N3 N’3 sprocket N3’’

N’4

N’4 N5

N4

N2’ G2 N2 N6

PT wheel Cluster Gears Speedo pinion Speedo Crown Crown wheel

G3 N’6

G4 N7

Fig 5.1 Transmission System (450D)

22

Wheel

Page 23: chandu 2003

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 N - represent the RPM (Revolution per minute) G – for gears

Table 5.1

Gear name Number of teethEOP (engine output gear) 35PT wheel 68G1 23G2 22G3 9G4 12Speedo crown 5Speedo pinion 15Pinion 12Crown wheel 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.

4 3 2 1 Lay shaft

Lay shaft Gears

Clusters Gears

PT Wheel Shaft

4 3 2 1

Fig 5.2 Constant Mesh Gears

23

Page 24: chandu 2003

Table 5.2

Cluster Gears Pitch circle dia (mm) Number of teeth

4 65.23 26

3 48.77 19

2 35.28 14

1 20.79 9

Table 5.3

Lay Shaft Gears Pitch circle dia (mm) Number of teeth

4 73.09 29

3 89.85 35

2 103.33 41

1 117.33 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 Number of teeth

4 24

3 19

2 14

1 10

Table 5.4

Lay Shaft Gears Number of teeth

4 31

3 35

2 41

1 50

24

Page 25: chandu 2003

Table 5.5

Gear name Number of teethG1 23G2 22G3 8G4 14Speedo crown 10Speedo pinion 15Pinion 10Crown wheel 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

5.1

And the ratio’ of RPM is given by

5.2

The ratio of N5 by N7 is given by the relation

5.3

Using relation 1.2

25

P1 = P2 d1/d1 = T1/T2

N1/N2 = d2/d1 = T2/T1 = 1/𝑤2

N5/N7 = N5/N3’’ X N3’/N4 X N4’/N6 X N’6/N7

N5/N7 = T3’’/T5 X T4/T3’ X T6/T4’ X T7/T’6

Page 26: chandu 2003

5.4

Ratio for VIKRAM 450D Model

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 = 2πR

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

5.6

For 750D model

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.

3. Speed

26

N7 = 1235.98

Page 27: chandu 2003

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

Angular velocity at wheel (rad/s)

𝑤5

Angular velocity of G4 (rad/s); 𝑤7= 𝑤5/0.5436

𝑤7

Time elapsed in one revolution of G4 (seconds)

T7

50 58.5654 107.736 0.05832

45 52.7426 97.024 0.06475

1 1.1720 2.155 2.91563

Where,V5 - velocity at wheels𝑤5 - angular velocity of wheelsT7 - 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.

27

Page 28: chandu 2003

Time period = 2.91563/255 = 0.01143 sec 5.7

For model 750D

Table 5.7

Velocity at wheels (km/hr)

V5

Angular velocity at wheel (rad/s)

𝑤5

Angular velocity of G4 (rad/s); 𝑤7= 𝑤5/0.6124

𝑤7

Time elapsed in one revolution of G4 (seconds)

T7

50 58.5654 95.632 0.06570

45 52.7426 86.124 0.07295

1 1.1720 1.913 3.28446

Where,V5 - velocity at wheels𝑤5 - angular velocity of wheelsT7 - 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.

Time period = 3.28446/255 = 0.0128802 sec 5.7a

28

Page 29: chandu 2003

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 sensor2. 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.

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

29

Page 30: chandu 2003

The circuit diagram is shown below

VCC (+5V)

Hole G7

Photo

diode

Disc

LED

Fig 6.1 LED Type Sensor

30

OpAmp

To Pin1 IC 7404

Cross-sectional view of disc

Page 31: chandu 2003

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:

Vss

Gear G4

MRE To Pin1 IC7404

Comparator

Fig 6.2 MRE Sensor

31

2

1

3

4N

S

Constant voltage Circuit

Page 32: chandu 2003

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.

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.

32

Page 33: chandu 2003

Pin Diagram 555 timer IC

Fig 6.4 555 Timer pin diagram

Table 6.1

Pin No. Description/Function

1 GND is still the system ground.

2 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.)

3 Out is the square wave output. Sometimes we'll want the square wave, sometimes we'll look elsewhere for the signal we want.

4 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.

5 Control is pictured on the pinout, but not on our schematic, since we won't be using it and can safely leave it unconnected.

6 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

7 Discharge provides a path to drain the storage capacitor, which happens when Threshold is activated.

33

Page 34: chandu 2003

8 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) 4.5 V to 16 V

Supply current @ VCC = +5 V; open output 3 mA to 6 mA

Supply current @ VCC = +15 V; open output 10 mA to 15 mA

Maximum Output Current 200 mA

Power Consumption 600 mW

Output Rise Time 100 nano sec

Output Fall Time 100 nano sec

Operating Temperature 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

34

Page 35: chandu 2003

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.

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

35

Page 36: chandu 2003

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

Fig 6.6 Square wave

NOTE: R1 and R2 minimum value must not be less than 1K; the circuit must be designed in

accordance with the graph fig. Best results are obtained with capacitors of 1000pF or larger, but smaller values can be used with lower values of R1 and R2.

36

Page 37: chandu 2003

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 10μF 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 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.

37

Page 38: chandu 2003

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 1.858 KΩ (750D)

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

The Output Frequency: 450D - 87.48 Hz and 750D – 77.63 Hz

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 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%.

38

Page 39: chandu 2003

Show your calculation.R1 = 1.649KΩ (450D) and 1.858 KΩ (750D)R2 = 1.649KΩ (450D) and 1.858 KΩ (750D)

C = 10 F

Charge time (output high) = 5.715 ms (450D) and 6.44 ms (750D)

Discharge time (output low) = 5.715 ms (450D) 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 fromThe 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

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

Up–down counter – counts both up and down, under command of a control input

39

Page 40: chandu 2003

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

sequence—such 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

clock

40

J Q0

K

J Q0

K

Page 41: chandu 2003

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 Q1 Q0 (Q1:Q0)dec

0 0 0 0

1 0 1 1

2 1 0 2

3 1 1 3

4 0 0 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).

41

Page 42: chandu 2003

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.

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

42

Page 43: chandu 2003

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.

Up–down counter

A counter that can change state in either direction, under the control of an up–down

selector input, is known as an up–down 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

43

1

2

3

4

5

6

7

14

13

12

11

10

8

9

Page 44: chandu 2003

Fig 5.10 Pin diagram IC 7493

Pin Description

Table 5.2

PIN NUMBER FUNCTION

1 Clock B, clock to internal next JK flip-flop

2 Reset pin 1 termed as R01

3 Reset pin 2 termed as R02

4,6,7,13 Don’t care pins

5 Vcc ( +5V to +15V)8 Output QC

9 Output QB

10 Ground (GND)

11 Output QD

12 Output QA

14 Clock A, this is the enable clock

Cascading Counters

44

14 1 CLKA CLKB

R01 (2) 12

R02 (3) 11

5 9

10- GND 8

IC- 7493(1)

14 1 CLKA CLKB

R01 (2) 12

R02 (3) 11

5 9

10- GND 8

To Pin 3 of 555 Timer

IC-7493(2)

To Pin 4 of IC 7404

LSB LSB

Page 45: chandu 2003

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

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 R02 QD QC QB QA

H H L L L L

L X Count Count Count Count

45

HIGH

MSB MSB

Page 46: chandu 2003

X L Count Count 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: L→R or R→L. The

serial input and last output of a shift register can also be connected together to create a circular

shift register.

46

Page 47: chandu 2003

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.

47

Page 48: chandu 2003

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-flop’s 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

Parallel In Parallel Out (PIPO)

48

0 0 0 0

1 0 0 0

0 1 0 0

1 0 1 0

1 1 0 1

0 1 1 0

0 0 1 1

0 0 0 1

0 0 0 0

Page 49: chandu 2003

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

Parallel output

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

Pin diagram

49

1 0 1 1

0

1 0 1 1

0

Page 50: chandu 2003

Fig 5.15 Pin diagram IC 74198

Pin description

Table 6.5

Pin no Description/Function1,23 S0,S1, mode select inputs2 DSR, Serial data input (shift right)3, 5, 7, 9, 15, 17, 21 and 23 P0-P7, Parallel data input4, 6, 8, 10, 14, 18, 20 and 22 Q0-Q7,Flip-flop outputs11 Clock 12 GND13 MR (Master Reset, active low)22 DSL, Serial data input (shift left)24 Vcc (+5V to +15V)

Mode select table

50

Page 51: chandu 2003

Table 6.6

MR CP S0* S1* Response

L X X X Asynchronous reset; output = low

H H H Parallel Load; Pn Qn

H L H Shift Right; DSR Q0, Q0 Q1, etc.

H H L Shift Left; DSL Q7, Q7 Q6, etc.

H X L L Hold

Circuit daigram for connection with counters and microcontroller

Vcc

To Sensor Pulse

GND

Fig 6.16

Unit 7.Microcontrollers

51

1 23 24

4 3

6 5

8 7

10 9

14 15

16 17

18 19

20 21

11

13 12

HIGH

To IC 8051 Pin1-Pin7

Output from IC’s 7493

Page 52: chandu 2003

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 Motorola’s 6811 Intel’s 8051 Zilog’s Z8 Microchip’s 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

Architecture of 8051

52

Page 53: chandu 2003

Fig 7.1 Architecture of 8051

53

Page 54: chandu 2003

Pin diagram

Fig 7.2 Pin diagram IC 8051

Pin description

Table 7.1

Pin No. Description/Function 1, 2, 3, 4, 5, 6, 7 and 8 Port 1, input/output data pins9 RST (Reset)10 P3.0; RXD (Serial input port)11 P3.1; TXD (Serial output port)12 P3.2; INT0 (External interrupt 0)13 P3.3; INT1 (External interrupt 1)14 P3.4; T0 (Timer 0 external input)15 P3.5; T1 (Timer 1 external input)16 P3.6; WR (external data memory write strobe)17 P3.7; RD (external data memory read strobe)

54

Page 55: chandu 2003

18 XTAL2, Input to the inverting oscillator amplifier19 XTAL1, Output from the inverting oscillator

amplifier20 Vss , GND21, 22, 23, 24, 25, 26, 27 and 28 Port 2/High order Address Lines for external data

or program memory29 PSEN (read strobe to external program memory)30 ALE (address latch enable)

PROG (programming an external EEPROM, active low)

31 EA (external access enable)32, 33, 34, 35, 36, 37, 38 and 39 Port 0/ Low order address lines for external data or

program memory40 Vcc (±5V to ±15V)

Where,

PORT Port number Pin Number

7.2 Programming

55

Page 56: chandu 2003

The microcontroller can understand only LLL (Low Level Language, i.e. 0’s and 1’s), 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 // LOAD PC WTH ADDRESS OOOOH

MOV R1, #00H // FOR DISTANCE CALCUTATION

MOV R2, #00H

START 1: MOV R3, #0D4H (#4AH) //constant for distance model 450D is 1236

MOV R4, #04H (#04H) //for 750D, constant is 1098

CHECK: CLR A //CLEAR ACCUMULATOR

MOV A, #0FFH //FOR INITIALIZING THE PORT

MOV P1, A //data is send to the port1 latch

MOV A, P1 //input from the port

MOV R0, A //value of accumulator is stored in register R0

MOV R7, A //as well as is stored in registers R7

XRL A, R0 //A and R0 are put to XOR gate to check whether

JZ CHECK // any data is obtained using a jump condition

MOV R0, #00H

SJUMP SPEED //call subroutine SPEED

SJUMP DISTANCE //call subroutine DISTANCE

SJUMP CHECK //jump to CHECK

SPEED: MOV A, R7 //move the counter value in R7 to ACC

MOV F0, A //move the value to register B

MOV A, #0FFH //FFH is hex code = 255D const for speed

DIV AB //calculated speed

56

Page 57: chandu 2003

MOV R0, A //store the results in register R0

SETB P2.2 //reset the speed display unit

CLR P2.2 //clear the bit

LOOP: SETB P2.0 //calculate the speed

CLR P2.0

DJNZ R0, LOOP //loop runs until the speed is displayed

CLR A //clear accumulator

RET //return from subroutine SPEED

DISTANCE: DJNZ R3, NEXT //decrement R3, jump if not zero to NEXT

DJNZ R4, NEXT // decrement R4, jump if not zero to NEXT

INC R2 //increment register R2, if R4 is zero

CJNE R2, #00H, NEXT1 //compare R2 with zero, jump to NEXZT1 if //not //equal

INC R1 //increment R1

NEXT1: SETB P2.1 //provide a positive pulse to the distance counter

CLR P2.1 //clear the pulse

SJUMP AGAIN //jump too AGAIN

NEXT: RET //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.

Unit 8 Display 57

Page 58: chandu 2003

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 encoding—it 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 fixed-

point 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 1 2 3 4 5 6 7 8 9 BCD: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001

Thus, the BCD encoding for the number 127 would be: 0001 0010 0111

Whereas the pure binary number would be: 0111 1111

BCD in Electronics

58

Page 59: chandu 2003

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 hardware—a designer might choose to use a series of separate identical seven-

segment 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

SignDigit

BCD8 4 2 1

Sign Notes

A 1 0 1 0 +

B 1 0 1 1 −

C 1 1 0 0 + Preferred

D 1 1 0 1 − Preferred

E 1 1 1 0 +

F 1 1 1 1 + Unsigned

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

decimal digits, which is always an odd number of digits. A decimal number with d digits requires

½(d+1) bytes of storage space.

59

Page 60: chandu 2003

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 RIPPLE-BLANKING OUTPUT.

Fig 8.1 Pin diagram IC 4033

Pin description

Table 8.3

Pin Number Description/Function1 Clock2 Clock Inhibit3 Ripple Blanking IN4 Ripple Blanking OUT5 Carry Out8 VSS, GND14 Lamp Test15 Reset16 VDD, Supply Voltage10, 12, 13, 9, 11, 6, 7 Output to 7 segment LED (a,b,c,d,e,f,g,h)

60

Page 61: chandu 2003

Cascading IC 4033

To 7 segment LED

To 7 segment LED

Fig 8.2 Cascaded IC 4033B

61

10 12 13 9 11 6 7 5

4 16

1 2 8 14 3 15

10 12 13 9 11 6 7 5

4 16

1 2 8 14 3 15

Reset HIGHVDD ±5V to ±15V

To Pin 1 of the next 4033 in series

To Microcontroller (8051)

IC 4033 (2)

IC 4033 (1)

Page 62: chandu 2003

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

Fig 7.4

62

Page 63: chandu 2003

INTEGRATING THE CIRCUIT

Sensor output

30µF = = 30µF

Crystal 12MHz

Fig 8.5 Circuit integration

Note: For pin connections refer the previous chapters

63

Pin 3

Pin14 (of first 7493)

Counter Circuit (Two 7493)

74198

Shift Register

Pin18 Pin19

Pin21 Pin23 Pin22

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

7 Segment LED

IC 7404

555 Timer

Sensor Unit

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

7 Segment LED

Microcontroller IC 8051

Page 64: chandu 2003

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.

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.

64

Page 65: chandu 2003

Conclusion

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

Cost comparison

Mechanical model (in Rupees) Digital model (in rupees)250-300 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

2. Compatibility It’s 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

65

Page 66: chandu 2003

References 1. Jain and Floyd, Digital Fundamental, 20052. 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. 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 Wankhede’s 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

66