Final Trade Project Milestone 3

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 50

NAIROBI TECHNICAL TRAINING INSTITUTE.

TRADE PROJECT

CANDIDATE’S NAME: RODJERS BARASA SIMIYU

INDEX NUMBER: 4031041421

COURSE NAME: DIPLOMA IN ELECTRICAL AND ELECTRONICS ENGINEERING


(POWER OPTION).

COURSE CODE: 2601/3

PAPER CODE: 2601/306

PROJECT TITLE: MICROCONTROLLER BASED PASSENGER BUS TICKET


BOOKING SYSTEM

SUPERVISED BY: MR. MUSEMBI

PRESENTED TO: KENYA NATIONAL EXAMINATIONS COUNCIL FOR THE


PARTIAL FULFILMENT OF THE REQUIREMENT FOR THE
AWARD OF DIPLOMA IN ELECTRICAL AND ELECTRONICS
ENGINEERING (POWER OPTION)

DATE OF PRESENTATION: NOVEMBER/DECEMBER SERRIES 2021


Table of Contents
DEDICATION............................................................................................................................................................... iii
ACKNOWLEDGEMENT..............................................................................................................................................iv
ABSTRACT.................................................................................................................................................................... v
ABBREVIATIONS.......................................................................................................................................................vii
CHAPTER ONE.............................................................................................................................................................1
INTRODUCTION...........................................................................................................................................................1
1.1. BACKGROUND.............................................................................................................................................1
1.2. OBJECTIVES ................................................................................................................................................2
1.3. AIMS...............................................................................................................................................................2
1.4. BLOCK DIAGRAM.......................................................................................................................................2
1.5. PROJECT SPECIFICATIONS........................................................................................................................4
CHAPTER TWO.............................................................................................................................................................5
LITERATURE REVIEW................................................................................................................................................5
2.1. INTRODUCTION................................................................................................................................................5
2.2. POWER SUPPLY................................................................................................................................................5
2.3. TYPES OF POWER SUPPLY.............................................................................................................................5
(a) Switch mode power supply................................................................................................................................5
(b) Unregulated power supply.................................................................................................................................5
(c) Regulated Power supply.....................................................................................................................................6
(d) Uninterruptible power supply............................................................................................................................6
2.4. OPERATION.......................................................................................................................................................7
2.5. TRANSFORMER.................................................................................................................................................7
2.5.1. Types of Transformers.............................................................................................................................8
2.5.2. E.M.F equation of a transformer............................................................................................................11
2.6. RECTIFIER CIRCUIT..................................................................................................................................13
2.6.1. types of rectifiers...................................................................................................................................13
2.7. Voltage Regulator Circuit..............................................................................................................................17
2.7.1. Various types of voltage regulators.......................................................................................................17
2.8. FILTER CIRCUIT.........................................................................................................................................19
2.8.1. Types of Filter circuits...........................................................................................................................20
2.9. DISPLAY UNIT............................................................................................................................................21
2.9.1. Types of display units............................................................................................................................21
2.10. KEYPAD.......................................................................................................................................................24
2.10.1. Types of keypads and keyboards...........................................................................................................24
i
2.11. THE MICROCONTROLLER.......................................................................................................................26
2.11.1. Basic features of a Microcontroller........................................................................................................26
2.11.2. Types of Microcontrollers.....................................................................................................................27
CHAPTER THREE.......................................................................................................................................................29
METHODOLOGY........................................................................................................................................................29
3.1. INTRODUCTION.........................................................................................................................................29
3.1.2 power supply design.........................................................................................................................................29
3.1.3 transformer design............................................................................................................................................30
3.1.4 rectifier circuit designing..................................................................................................................................30
3.1.5 Design of voltage regulator...............................................................................................................................31
3.1.6 Design of a smoothing capacitor...................................................................................................................32
3.1.7 Design of microcontroller.................................................................................................................................33
3.1.8 Design of capacitor c2 and c3...........................................................................................................................33
3.1.9 Design of display unit current limiting resistors...............................................................................................34
CHAPTER FOUR..............................................................................................................................................................36
DATA ANALYSIS, FINDINGS, CONCLUSIONS AND RECOMMENTATIONS........................................................................36
4.1. INTRODUCTION..............................................................................................................................................36
4.1.1 Circuit diagram of passenger bus ticket booking system..............................................................................36
4.1.2 Project operation...........................................................................................................................................37
4.1.3 Test and Results Table..................................................................................................................................37
4.1.4 Conclusion....................................................................................................................................................37
4.1.5 Recommendations........................................................................................................................................38
4.1.6 Cost of devices and components...................................................................................................................38
4.1.7 Other costs....................................................................................................................................................40
REFERENCE....................................................................................................................................................................40

ii
DEDICATION

I dedicate this project to every member of my family.

iii
ACKNOWLEDGEMENT

I highly appreciate the efforts made by my H.O.D Mr. Atenya my teacher Mr. Mburu and without forgetting

my supervisor Mr. Musembi who put their effort together and guided me on the project all the way from the

idea stage till the end.

Secondly I want to thank my parents and guardians for the full support they offered to me during the whole

course and specifically while doing this project.

Last but not least I would like to thank all my friends and classmates for sharing of important ideas and

suggestions for my project.

iv
SYNOPSIS

ABSTRACT

The Microcontroller based bus ticket booking system is an electronic device that is made up of; a power

supply unit, an Arduino, two seven segments display units and two keypads. This device can be situated

anywhere within the street, outside office premises and at the bus stage where passengers or bus drivers

can use it to communicate to each other.

For instance, everyday many people miss the bus at the bus station due to lack of proper timing and

therefore they end up getting to their destinations late. The bus ticket booking system therefore is going to

aid solve this problem. This system is made up of Arduino which will enhance processing and transfer of

digital signals from the keypads to the display units. The project’s block diagram and specifications have all

been drawn and stated respectively in chapter one.

In the chapter two, various components that have been used in this project have been described in detail i.e ranging

from their mode of operation, their types, and their diagrams. These components will be used in each particular unit

of the project ranging from the power supply unit, rectifier unit, filter circuit, voltage regulator and stabilizer unit etc.

Their various diagrams and have been drawn and their operations and each type of such components have as well

been stated.

The project design has been carried out in chapter tree. Each and every component that has been used in this

project has got its range of working values for various electrical quantities. These values that have been obtained

some may be the exact value required as per the project design while others may not. The range of circuit design

which I did in this project ranges from; the step down power transformer, rectifier circuit, voltage regulator circuit,

and the required microcontroller for this project. Their specifications gotten after doing their various calculations

have been stated.

v
The project operation has been stated in detail in chapter four. This covers the power follow paths after switching on

of the supply power and also paths which the generated digital signal will follow starting from the dialing keypads to

the I N pin of the microcontroller and out of the microcontroller through its OUT pin.

Lastly the test and results table has been tabulated, conclusion stated and recommendations made to whoever who

will continue with this project in the future.

vi
ABBREVIATIONS

I. EMF- Electromotive force

II. AC- Alternating current

III. DC- Direct current

IV. V - Volts

V. R - Resistance

VI. C - Capacitor

VII. VI - Input voltage

VIII. VO- Output voltage

IX. VZ- Zener voltage

X. VBE- Transistor base voltage to emitter

XI. RL- Load resistance

XII. RS- Series resistance

XIII. IC - Integrated circuit

XIV. Q1 - Transistor 1

XV. USB - Universal serial bus

XVI. I/O - Input/output

XVII. IN - Input pin

XVIII. KB - Kilobyte

XIX. ROM - Read only memory

XX. RAM - Random access memory

vii
viii
CHAPTER ONE

INTRODUCTION

1.1. BACKGROUND

Everyday many people miss the bus at bus station due to lack of proper timing and therefore they end up

getting to their destinations late. The microcontroller based bus ticket booking system therefore is a system

that will be used to inform the bus driver that there are passengers coming to board the bus. On the other

hand, passengers who are on their way towards the bus station are able to get notified about the bus fare

amount which they are going to pay.

This system is basically made up of an Arduino uno, two display unit, two keypads and a power supply unit.

One display unit will be situated at the bus station side and the other one at the street side where passengers

are most likely to come from. Also one keypad will be situated on the street onto which passengers will be

pressing successive keys one passenger after another and thus this information will be displayed as decimal

figures on the display unit to indicate to the bus driver about the number of passengers. The other one

keypad will be put at the bus station side onto which the bus driver will be keying in various bus fare

amounts that will get displayed on the display unit at the street side to inform the passengers about the

amount they will be paying. These input and output devices are then Interfaced to an arduino and the various

inputs for the two keyboards Shall be entered, processed and get displayed on the respective display units.

I am so determined that these systems will play a bigger role towards management of time, saving on the

daily huge amounts spent by the passengers and on the other hand creating a sense of assurance to both bus

drivers and passengers.

1
1.2. OBJECTIVES

To design, construct and test microcontroller based passenger bus ticket booking systems which will help

the passengers in saving time by at least 15 minutes during the whole process of boarding a bus at the bus

stage.

1.3. AIMS

 To design a system that is simple and hence easy to fabricate and maintain.

 To design a system that is reliable and efficient in operation.

 To construct a system that is environmentally friendly.

 To construct a system that will have a long life of service.

1.4. BLOCK DIAGRAM

POWER SUPPLY

DISPLAY UNIT 1
KEYPAD 1 MICROCONTROLLER

KEYPAD 2 DISPLAY UNIT 2

POWER SUPPLY

2
This particular unit is very important in this circuit because it converts the 240V AC mains supply to 12V

AC by use of a step down transformer. Then the 12 V AC is converted to 12 V DC by use of a rectifier

circuit which comprises four diodes, one resistor and a capacitor for the purpose of filtering any AC ripples

left in the rectified voltage.

Then the last circuit of the supply voltage entails the voltage regulation circuit. Since the microcontroller

can only operate at a maximum power supply of 5V d.c, there was a need to ensure a stable 5V d.c supply to

it hence I used the 5v regulator IC to do the job.

KEYPAD 1

This one is a decimal number keypad. It has keys ranging from 0 to 9. This keypad is situated at the bus

station to be used only by the bus drivers to provide and input data normally the figures of bus fare amounts

to the microcontroller which will then be processed and get displayed on the display unit 1.

KEYPAD 2

This one is also a decimal number keypad. It had keys ranging from 0 to 9. It is situated on the street side

and used by the passengers only.

It sends information to the microcontroller and the information will be displayed after being processed to the

second keypad. This information will help the driver to know or to tell the number of people or passengers

in the street who are coming at this stage.

DISPLAY UNIT 1

It is normally situated on the street side at a very strategic location so that each and every passenger walking

on the street can see the amount displayed that he or she is going to pay after arriving or after boarding the

bus stage. The information to be displayed is normally keyed in the microcontroller by and their driver at the

bus stage.

DISPLAY UNIT 2

3
This is normally situated at the bus stage side and is used to display the number of people coming at that

particular stage t boars the bus.

MICROCONTROLLER

It is used to receive inputs from the two key pads and processes the information which then it displays to the

2 display units located at various strategic points for viewing by the passengers.

1.5. PROJECT SPECIFICATIONS


I. Supply voltage 240 A.C

II. Operating voltage 5V D.C

III. Operating current 500 micro Amps

4
CHAPTER TWO
LITERATURE REVIEW
2.1. INTRODUCTION

In this chapter the project lays ground for its operation by reviewing all the information concerning different

circuits concept. Each and every block consists of a circuit. The operation of those circuits are explained

below.

2.2. POWER SUPPLY

This is the unit that supplies power to the entire circuit therefore it consists of the following blocks;

STEP DOWN RECTIFIER


FILTERING REGULATOR
TRANSFORMER
CIRCUIT
CIRCUIT UNIT

2.3. TYPES OF POWER SUPPLY

(a) Switch mode power supply

This is normally made up of two rectifier filter capacitors, bleeder resistors, a transformer and a transistor; it

is normally complicated in construction.

(b) Unregulated power supply

It consists of a step down transformer, rectifier, filter capacitor and a bleeder resistor. The output voltage of

this power supply varies with change in input voltage and load current.

5
(c) Regulated Power supply

This type of power supply is made up of a step down transformer, rectifier, filter capacitor and voltage

regulator. Its output voltage is always stable regardless of changes in the load current to the input supply

voltage.

(d) Uninterruptible power supply

It is normally designed in a way such that in the case of power failure or power disruption, it allows the load

system to run for a particular duration of time before it goes off.

It consists of a Bank of rechargeable batteries and a power sensing and conditioning circuit. Therefore, the

cost of construction or purchasing this power supply is high compared to other types of power supplies.

Regulated linear power supply will be used for this project since low power is needed in by the circuitry of

this project

It is less complex in construction compared to switch mode power supply and more so it gives out a stable

output voltage as compared to unregulated power supply. It is also less bulky and occupies very less space

as compared to the

6
Circuit Diagram of a Linear Regulated Power Supply

2.4. OPERATION
A.C power from the mains is applied to the primary winding of the transformer. The transformer then steps

down the mains supply voltage to the desired 12V A.C voltage according to the transformer turn ratio of the

windings. The stepped down voltage is applied to a rectifier circuit where the 12V A.C voltage power is

converted to DC power by using the diodes; D1, D2, D3 and D4.

Filtering capacitor sees one grounds the alternating current hence it eliminates any ripples present to obtain

nearly a ripple-free 12V DC voltage. Then the presence of the voltage regulator is to maintain a constant

output of 5V D.C hence ensuring stability in the input voltage to enable efficient functionality of the project

circuitry.

2.5. TRANSFORMER
A transformer is an electrical device which by the principle of mutual induction it induces an E.M.F to the

secondary windings when power is applied its primary windings without any direct connection. The

7
frequency of the primary voltage is maintained provided that the material used to make the primary core is

also the one used to make the secondary core of the transformer.

The energy transfer usually is associated with the change in voltage and current. Transformers are normally

categorized into two groups which includes;

I. Step up transformers- Are those transformers that are used in stepping up lower voltages to higher

voltages without changing the wave properties of the primary voltage

II. Step downs transformers- These are transformers which are used to step down higher voltage

amounts to the desired lower amounts.

NOTE: These two transformers are always the same but the only difference comes out in the internals of the

primary and secondary windings. For example, the step up transformer has many windings in its secondary

circuit as opposed to the primary side. On the other side the step down transformer has got less windings on

its secondary windings as compared to its primary ones.

II.5.1. Types of Transformers

I. Autotransformer - this is a transformer in which both of its primary windings and secondary ones are

connected to each other and in which they are in series. Voltage is varied according to the position of

secondary tapping on the coil tapping.

II. Air core transformer- It is a type of transformer in which both the primary and secondary windings

are wound on a magnetic strip where the flux linkage between primary and secondary windings is

linked through air. It has less mutual inductance as compared to the iron core type.

III. Current transformer- This kind of transformer is normally applied in high voltage lines to measure

the amount of current in the power line. Normally it has fewer primary windings made up of thick

copper coils.

8
IV. Power transformers- These are normally big in size and suitable in high power transfer applications.

They are normally used in power plants, substations where there is a need to measure or handle very

high electrical power.

V. Iron core transformers- These kinds of transformers have both their primary and secondary windings

wound on multiple iron cores or plates which provides a magnetic flux linkage path between the

primary and secondary windings. This type of transformers have more mutual inductance as

compared to the air type transformers.

In this project the type of transformer to be used is the Iron core type. Since it has brilliant magnetic

permeability and works at normally higher efficiencies.

9
10
When alternating voltage is applied in the primary winding of the transformer, it will lead to a change in

magnetic flux with respect to time. This magnetic flux is sinusoidal in nature hence there will be flux

linkage between the primary and secondary coil through a process called mutual induction.

This flux which has been linked onto the secondary coil will be changing with respect to time therefore it

will induce an EMF in the secondary circuit which consists of fewer turns as compared to the primary

winding. Therefore, the EMF induced will be of lower magnitude as compared to the applied voltage but

same frequency.

II.5.2. E.M.F equation of a transformer.

11
12
II.6. RECTIFIER CIRCUIT
This circuit is made up of power diodes which are basically crystalline semiconductor materials that are used

to convert A.C voltage to D.C voltage. The rectifier circuit can as well be made up of silicon controlled

rectifiers (SCRS) especially when there is need to control the power but here in this project there is no need

for that and so I found power diodes to be effective.

II.6.1. types of rectifiers


(i) Half wave rectifier circuit.

This is a simple type of rectifier by using a single diode. This diode can only be forward biased whenever

there is a positive cycle and reversed biased whenever it comes, thus it can only conduct during the positive

cycle as shown above.

(ii) Full wave Centre-tapped rectifier circuit.

his type of rectifier circuit is made of two power diodes and a Centre- tapped transformer. The center-tapped

terminal of the transformer will act as the negative terminal or the ground. The two diodes are connected as

shown below.

13
During the positive cycle diode D1 will be forward biased hence it will conduct whereas diode D2 will be

reversed biased thus it won’t conduct. Therefore D1 will only output the positive cycle or the crest of our

supply A.C voltage. During the second cycle ( trough) Diode D1 will be reversed biased and D2 forward

biased hence it will conduct thus D2 will give out the positive cycle and therefore due to this process the

voltage across our load shall appear to be a smooth D.C waveform.

(iii) Full wave Bridge Rectifier

Four diodes are used in this type of rectifier and this circuit is designed in a manner that two diodes become

forward biased while the other two are in their reversed biased mode this is with respect to the alternating

waveform of the supply voltage. Below is the circuit diagram of this particular type of rectifier.

14
15
(iv) Silicon controlled rectifier (Single phase controlled half-wave rectifier)

Controlled rectifiers use thyristors in place of power diodes. By adjusting the variable resistor connected on

the gate terminal we can be able to adjust the triggering time of the thyrstor. In this process the output

current and voltage to the load can be controlled.

16
II.7. Voltage Regulator Circuit

It is a device normally used to ensure a stabilized output voltage for any given power supply circuit to a

load. It is designed in such a way that even if there is a variance in the load or even the input voltage is

varied it will always ensure that there is a constant output voltage across the load terminal.

II.7.1. Various types of voltage regulators

(i) Transistor series Voltage regulator

It consists of a zener diode and a transistor connected in parallel with the load as shown below.

Transistor (Q1) - It helps to modify the resistance of the circuit to maintain voltage constant. Its terminals

are; emitter, base and collector. The zener diode is connected to the base of this transistor and input is given

at the collector side. The load is connected to the emitter. Let VBE be the base – emitter voltage.

Zener diode - The zener diode is connected to the base of the transistor. The zener diode is used to set the

fixed reference voltage to the transistor base terminal. This voltage across the zener diode Vz is always

constant irrespective of any change in input voltage.

Series resistance (Rs) - It is used to limit the current through zener diode

17
Load resistance (RL) - It is the load resistance connected across the output terminals.

Working

Assume that the input voltage given at the terminal is 12 volts. Which is the unregulated DC supply voltage

given at the input terminals. Assume that the breakdown voltage of this zener diode is 9 volts. This means

that this zener diode starts conducting at 9 volts. Since the diode is connected to the base of the transistor, 9

volts becomes the reference voltage to the transistor base which is a fixed value.

The voltage across the load i.e output voltage is the voltage difference between zener diode voltage and the

voltage across the base emitter terminal of the transistor. That is it can be given as follows

Vo = Vz – VBE

The voltage across the base emitter is the conducting voltage of the transistor whose value is 0.7 V. As the

input voltage is 12 V hence the output voltage becomes 9 – 0.7 = 8.3 V. as per the above equation.

Now if there is an increase in input voltage, let us say 12.5 volts, then the voltage across the load also

increases initially. It increases to 8.7 volts but the zener diode maintains the voltage constant at 9 volts.

18
Therefore, the voltage of the transistor becomes less than 0.7 volts. For this to happen the resistance across

collector emitter increases (this is the property of transistor, transfer resistance) hence now the output

voltage maintains constant at 8.3 volts

Now let us consider the case for a decrease in input voltage. A decrease in input voltage will decrease the

load voltage initially. But again the load voltage has to be maintained constant. This time, the resistance

across the collector emitter decreases which increases the base- emitter voltage.

Resistance changes as per the change in input voltage. This happens due to the transistor principle and fixed

voltage provided by the zener diode. In both the cases with a change in input voltage, the load voltage

remains constant. Hence it can be seen that with a change in input voltage, the output voltage remains

constant. That is how a transistor series voltage regulator acts as a regulating element

The base voltage of Q1 is held to a relative constant voltage across the zener diode.

For example; if Vz = 8V, the base voltage of Q1 will remain to be approximately 8V.

Hence, V out. = (VZ-VBE)

(ii) Fixed IC Voltage Regulator

Fixed IC regulators provide a constant voltage. A popular example is the 7805 IC. This provides a constant 5

volts. A fixed voltage regulator can be either a positive or negative one. They are the same in design,

construction and operation only that the polarity of output voltage differs.

II.8. FILTER CIRCUIT


A filtering circuit is used to smoothen the D.C output voltage to the used by electronics components. The

filtering circuit ensures that there are no significant ripples in the output voltage. The effects of ripples in the

19
output voltage could cause very small oscillatory effects which for example if applied to an amplifier circuit

leads to presence of electric noise in the amplifier output.

II.8.1. Types of Filter circuits


L-C filter - This is an inductor-capacitor circuit. Normally the capacitor is connected in parallel with the load

as shown below.

Operation

At high frequencies the inductor acts as a choke which blocks AC components from passing through.

The capacitor impedance decreases and forms a pathway for high frequency components to pass through.

This idea is meant to prevent AC components from passing through the load.

R-C filter - This type of filter circuit consists of a resistor and a capacitor only.The capacitor is also

connected in parallel with the load as shown below.

Operation
20
The operation of such a filter circuit is such that the capacitor will block ripples which have a certain

frequency . The resistor provides a resistive path for the ripples which prevents them from reaching the load.

R-L-C Filter - It is made up of a resistor, inductor and a shunt capacitor as shown below. This capacitor is

normally connected across the load. When connected across the rectifier circuit, it becomes charged and

discharge at a rate determined by the time constant hence it maintains a constant voltage across the load.

In this project the electrolytic capacitor is employed due to the following reasons;

● Electrolytic capacitor can continue to work stably even in high temperature environments

● It has a stable impedance over a wide temperature range

● It has long life

II.9. DISPLAY UNIT

It is an electronic device used to display characters, figures etc.

II.9.1. Types of display units


Segment display unit - This is a form of electronic display device for displaying decimal numerals that is an

alternative to the more complex dot matrix displays.

These display units are mostly used in; digital clocks, electronic meters, basic calculators and other

electronic devices that display numerical information.

Types of segment display units


21
● Seven-segment display

● Nine-segment display

● Fourteen-segment display

● Dot-matrix display

● Nixie tube display

● Vacuum fluorescent display

● Seven-Segment display unit.

The seven segment display Is the most common display device used in many gadgets and electronic

appliances like digital meters, microwave ovens etc.

These display units consist of seven segments of light emitting diodes (LEDs) and that are assembled into a

structure like numeral 8.

Seven segment display unit contains 8-segments wherein an extra 8 th segment is used to display dot. This

segment is useful while displaying non integer number.

Seven segments are indicated as A – G and the 8th segment is indicated as H.

There are two types

1. Common Anode

22
In this type, all the anode connections of the LED segments are connected together to logic 1.

The separate segments are lightened by applying of logic 0 or Low signal through a current limiting resistor

to the cathode of the particular segment ‘a’ to ‘g’

This type of seven segment display can sink more current than they can source.

2. Common cathode

In this type all the cathode connections of LED segments are connected together to logic 0 or ground.

The separate segments are lightened by applying the logic 1 or HIGH signal through a current limiting

resistor to forward bias the individual anode terminals ‘a’ to ‘g’

Operation.

23
When the power is given to all the segments, then the number 8 will be displayed. If you disconnect the

power for segment G (that means 7) then that will result in number 0.

The circuit of the seven segment is designed in such a way that the voltage at different pins can be applied at

the same time. In the same way, you can form the combinations to display numerals from 0-9.

Seven Segment Display Controlling ways.

There are different types of controlling techniques that are implemented by interfacing these display units

with the external controlling devices. Different types of microcontrollers are very useful to communicate

with external devices like keypad, switches etc.

Interfacing Seven Segment with Arduino

II.10.KEYPAD

This is a miniature keyboard or set of buttons for operating a portable electronic device, telephone or other

equipment.

II.10.1.Types of keypads and keyboards

I. Qwerty keyboards

II. Numeric keypads

III. USB keyboards


24
IV. Bluetooth keyboards

V. Magic keyboards

Qwerty Keyboard - The name comes from the order of the first six keys on the top left row of the qwerty

keyboard (QWERTY) as shown below.

Numeric keypad - A numeric keypad, or ten keys is the palm- sized usually -17key section of standard

computer keyboard. It is shown below.

USB keyboard - It is shown below. This is a wired keyboard that connects with the computer using a USB

plug. It is the most used keyboard as it is cheaper and readily available in the market.

25
Bluetooth Keyboard - This is a wireless keyboard that connects and communicates with the computer via

bluetooth protocol. It is shown below

Magic Keyboard - The magic keyboard is a family of wireless keyboards produced by apple inc. The

keyboards are bundled with the iMac and Mac Pro and sold as standalone products. It features a great typing

experience, a trackpad that opens up new ways to work with iPad ios, USB - C port for pass-through

charging and front and back protection.

In this project I will be using a numeric keypad due to the following reasons;

● It is highly portable as it can be used anywhere

● Inexpensive

● High precision in typing a lot of numbers in quick succession throughout long time

periods.

26
II.11.THE MICROCONTROLLER
A microcontroller is a small computer on a single metal-oxide-semiconductor integrated circuit chip. A

microcontroller contains one or more CPUs along with memory and programmable input/output peripherals.

II.11.1.Basic features of a Microcontroller

a) Memory -Used to store data/program.

b) Timers- Used to measure frequency, period pulse width and duty cycle.

c) Analogue to Digital Converter (ADC)- Converts the voltage from sensor into a digital value

d) Direct Memory Access (DMA)- This is a process of communication or data transfer via external

devices.

e) Digital to Analogue Converter (DAC) – This converts digital value into a voltage output to the

actuators

f) Serial Interface- Sends data sequentially 1-bit after another

g) Parallel I/O interface or Parallel port- Uses several lines to transfer more than 1-bit of data at a time.

h) The memory component circuitry- This interface generates appropriate control signals to be used by

memory chips.

i) Digital Signal Processing (DSP)- It supports Digital Signal Processing computation

j) Watchdog- This is a timer connected to a completely separate R-C oscillator within the

microcontroller

II.11.2.Types of Microcontrollers

The 8031 Microcontroller

27
Also known as the ROM less than 8051 since it has 0KB of on-chip ROM. To use this microcontroller

therefore one must connect an external ROM to it. The external ROM must have the program which shall be

fetched and executed by this chip.

In the process of adding an external ROM to 8031, you will lose two ports hence leaving you with only two

ports for input output operations.

It has the following features;

● 0 KB of ROM

● 2 timers

● 32 I/O pins

● 1 serial port

● 6 interrupt sources

● 128 bytes of RAM

The 8052 Microcontroller-This type of microcontroller has the following features;

● 256 bytes of RAM

● 3 Timers

● 32 I/O pins

● 8KB of ROM

28
● 8 interrupt sources

● 1 serial port

Note: All programs for 8051 will run on 8052 but the programs for 8052 can NEVER be run by the 8051

microcontroller.

The 8051 Microcontroller-This project shall be implemented by use of intel 8051 microcontroller. For

receiving information from the keypads and processing it and producing outputs on the display units.

Features of 8051

I. 128 bytes of RAM

II. 32 I/O pins

III. 2 Timers

IV. 1 serial port

V. 6 interrupt sources

VI. 4KB or ROM

29
CHAPTER THREE
METHODOLOGY

III.1. INTRODUCTION

In this chapter the project design is carried out. The components used in this particular project have their

values and specifications that had been documented in the electrical data sheet table. From chapter two all

stated formulas and the design considerations are used to determine their values and ratings.

In design the value obtained may not be exactly the value of the purchased component. The project is a

prototype therefore to determine the component to be purchased, tolerance and limits need to be considered.

In this chapter the entire project is assembled and complete circuit and its operation is explained.

Therefore, in this chapter the total cost for the project will be given.

3.1.2 power supply design

A power supply system can be further broken into various blocks as shown below.

30
3.1.3 transformer design

Laminated core transformer is the one used. This is due to its ability of design to perform well at low

frequencies.

In this type of transformer, some part of the core section is protected by windings.

In general, the core section of this type of transformer will be rectangular shaped and the coils will be in

either rectangular of circular shape. Both the windings are positioned on the opposite limbs of the core

section. The transformer datasheet is shown below.

Transformer VA rating Primary voltage Secondary voltage Current

50VA 230V 8 TO 12V 0.217A

3.1.4 rectifier circuit designing

From the datasheet

Working peak inverse Voltage = 50V

Average Rectified output current = 1.0A

RMS Reverse Voltage, = 35V

Diode Voltage drop = 0.7V

Since the AC output voltage from the transformer secondary voltage = 12V,

● At any instant in the bridge two diodes in series are conducting say D1 and D2

Therefore, IN 4001 diodes are capable of to withstand the above conditions.

31
3.1.5 Design of voltage regulator

Parameter Symbol Type unit

Input voltage Vi 35 V

Output Voltage Vo 5.0 V

Peak Current Ip k 2.2 A

32
3.1.6 Design of a smoothing capacitor
This capacitor offers an infinite reactance to DC sources since in DC, F = 0 Hz.

From the design equation;

C = I/F × V

And from the datasheet

VC = 10; Current 2.9 A and F=100Hz

C=2.9/ (100×10)

=0.0029F

OR 2900 micro Farads

However, this particular value of capacitor is not readily available on the market as compared to the

nearest value which is 3300 micro Farad thus this is the one that will be purchased.

3.1.7 Design of microcontroller

The selected microcontroller is the Pic16f877a which is a 40 pins microcontroller having a processing

speed of 200 ns. From the datasheet this microcontroller has the following specifications;

I. 143 KB of program memory

II. 368 Bytes of RAM

33
III. 256 Bytes of EEPROM

IV. 10-bit up to 8 channel analogue to digital converter.

V. Operating voltage that ranges from 2 to 5.5 V

More details about the microcontroller on the reference number II and III. The clock crystal is connected

externally to provide the timing pulses to the microcontroller. Here a 20Mhz quartz crystal is selected due to

its high durability and excellent precision in timing. From the datasheet catalogue the crystal oscillator is

rated with a supply voltage of 4.94V to 5.46V with a supply current of 50A.

3.1.8 Design of capacitor c2 and c3

C2=C3

C=1/V × f (as from chapter two)

I = 80mA;

F= 20mH

C= 0.8/5×20*10^6

= 8×10^-9 F OR 8nF

Therefore, the nearest value to be purchased is 10nF capacitor since the 8nF is not readily available in the

market.

3.1.9 Design of display unit current limiting resistors

A chosen display unit is the common anode seven segment display unit. It displays numerical values

Each LED segment of a typical 7- segment LED display is rated to operate between 6mA to 20mA of

current offering a voltage drop of about 1.8V across the LED’s diode junction for normal brightness. For

this chosen display unit (Common Anode) the anode of each LED segment is connected together to a 5V

supply (which will be the outputs of our microcontroller).

This +5V voltage is a standard output from our Microcontroller

34
Therefore, with a drop of 1.8V across one segment of LED, then the voltage drop across the limiting resistor

is given as follows;

VR = [ Vs – V (drop across LED)]

VR = (5V – 1.8V)

VR = 3.2V

There the resistance value needed to limit each LED’s current to between 6mA to 20mA is as follows;

Value of limiting resistor at 6

R = [Vs – V(led)] ÷ I ( i.e = [5V – 1.8V] ÷ 0.006

= 3.2V ÷ 0.006

= 533.3 Ohms

Value of limiting resistor at 20mA

R = [Vs – V(led)] ÷ I (led) = [5V – 1.8V] ÷ 0.02

= 3.2V ÷ 0.02

= 160 Ohms

Thus at 6mA current the 533ohm resistor will be required while at 20mA the limiting resistor required is the

160 ohms.

However, in reality, any good and standard preferred current limiting resistor value between 220 ohms and

360 ohms could be used to illuminate a 7_segment display from a 5V supply. Also the 220 ohms resistor is

readily available in the market.

Thus I opted to use the 220ohm resistor

35
CHAPTER FOUR
DATA ANALYSIS, FINDINGS, CONCLUSIONS AND RECOMMENTATIONS
4.1. INTRODUCTION
In this chapter data analysis, findings, conclusions and recommendations are stated.
4.1.1 Circuit diagram of passenger bus ticket booking system

36
4.1.2 Project operation

37
From the power supply A C voltage is switched on. This 240V A C voltage is stepped down by the step

down transformer to about 12V A C. This stepped down voltage is then fed into the full wave rectifier

circuit which converts this A C power to D C power. The 12V D C output from the rectifier is then fed onto

the input terminals of the voltage regulator IC used which ensures a stable, ripple free output voltage of

about 5V being provide to the microcontroller through its power input terminals.

For the signal flow and hence display of a digit on the display units it starts by pressing a number on the

keypad that has to be displayed on the display units. This signal from the keypad is transferred into the

microcontroller for processing purposes. After the microcontroller has analyzed the signal it then sends it to

the display unit which it has been interfaced with and then finally the display unit displays the information

as a decimal number

4.1.3 Test and Results Table

TEST VARRIABLE EXPECTED MEASURED COMMENT

POINT VALUE VALUE

1 SUPPLY VOLTAGE 230V 240V GOOD

2 TRANSFORMER OUTPUT 12V 13.3V GOOD

VOLTAGE

3 REGULATOR OUTPUT VOLTAGE 5V 4.88V FAIR

4 VOLTAGE INPUT TO THE 5V 4.10V FAIR

DISPLAY UNIT

4.1.4 Conclusion

From the tests table the microcontroller output voltage that is being fed to the display unit is lower than the

expected 5v this has an effect of reducing the display unit brightness.


38
4.1.5 Recommendations

After carrying out project and testing it, I would like to suggest to whoever will be

continuing with this particular project to consider using other voltage regulator circuits so

as to obtain a standard no load voltage of 5v. Also he or she should consider using the

LCD display unit to avoid overloading the microcontroller by interface and high

resistance wired seven segment display units.

4.1.6 Cost of devices and components

NO. ITEM TYPE RATE(KS QUANT TOT

H) Y AL

1 Microcontroller Arduino 2800 1 2800

uno

2 Capacitor 220 150 2 300

micro

Farad

3 Transformer 800 1 800

4 Display unit Common 100 2 200

anode

5 keypad hexadeci 800 2 1600

mal

6 Voltage Lm87 140 1 140

regulator

39
7 Resistors 220 10 8 80

ohms

8 Jumper wires Male 20 10 200

type

9 Diodes IN4007 10 8 80

10 Soldering wire 30 10m 300

11 Bread board Matrix 120 3 240

type

TOT

AL

5,040

4.1.7 Other costs

40
N0 ITEM TOTAL

. (KSH)

1 Typing 200

2 Binding 1200

3 Fullscaps 600

4 Printing 800

TOTAL

2800

TOTAL COST FOR THE PROJECT = TOTAL COST OF COMPONENTS PLUS OTHER COSTS

= KSH. 7,840

REFERENCE
1. ELECTRICAL TECHNOLOGY BOOK BY EDWARD HUGHES

2. TEXT BOOK OF ELECTRICAL TECHNOLOGY BOOK BY B.L THERAJA

3. MICROPROCESSOR AND INTERFACING BOOK BY NIKHIL MARRIWALA

4. THE 8085 MICROCONTROLLER AND EMBEDDED SYSTEMS BY MAZIDI

41

You might also like