Professional Documents
Culture Documents
Final Trade Project Milestone 3
Final Trade Project Milestone 3
Final Trade Project Milestone 3
TRADE PROJECT
ii
DEDICATION
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
Secondly I want to thank my parents and guardians for the full support they offered to me during the whole
Last but not least I would like to thank all my friends and classmates for sharing of important ideas and
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
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
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
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
vi
ABBREVIATIONS
IV. V - Volts
V. R - Resistance
VI. C - Capacitor
XIV. Q1 - Transistor 1
XVIII. KB - Kilobyte
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
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
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.
POWER SUPPLY
DISPLAY UNIT 1
KEYPAD 1 MICROCONTROLLER
POWER SUPPLY
2
This particular unit is very important in this circuit because it converts the 240V AC mains supply to 12V
circuit which comprises four diodes, one resistor and a capacitor for the purpose of filtering any AC ripples
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
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
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
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
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.
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.
This is the unit that supplies power to the entire circuit therefore it consists of the following blocks;
This is normally made up of two rectifier filter capacitors, bleeder resistors, a transformer and a transistor; it
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.
It is normally designed in a way such that in the case of power failure or power disruption, it allows the load
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
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
I. Step up transformers- Are those transformers that are used in stepping up lower voltages to higher
II. Step downs transformers- These are transformers which are used to step down higher voltage
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
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
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
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
In this project the type of transformer to be used is the Iron core type. Since it has brilliant magnetic
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.
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
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
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
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
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.
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
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
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.
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.
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
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
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
These display units are mostly used in; digital clocks, electronic meters, basic calculators and other
● Nine-segment display
● Fourteen-segment display
● Dot-matrix display
The seven segment display Is the most common display device used in many gadgets and electronic
These display units consist of seven segments of light emitting diodes (LEDs) and that are assembled into a
Seven segment display unit contains 8-segments wherein an extra 8 th segment is used to display dot. This
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
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
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.
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
II.10.KEYPAD
This is a miniature keyboard or set of buttons for operating a portable electronic device, telephone or other
equipment.
I. Qwerty 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
Numeric keypad - A numeric keypad, or ten keys is the palm- sized usually -17key section of standard
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
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
In this project I will be using a numeric keypad due to the following reasons;
● 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.
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
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.
j) Watchdog- This is a timer connected to a completely separate R-C oscillator within the
microcontroller
II.11.2.Types of Microcontrollers
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
In the process of adding an external ROM to 8031, you will lose two ports hence leaving you with only two
● 0 KB of ROM
● 2 timers
● 32 I/O pins
● 1 serial port
● 6 interrupt sources
● 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
III. 2 Timers
V. 6 interrupt sources
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.
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
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
31
3.1.5 Design of voltage regulator
Input voltage Vi 35 V
32
3.1.6 Design of a smoothing capacitor
This capacitor offers an infinite reactance to DC sources since in DC, F = 0 Hz.
C = I/F × V
C=2.9/ (100×10)
=0.0029F
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.
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;
33
III. 256 Bytes of EEPROM
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.
C2=C3
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.
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
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 = (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;
= 3.2V ÷ 0.006
= 533.3 Ohms
= 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
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
VOLTAGE
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
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
H) Y AL
uno
micro
Farad
anode
mal
regulator
39
7 Resistors 220 10 8 80
ohms
type
9 Diodes IN4007 10 8 80
type
TOT
AL
5,040
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
41