You are on page 1of 55

A PROJECT ON

DESIGN AND FABRICATION OF FUEL COST


CALCULATOR

Session: 2014-2018

Group Members:
DOST MUHAMMAD (REGISTRATION NO)
ABDUSSABOOR (REGISTRATION NO)
IZHAR AHMAD (REGISTRATION NO)
MUHAMMAD AYAZ (REGISTRATION NO)
Supervised by:

SUPERVISOR NAME
Engr. Iqbal Munir

DEPARTMENT OF B. TECH ELECTRICAL ENGINEERING TECHNOLOGY

GOVERNMENTCOLLEGE OF TECHNOLOGY
MINGORA AWAT
ABSTRACT

Nowadays bargaining the fare with the cab driver is an issue which mostly gets
unsuccessful as the cab driver demands a high fare which the client doesn’t want to give
and so the deal fails and sometimes exchange of harsh words occur. This all drama occurs
because there is not a proper channel of measuring a well and proper fare and no one has
even thought about this issue. We used to face such issues daily which led us to designing
a fuel consumption cost calculator in our final year project to get rid of this issue so we
prepared a prototype of the fuel cost calculator which could be installed in the cabs.
In our prototype we have used two flow rate sensors at the inlet and outlet of the engine
which are connected to the arduino. The readings of the inlet and outlet sensors are
registered on the LCD connected in the circuit to the arduino. Now when fuel is passé
through the sensors so four readings are displayed on LCD. One is inlet, the second is
outlet, third one is the consumption (difference between the inlet and outlet readings) and
the Trip readings (price of the fuel with the percentage multiplied).When this is installed
in the cabs it will automatically display the trip to the client and the issue will be solved.

i
APPROVAL CERTIFICATE

It is certified that the work presented in this thesis, entitle “DESIGN AND
FABRICATION OF FUEL COST CALCULATOR” was conducted by DOST
MUHAMMAD, IZHAR AHMAD, ABDUSSABOOR and AYAZ AHMAD under the
supervision of IQBAL MUNIR is hereby approved as partial fulfillment of the
requirement for the award of BTECH degree in ELECTRICAL.

Signature of Signature of
Supervisor Chairman

Signature of
External Examiner

ii
DEDICATION

Dedicated to our beloved parents and teachers who enabled us and gives us the
opportunity to achieve our goals and aims and to the whole Humanity as we had tried our
best to serve humanity through this project.

iii
ACKNOWLEDGEMENT

In the name of Allah, The most gracious, merciful, the most compassionate, the
One and only supreme power, the One who make everything possible, and the One
without Who’s will the simplest is impossible. We are thankful to our parents for their
prayers and support, as we could never have achieved this moment without them. We are
extremely grateful to our project supervisor IQBAL MUNIR for his guidance, support and
motivation we needed and also for the constructive criticism as it would have difficult to
complete this project without his support. It is also an honor for us to thank our
departmental staff for their support and encouragement during the course of our project.
Last but not least we are thankful to our well-wishers.

Students 1 Dost Muhammad


2 Izhar Ahmad
3 Abdussaboor
4 Muhammad Ayaz

iv
TABLE OF CONTENTS

ABSTRACT........................................................................................................................i
APPROVAL CERTIFICATE..........................................................................................ii
DEDICATION..................................................................................................................iii
ACKNOWLEDGEMENT...............................................................................................iv
Chapter 1............................................................................................................................1
Introduction........................................................................................................................1
1. Fuel Cost Calculator........................................................................................................1
1.1.1 What is fuel cost calculator?...............................................................................1
1.1.2 Types of Fuel Cost Calculator............................................................................1
1.1.3 What’s new in this?............................................................................................1
1.2 Need of the Project....................................................................................................2
1.2.1 Online Cab Service.............................................................................................2
1.2.2 Maintenance of Vehicles....................................................................................3
1.2.3 Summary.............................................................................................................3
1.3 Aims and Objectives..................................................................................................4
1.3.1 Objectives...........................................................................................................4
1.4 Literature Review......................................................................................................4
1.4.1 YF-S201 Hall Effect Fuel Sensor.......................................................................4
1.4.2 Features...............................................................................................................5
1.4.3 Connection Details..............................................................................................6
1.4.4 Hall Effect Sensor...............................................................................................6
1.4.5 Working Principle...............................................................................................7
Chapter 2............................................................................................................................9
Methodology.......................................................................................................................9
2.1 Methodology..............................................................................................................9
2.2 Flow Chart.................................................................................................................9
2.3 Requirements...........................................................................................................10
2.4 Literature Review....................................................................................................11
2.4 Design of a Circuit...................................................................................................11
2.6 Coding/Programing..................................................................................................12
2.7 Flow Sensors............................................................................................................12

v
2.8 Fabrication and Analysis.........................................................................................13
2.9 Testing:....................................................................................................................13
2.9.1 Water Testing....................................................................................................13
2.9.2 Air Testing........................................................................................................13
Chapter 3..........................................................................................................................15
Hardware Description.....................................................................................................15
3.1 Project Pictures........................................................................................................15
3.2 Arduino UNO..........................................................................................................15
3.3 Arduino Software Development Environment........................................................22
3.4YF-S201 Hall Effect Water Flow Meter / Sensor....................................................23
3.4.2 Features.............................................................................................................23
3.4.3 Connection Details............................................................................................24
3.5 Liquid Crystal Display (LCD).................................................................................24
Important command codes for LCD..........................................................................28
3.6 Arduino 9V 1 Ampere Power Supply 220/110 Volt...............................................30
Product description........................................................................................................30
Product information.......................................................................................................31
Chapter 4..........................................................................................................................32
Design and Fabrication...................................................................................................32
4.1 Proteus Model..........................................................................................................32
4.2 Explanation of Flow Chart:.....................................................................................33
4.3 Software...................................................................................................................33
Chapter 5..........................................................................................................................41
Experimental Work.........................................................................................................41
5.1 Introduction..............................................................................................................41
5.2 Air Testing...............................................................................................................41
5.3 Testing of Prototype on Water.................................................................................41
5.4 Testing of Prototype on Bike...................................................................................42
5.5 Petrol Testing of Prototype......................................................................................42
Chapter 6..........................................................................................................................44
Conclusion and Future Works.......................................................................................44
6.1 Conclusion...............................................................................................................44
6.2 Future Works...........................................................................................................44
6.2.1 Diesel Engines..................................................................................................45

vi
6.2.2 Gas Engines......................................................................................................45
6.2.3 Sensor Selection................................................................................................45
6.2.4 Synchronization................................................................................................45
6.2.5 on Motor Bikes.................................................................................................46

vii
TABLE OF FIGURES

Figure 1 Hall Effect Sensor-------------------------------------------------------------------------6


Figure 2 Working of Hall Effect Sensor----------------------------------------------------------8
Figure 3 Design of a Circuit-----------------------------------------------------------------------12
Figure 4 IDE of Aurdino---------------------------------------------------------------------------22
Figure 5 16X2 LCD Pin-out diagram------------------------------------------------------------25
Figure 6 Liquid Crystal Display (LCD)---------------------------------------------------------27
Figure 7 Vehicle Unit Circuitry-------------------------------------------------------------------32

viii
Chapter 1
Introduction

1. Fuel Cost Calculator


1.1.1 What is fuel cost calculator?
By the term fuel cost calculator we means to have such a device in an automobile
which can show us the exact amount of fuel consumed by the engine while travelling, in
terms of money.

1.1.2 Types of Fuel Cost Calculator


There can be two types of methodologies while designing such a device that is:
The first one is that we should make and connect a dynamometer type of device
which can measure the revolutions of the wheel, and then by knowing how much
kilometers the vehicle travelled, we can calculate the mileage of the specific vehicle. But
this is an old approach and is not automated.
The second approach is what we design for, actually we installed a flow rate
sensor at the inlet pipe of fuel to engine and at the exit of the engine which carries the
unburnt fuel back to petrol tank. These sensors are connected to a Nano aurdino
microcontroller, the sensor at the inlet shows the flow rate of petrol which is coming to
engine from the tank, the second sensor at the exit shows the unburnt fuel going back up
to the tank. The difference of the inlet and exit shows us the actual fuel consumed by the
engine, this consumed fuel is multiplied with the rate of fuel and then the trip cost is
displayed. Actually the flow rate is measured by the sensor in terms of revolutions of a
fan, these revolutions generate pulses and this signal is then further transferred to the
aurdino microcontroller and that microcontroller is being coded as such that it displays
the result in terms of money on the LCD (Liquid Crystal Display), that of how much
money did petrol is consumed.

1
1.1.3 What’s new in this?
The new thing which we added in this device is the global system for mobile
communication that is the GSM technology. As we know that in this era we need to have
all our data on the internet that it should be easily accessible every time and it should be
synchronized with the smartphone and we can easily check the demanded results anytime
and anywhere in the world. Basically our purpose was to serve the online cab services
that if they install this device in their cars they will not only get the fuel consumption but
the owner of the car can check how much and when fuel is consumed as the fuel
consumption record will automatically go to the server and that can be easily check from
any nearby internet source just you have to logon and then check that, secondly it can
also be checked on smartphone if we have that android application with us.
So what’s the benefit of keeping the internal record, the most prime advantage in
this is that, being an owner it is easy to keep check and balance on all rides if my vehicle
is running on any of the online cab services.

1.2 Need of the Project


After understanding all the basics about what actually is the fuel cost calculator we need
to go around the topic that why actually we need to design this for automobiles?

1.2.1 Online Cab Service


The foremost point from where the idea originated was actually the online cab
services like Uber and Careem. While travelling a person is only charged on the basis of
distance he travelled and the waiting charges due to traffic.
Online cab Services have placed many vehicles like 660CC car and 1000CC car
in the same category and the rates are decided on the basis of the category in which they
fall. For example, the per kilometer rate and the per min waiting charge for category A is
decided. now category A consists of two different types of cars having two different
engine powers and this we all know that fuel consumption is directly proportional to the
power of engine. So Mr A having 660CC car can save much compared to Mr B having
1000CC car, because of the fact that the rates are not charged on the basis of the fuel

2
consumption of the car but are merely charged on the basis of distance travelled and
waiting time charges.
Secondly, if we only consider waiting charges, like if the vehicle is static so its
consuming some fuel but the new technology named as eco-idle has overcome this issue
as well and the max of new 660 CC cars have this technology by default even then we are
charged for this.
So, the basic need which we felt and which force us to design this project was to
convert the system of online cab services from charging on distance and time to charging
on the basis of fuel consumption. Secondly to make this a more friendly system for the
owner who is buying this because as its explained earlier that is very easy to use and we
can check the details everywhere and whenever we want to check. This will be easy for
the owner of the car to keep check and balance to avoid the losses.

1.2.2 Maintenance of Vehicles


The other thing behind this project was that the fuel consumption of an engine on
the performance of the engine clearly depend upon the condition of the engine. For
example, if we have a well maintained engine whose engine oil and all other necessities
are fulfilled on time, it will be more fuel economic then that engine which is poor in
condition regarding its maintenance.
So what this design actually is providing is not only the fuel consumption of the
vehicle but also the record of all the trips in which this fuel is consumed. So the question
is that what that record has to do with the maintenance of the vehicle? Actually if we are
storing the record of the consumption of the fuel on daily basis and continue to keep that
for a specific period of time. Let’s suppose at the start of the month was giving a mileage
of 16 km in 1 liter and for example the same engine shows a mileage of 14 km in 1 liter
at the end of month which will be clearly showed on the graph which is developed
automatically on daily basis. So, by seeing this one can easily get to know that something
is going wrong with the car due to which mileage reduced in 1 month, it may be many
reason like it can be a low tire pressure, it can be the engine oil which is supported to be
changed, it can be that an engine needs a proper tuning etc.

3
1.2.3 Summary
Benefits of fuel consumption calculator and the need of this device for which we
made this was basically to serve the following some purposes.
 Reduced rate for customers.
 Justified earning for owners.
 Less rate, more customers.
 Proper maintenance overview of the vehicle.
 Proper database and its synchronization with the internet and Android mobile
application.

1.3 Aims and Objectives


This thesis focuses mainly on how to estimate the fuel consumption of a petrol
engine with sufficient accuracy. However this model can be used for all types of
automobile engines with little changes. Different methods to estimate fuel consumption
are there. Our basic aim was that now in online cab services charge on the basis of the
kilometers we go.

1.3.1 Objectives
 The first and foremost objective is to achieve a design for automobile that clearly indicate
the amount of fuel consumed in term of currency.
 Secondly the design is such that its compatible plus it is less in cost and easily accessible.
 The design is user friendly, so that the maintenance or changes to be performed are easy
and less costly.
 This device efficiently reduced the cost of online cab services for the customer and in
turn will provide justified profit for the owner of the car.
 Design is having a database which keeps records of the trips and thus can help us in
going preventive maintenance when required.
 Design is able to show amount of fuel consumed in monetary terms as well as the
remaining amount of fuel in tank.

4
1.4 Literature Review
1.4.1 YF-S201 Hall Effect Fuel Sensor
This sensor sits in line with your water line and contains a pinwheel sensor to
measure how much liquid has moved through it. There's an integrated magnetic Hall
Effect sensor that outputs an electrical pulse with every revolution. The Hall Effect
sensor is sealed from the water pipe and allows the sensor to stay safe and dry.

The sensor comes with three wires: red (5-24VDC power), black (ground) and
yellow (Hall Effect pulse output). By counting the pulses from the output of the sensor,
you can easily calculate water flow. Each pulse is approximately 2.25 milliliters. Note
this isn't a precision sensor, and the pulse rate does vary a bit depending on the flow rate,
fluid pressure and sensor orientation. It will need careful calibration if better than 10%
precision is required. However, it’s great for basic measurement tasks!

We have as example Arduino sketch that can be used to quickly test the sensor, it
will calculate the approximate flow of water in liters/hour.

The pulse signal is a simple square wave so it’s quite easy to log and convert into
liters per minute using the following formula.

Pulse frequency (Hz) / 7.5 = flow rate in L/min.

1.4.2 Features

 Model: YF-S201
 Sensor Type: Hall effect
 Working Voltage: 5 to 18V DC (min tested working voltage 4.5V)
 Max current draw: 15mA @ 5V
 Output Type: 5V TTL
 Working Flow Rate: 1 to 30 Liters/Minute
 Working Temperature range: -25 to +80℃
 Working Humidity Range: 35%-80% RH
 Accuracy: ±10%

5
 Maximum water pressure: 2.0 MPa
 Output duty cycle: 50% +-10%
 Output rise time: 0.04us
 Output fall time: 0.18us
 Flow rate pulse characteristics: Frequency (Hz) = 7.5 * Flow rate (L/min)
 Pulses per Liter: 450
 Durability: minimum 300,000 cycles
 Cable length: 15cm
 1/2" nominal pipe connections, 0.78" outer diameter, 1/2" of thread
 Size: 2.5" x 1.4" x 1.4"

1.4.3 Connection Details

 Red wire : +5V
 Black wire : GND
 Yellow wire: PWM output.

Figure 1 Hall Effect Sensor

6
1.4.4 Hall Effect Sensor
A Hall Effect sensor is a transducer that varies its output voltage in response to
a magnetic field. Hall Effect sensors are used for proximity switching, positioning,
speed detection, and current sensing applications.

In a Hall Effect sensor, a thin strip of metal has a current applied along it. In the
presence of a magnetic field, the electrons in the metal strip are deflected toward one
edge, producing a voltage gradient across the short side of the strip (perpendicular to
the feed current). Hall Effect sensors have an advantage over inductive sensors in
that, while inductive sensors respond to a changing magnetic field which induces
current in a coil of wire and produces voltage at its output, Hall Effect sensors can
detect static (non-changing) magnetic fields.

In its simplest form, the sensor operates as an analog transducer, directly returning


a voltage. With a known magnetic field, its distance from the Hall plate can be
determined. Using groups of sensors, the relative position of the magnet can be
deduced.

Frequently, a Hall sensor is combined with threshold detection so that it acts as


and is called a switch. Commonly seen in industrial applications such as the
pictured pneumatic cylinder, they are also used in consumer equipment; for example
some computer printers use them to detect missing paper and open covers. They can
also be used in computer keyboards, an application that requires ultra-high reliability.

Hall sensors are commonly used to time the speed of wheels and shafts, such as
for internal combustion engine ignition timing, tachometers and anti-lock braking
systems. They are used in brushless DC electric motors to detect the position of the
permanent magnet. In the pictured wheel with two equally spaced magnets, the
voltage from the sensor will peak twice for each revolution. This arrangement is
commonly used to regulate the speed of disk drives.

7
1.4.5 Working Principle
This illustration gives detailed working method of hall effect sensor based water
flow sensor, a turbine wheel embed with magnet is placed on a closed plastic envelope
and a Hall effect sensor placed, When the water flows through the pipeline, it makes the
turbine wheel to rotate and hence the magnet flux interferes the hall sensor, the rate
of interference is depends on the speed of water flow, so the hall effect sensor produce
pulse signal output, this pulse output can be calculated as water volume.

Figure 2 Working of Hall Effect Sensor

8
Chapter 2
Methodology

2.1 Methodology
Our approach towards achievement of our goals was just simple. We achieve
them by setting some small objectives and then the combinations of all these lead us to
the compilation of our project. Although it was a tough task to achieve the set goals on
the specified time, but we did that. Figure below shows the flowchart of our approach
towards this project, this may vary from person to person.

2.2 Flow Chart

Requirements
(Design Conditions)

Literature Review

Designing of Circuit

Coding/Programing

Fabrication and
Analysis

Testing

9
2.3 Requirements
This is the first and foremost step in our project's methodology which is stated as
requirements or design conditions for the accomplishment of our project. Firstly we
wanted to design a fuel cost calculator so for that the most important was the sensor
requirement, then the requirement was that which type of sensor it should be. As we had
to measure the flow rate of the fuel flowing from tank to engine and then to convert that
with the help of pulses and electric wires and transfer that signal to aurdino which is
coded as such that it show us the cost of trip by simply multiplying the cost which is
coded with the milliliters of fuel used. So the first requirement was to have flow rate
sensor which must have easy connection with the aurdino so that it should transfer signals
of the flowrate measured easily to the aurdino. Secondly the requirement of the sensor
was also to fulfill the design requirements of the engine we selected that is the line size
etc.
The second requirement was the arduino selection which arduino microcontroller
we should select which can also serve our purpose easily and should not require that
much of space. Normally arduino UNO is available in the market but its size is too much
so we selected the arduino Nano which served our purpose and was comparatively small
in size so was very much suitable for us.
The third requirement with us was the selection of engine that, which engine
should we consider for our experiments so for that purpose the car was unavailable and
that was also not justified economically so we choose to have a 70 cc engine is that was a
cheap rates as compared to that of car, and we selected as 70cc engine for our Analysis,
on which we later failed to perform this because of the limitations discussed in later
chapters.
The fourth requirement was the selection of software for the design purpose, by
the term design in this I mean to say the design of a circuit and for that we had to choose
a software which is more user friendly and easy to use for us. So, we preferred to use
proteus for the design of our circuit.
Above we discussed some of the basic and major requirements or design
considerations for our project which fully explains the first step of our methodology for
the accomplishment of this project.

10
2.4 Literature Review
The second step in our project was the literature review of our project and mostly
of the hardware we are using in this project. Firstly the main thing was to check the
working principle of that flow sensor like on which principle that sensor is working and
would that serve our purpose or not. The second step was to check the details
specification of the sensor for example what is its line size, what is the working pressure,
working temperature range and working flow range etc.
Secondly we also had a detailed study about the arduino microcontroller that what
are the available types of this type of microcontroller available in the market and what is
the most suitable for us both economically and size wise because we needed the one
which is small in size and weight to have a minimum size of that.
While Literature review related to this project was not available as such as it was
fully a new idea which just came to our mind while travelling in an online cab service. So
we decided to work on it and make a device which can be installed to calculate and give
result in terms of currency of the fuel used in that.

2.4 Design of a Circuit


The Third step was to develop a design of a circuit for that purpose we need to
have the description of all the device ranging from very small to very large components
attached in the circuit. After that we will be able to design a circuit in a software. This
software which we are using for the design of a circuit is Proteus. With the help of design
it is easy for us when we are making the original circuit because of the fact that all the
connections are already made in the design and are easy to joint practically.
The design or the circuit diagram of this project includes all the components that
is the aurdino micro controllers, the LCD, the flow rate sensors, the GSM circuit,
Switches used for different purposes, regulators, jumper wires, and many more.
As the title of the project suggested that the design and fabrication of a fuel
calculator so it is the basic and most important step during the accomplishment of the
project and so is the part of methodology.

11
Figure 3 Design of a Circuit

2.6 Coding/Programing
Actually our whole project is based on the programming and this is the actually
the main thing which took all of our time because we have two aurdinos installed in the
circuit to serve two different purposes. Each of the aurdino, its coding was a really hectic
task to fulfill so that why this step is the backbone of our project.

2.7 Flow Sensors


The first arduino we took and programmed for the purpose of flow sensors so that
our both flow sensors would work accordingly and then calibrated those sensors
according to the fluid and then tested those sensors for the purposes of checking the
coding but the problem was we needed to save our data in some devices but its aurdino
ran short of storage so for this reason we needed to have a second aurdino and some other
task of that one is described below.

12
2.8 Fabrication and Analysis
This step include the fabrication of the designed circuit along with the coded
aurdino, so that to check whether the circuit and the code is running properly or not. The
methodology in this step was first to properly check the circuit its connections with the
battery and all the connections. To check the code which is burned in the aurdino that
whether it is working properly or not.
Fabrication also include the connections of the sensors on the respective pipes that
is the inlet pipe to the engine and the exit pipe to the engine. Inlet sensor is fitted in the
pipe coming from the petrol tank towards the engine and the exit sensor is installed on the
pipe which is carrying the unburnt, like we actually did not connected these pipes to the
engine but we made a prototype to demonstrate.
Analysis of this circuit and coding was done on the basis of the water flow firstly,
there were errors at first but then we removed them to maximum limit. After this we
tested this fabricated circuit on a 70cc bike engine, but due to limitations discussed in
later chapters we were not able to perform that on a 70cc engine.
This step, fabrication and analysis, lead us to the final testing our project, in this
we tested for all possible solutions the one which is left is the petrol engine of the car.

2.9 Testing:

2.9.1 Water Testing

The first step in testing is water testing, as the circuit was ready the most easy
thing available for us and for test was water testing to check the flow rate measured by
sensor is giving us the correct reading or not.so firstly we check it on water and our
reading of water flow were accurate with a little bit of errors. The amount of fuel
measured by the sensor was according to the reading of water we measured manually.

2.9.2 Air Testing

The second test of a testing process was of air is the sensor contain a pinwheel
and due to rotation of that wheel we could easily measure That Flow rate of the fluid

13
flowing.as we know that air is also a fluid and this sensor is designed for fluid so to check
the readings of the sensor on air was also a mandatory and we got good results a little bit
of errors.

14
Chapter 3
Hardware Description

3.1 Project Pictures


The vehicle unit will consist of Arduino, Vibration Sensor, GPS and GSM .These
four things will be used for detection of accident, finding exact location and sending SMS
to the ambulance .The whole process will take place within 5 seconds.

3.2 Arduino UNO

Arduino Uno is a microcontroller board based on the ATmega328P


(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM
outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power
jack, an ICSP header and a reset button. It contains everything needed to support
the microcontroller; simply connect it to a computer with a USB cable or power
it with a AC-to-DC adapter or battery to get started. You can tinker with your
UNO without worrying too much about doing something wrong, worst case
scenario you can replace the chip for a few dollars and start over again.

"Uno" means one in Italian and was chosen to mark the release of
Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino
Software (IDE) were the reference versions of Arduino, now evolved to newer
releases. The Uno board is the first in a series of USB Arduino boards, and the
reference model for the Arduino platform; for an extensive list of current, past
or outdated boards see the Arduino index of boards.

Microcontroller ATmega328P
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limit) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)

15
PWM Digital I/O Pins 6
Analog Input Pins 6
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
32 KB (ATmega328P) of which 0.5 KB
Flash Memory
used by boot loader
SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
Clock Speed 16 MHz
LED_BUILTIN 13
Length 68.6 mm
Width 53.4 mm
Weight 25 g
Programming

The Arduino Uno can be programmed with the (Arduino Software (IDE)).


Select "Arduino/Genuino Uno from the Tools > Board menu (according to the
microcontroller on your board). For details, see the reference and tutorials.

The ATmega328 on the Arduino Uno comes preprogrammed with


a bootloader that allows you to upload new code to it without the use of an
external hardware programmer. It communicates using the original STK500
protocol (reference, C header files).

You can also bypass the bootloader and program the microcontroller
through the ICSP (In-Circuit Serial Programming) header using  Arduino ISP or
similar; see these instructions for details.

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source
code is available in the Arduino repository. The ATmega16U2/8U2 is loaded
with a DFU bootloader, which can be activated by:

16
 On Rev1 boards: connecting the solder jumper on the back of the board (near the
map of Italy) and then rese ing the 8U2.

 On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line
to ground, making it easier to put into DFU mode.

You can then use Atmel's FLIP software (Windows) or the DFU


programmer (Mac OS X and Linux) to load a new firmware. Or you can use the
ISP header with an external programmer (overwriting the DFU bootloader).
See this user-contributed tutorial for more information.

Warnings

The Arduino Uno has a resettable polyfuse that protects your computer's
USB ports from shorts and overcurrent. Although most computers provide their
own internal protection, the fuse provides an extra layer of protection. If more
than 500 mA is applied to the USB port, the fuse will automatically break the
connection until the short or overload is removed.

Differences with other boards

The Uno differs from all preceding boards in that it does not use the
FTDI USB-to-serial driver chip. Instead, it features the Atmega16U2
(Atmega8U2 up to version R2) programmed as a USB-to-serial converter.

Power

The Arduino Uno board can be powered via the USB connection or with
an external power supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter


(wall-wart) or battery. The adapter can be connected by plugging a 2.1mm
center-positive plug into the board's power jack. Leads from a battery can be
inserted in the GND and Vin pin headers of the POWER connector.

17
The board can operate on an external supply from 6 to 20 volts. If
supplied with less than 7V, however, the 5V pin may supply less than five volts
and the board may become unstable. If using more than 12V, the voltage
regulator may overheat and damage the board. The recommended range is 7 to
12 volts.

The power pins are as follows:

 Vin. The input voltage to the Arduino/Genuino board when it's using an external
power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage
via the power jack, access it through this pin.

 5V.This pin outputs a regulated 5V from the regulator on the board. The board
can be supplied with power either from the DC power jack (7 - 12V), the USB
connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the
5V or 3.3V pins bypasses the regulator, and can damage your board. We don't
advise it.

 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.

 GND. Ground pins.

 IOREF. This pin on the Arduino/Genuino board provides the voltage reference
with which the microcontroller operates. A properly configured shield can read
the IOREF pin voltage and select the appropriate power source or enable voltage
translators on the outputs to work with the 5V or 3.3V.

Memory

The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It


also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written
with the EEPROM library).

18
Input and Output

See the mapping between Arduino pins and ATmega328P ports. The
mapping for the Atmega8, 168, and 328 is identical.

PIN MAPPING ATmega328P

Each of the 14 digital pins on the Uno can be used as an input or output,
using pinMode(),digitalWrite(), and digitalRead() functions. They operate at 5
volts. Each pin can provide or receive 20 mA as recommended operating
condition and has an internal pull-up resistor (disconnected by default) of 20-
50k ohm. A maximum of 40mA is the value that must not be exceeded on any
I/O pin to avoid permanent damage to the microcontroller.

In addition, some pins have specialized functions: 


 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2
USB-to-TTL Serial chip.

 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt


on a low value, a rising or falling edge, or a change in value. See the
attachInterrupt() function for details.

 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.

 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI


communication using the SPI library.

 LED: 13. There is a built-in LED driven by digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.

 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the
Wire library.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10
bits of resolution (i.e. 1024 different values). By default they measure from

19
ground to 5 volts, though is it possible to change the upper end of their range
using the AREF pin and the analogReference() function. There are a couple of
other pins on the board:

 AREF. Reference voltage for the analog inputs. Used with analogReference().

 Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.

Communication

Arduino/Genuino Uno has a number of facilities for communicating with


a computer, another Arduino/Genuino board, or other microcontrollers. The
ATmega328 provides UART TTL (5V) serial communication, which is available
on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this
serial communication over USB and appears as a virtual com port to software on
the computer. The 16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required. The
Arduino Software (IDE) includes a serial monitor which allows simple textual
data to be sent to and from the board. The RX and TX LEDs on the board will
flash when data is being transmitted via the USB-to-serial chip and USB
connection to the computer (but not for serial communication on pins 0 and 1).

A Software Serial library allows serial communication on any of the


Uno's digital pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The
Arduino Software (IDE) includes a Wire library to simplify use of the I2C bus;
see the documentation for details. For SPI communication, use the SPI library.

Automatic (Software) Reset

Rather than requiring a physical press of the reset button before an


upload, the Arduino/Genuino Uno board is designed in a way that allows it to be
reset by software running on a connected computer. One of the hardware flow

20
control lines (DTR) of the ATmega8U2/16U2 is connected to the reset line of
the ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken
low), the reset line drops long enough to reset the chip. The Arduino Software
(IDE) uses this capability to allow you to upload code by simply pressing the
upload button in the interface toolbar. This means that the bootloader can have a
shorter timeout, as the lowering of DTR can be well-coordinated with the start
of the upload.

This setup has other implications. When the Uno is connected to either a
computer running Mac OS X or Linux, it resets each time a connection is made
to it from software (via USB). For the following half-second or so, the
bootloader is running on the Uno. While it is programmed to ignore malformed
data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened. If a sketch running
on the board receives one-time configuration or other data when it first starts,
make sure that the software with which it communicates waits a second after
opening the connection and before sending this data.

The Uno board contains a trace that can be cut to disable the auto-reset.
The pads on either side of the trace can be soldered together to re-enable it. It's
labeled "RESET-EN". You may also be able to disable the auto-reset by
connecting a 110 ohm resistor from 5V to the reset line; see  this forum
thread for details.

Revisions

Revision 3 of the board has the following new features:

 1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two
other new pins placed near to the RESET pin, the IOREF that allow the shields
to adapt to the voltage provided from the board. In future, shields will be
compatible with both the board that uses the AVR, which operates with 5V and

21
with the Arduino Due that operates with 3.3V. The second one is a not
connected pin, that is reserved for future purposes.

 Stronger RESET circuit.

 Atmega 16U2 replace the 8U2.

3.3 Arduino Software Development Environment


Arduino uses its specific specific IDE for growth of its program that possibly
effortlessly taken from its web page. The programming language arrangement is
essentially like the syntax use for Java which is straightforward and include a number of
libraries.
The open-source Arduino programming progress environment makes it simple to
compose code and switch it to the input/output board. It runs on windows, Mac OS X and
Linux. The program is written in Java syntax and targeted around Processing, avr-gcc and
different open source application

22
Figure 4 IDE of Aurdino

3.4YF-S201 Hall Effect Water Flow Meter / Sensor


This sensor sits in line with your water line and contains a pinwheel sensor to
measure how much liquid has moved through it. There's an integrated magnetic Hall
Effect sensor that outputs an electrical pulse with every revolution. The Hall Effect
sensor is sealed from the water pipe and allows the sensor to stay safe and dry.

The sensor comes with three wires: red (5-24VDC power), black (ground) and
yellow (Hall effect pulse output). By counting the pulses from the output of the sensor,
you can easily calculate water flow. Each pulse is approximately 2.25 milliliters. Note
this isn't a precision sensor, and the pulse rate does vary a bit depending on the flow rate,
fluid pressure and sensor orientation. It will need careful calibration if better than 10%
precision is required. However, its great for basic measurement tasks!

23
We have as example Arduino sketch that can be used to quickly test the sensor, it
will calculate the approximate flow of water in liters/hour.

The pulse signal is a simple square wave so it’s quite easy to log and convert into
liters per minute using the following formula.

Pulse frequency (Hz) / 7.5 = flow rate in L/min.

3.4.2 Features

 Model: YF-S201
 Sensor Type: Hall effect
 Working Voltage: 5 to 18V DC (min tested working voltage 4.5V)
 Max current draw: 15mA @ 5V
 Output Type: 5V TTL
 Working Flow Rate: 1 to 30 Liters/Minute
 Working Temperature range: -25 to +80℃
 Working Humidity Range: 35%-80% RH
 Accuracy: ±10%
 Maximum water pressure: 2.0 MPa
 Output duty cycle: 50% +-10%
 Output rise time: 0.04us
 Output fall time: 0.18us
 Flow rate pulse characteristics: Frequency (Hz) = 7.5 * Flow rate (L/min)
 Pulses per Liter: 450
 Durability: minimum 300,000 cycles
 Cable length: 15cm
 1/2" nominal pipe connections, 0.78" outer diameter, 1/2" of thread
 Size: 2.5" x 1.4" x 1.4"

3.4.3 Connection Details

 Red wire : +5V
 Black wire : GND
24
 Yellow wire: PWM output.

3.5 Liquid Crystal Display (LCD)


We come across LCD displays everywhere around us. Computers, calculators,
television sets, mobile phones, digital watches use some kind of display to display the
time. An LCD is an electronic display module which uses liquid crystal to produce a
visible image. The 16×2 LCD display is a very basic module commonly used in DIYs
and circuits. The 16×2 translates a display 16 characters per line in 2 such lines. In this
LCD each character is displayed in a 5×7 pixel matrix.

Figure 5 16X2 LCD Pin-out diagram

Pin
 Function  Name
No

1 Ground (0V) Ground

25
Supply voltage; 5V (4.7V – 5.3V)  Vcc
2

Contrast adjustment; the best way is to use variable resistor


such as a potentiometer. The output of the potentiometer is
 Vo / VEE
3 connected to this pin. Rotate the potentiometer knob forward
and backwards to adjust the LCD contrast.

Selects command register when low, and data register when RS (Register
4
high Select )

5 Low to write to the register; High to read from the register Read/write

Sends data to data pins when a high to low pulse is given; Extra
voltage push is required to execute the instruction and
EN(enable) signal is used for this purpose. Usually, we make it
6 Enable
en=0 and when we want to execute the instruction we make it
high en=1 for some milli seconds. After this we again make it
ground that is, en=0.

7 DB0

8 DB1

9 DB2

10 DB3
8-bit data pins
11 DB4

12 DB5

13 DB6

14 DB7

15 Backlight VCC (5V) Led+

26
16 Backlight Ground (0V) Led-

Figure 6 Liquid Crystal Display (LCD)

RS (Register select)

A 16X2 LCD has two registers, namely, command and data. The register select is used to
switch from one register to other. RS=0 for command register, whereas RS=1 for data
register.

Command Register: The command register stores the command instructions given to


the LCD. A command is an instruction given to LCD to do a predefined task like
initializing it, clearing its screen, setting the cursor position, controlling display etc.
Processing for commands happen in the command register.

27
Data Register:  The data register stores the data to be displayed on the LCD. The data
is the ASCII value of the character to be displayed on the LCD. When we send data to
LCD it goes to the data register and is processed there. When RS=1, data register is
selected.

Important command codes for LCD

Sr.No. Hex Code Command to LCD instruction Register

1 01 Clear display screen

2 02 Return home

3 04 Decrement cursor (shift cursor to left)

4 06 Increment cursor (shift cursor to right)

5 05 Shift display right

6 07 Shift display left

7 08 Display off, cursor off

8 0A Display off, cursor on

9 0C Display on, cursor off

10 0E Display on, cursor blinking

11 0F Display on, cursor blinking

28
12 10 Shift cursor position to left

13 14 Shift cursor position to right

14 18 Shift the entire display to the left

15 1C Shift the entire display to the right

16 80 Force cursor to beginning ( 1st line)

17 C0 Force cursor to beginning ( 2nd line)

18 38 2 lines and 5×7 matrix

Displaying Custom Characters on 16X2 LCD


Generating custom characters on LCD is not very hard. It requires the knowledge
about custom generated random access memory (CG-RAM) of LCD and the
LCD chip controller. Most LCDs contain Hitachi HD4478 controller. CG-RAM is the
main component in making custom characters. It stores the custom characters once
declared in the code. CG-RAM size is 64 byte providing the option of creating eight
characters at a time. Each character is eight byte in size.

CG-RAM address starts from 0x40(Hexadecimal) or 64 in decimal. We can


generate custom characters at these addresses. Once we generate our characters at these
addresses, now we can print them on the LCD at any time by just sending simple
commands to the LCD. Character addresses and printing commands are below

29
In the table above you can see starting addresses for each character with their
printing commands. The first character is generated at address 0x40 to 0x47 and is
printed on LCD by just sending simple command 0 to the LCD. The second character is
generated at address 0x48 to 0x55 and is printed by sending 1 to LCD.

3.6 Arduino 9V 1 Ampere Power Supply 220/110 Volt

 2-flat-pin plug
 110V input voltage
 9V 1A output voltage
 Connector size: 5.5 x 2.1mm
 Center or Tip is positive, sleeve is negative
Product description
High quality switching 'wall wart' AC to DC 9V 1000mA wall power supply
manufactured specifically for Electronics. The output is Center/Tip positive

30
5.5mmx2.1mm connector. These are switch mode power supplies which mean the
output is regulated to 9V and the capable output current is much higher (1000mA!).
These will power most projects that don't require more than 1000mA of current.
Dimensions: 2.91 in x 1.57 in x 1.06 in (7.40 cm x 4.00 cm x 2.70 cm) Weight: 2.54 oz
(72 g),

Product information

Product Dimensions 3 x 3 x 1 inches

Item Weight 0.8 ounces

Manufacturer Corporate Computer

ASIN B018OLREG4

Item model number Corpco-x-9VPS

31
Chapter 4
Design and Fabrication

4.1 Proteus Model

Figure 7 Vehicle Unit Circuitry

32
4.1 Flow Chart

Tank Sensor 1 (A)


Sensor 2 (C)

Engine

Consumption=
S1-S2

A(ml) T (Rs)

C(ml) R (ml)

4.2 Explanation of Flow Chart:


Fuel from tank is forced to flow through pipe using fuel pump sensor -1
gives measured value in ml on LCD some fuel are consumed and the remaining
unburned fuel flow back to tank through sensor-2 (un-burned).the difference of
the two sensors values is consumed fuel (c on LCD).we set .2Rs for 1ml
consumption so if price of 1L=1000ml is 100Rs then for 1L consumption the trip
cost will be 200Rs.

33
4.3 Software
#include <LiquidCrystal.h>
LiquidCrystallcd(4,5,6,7,8,9);
bytestatusLed = 13;

bytesensorInterrupt = 0; // 0 = digital pin 2


bytesensorPin = 2;/////tank pin

// The hall-effect flow sensor outputs approximately 4.5 pulses per second per
// litre/minute of flow.
floatcalibrationFactor = 5.5;

volatile byte pulseCount;

floatflowRate;
unsignedintflowMilliLitres;
unsigned long totalMilliLitres;

unsigned long oldTime;

//////////////////22222222222222222222

byte sensorInterrupt2 = 1; // 0 = digital pin 2


byte sensorPin2 = 3;

// The hall-effect flow sensor outputs approximately 4.5 pulses per second per
// litre/minute of flow.
float calibrationFactor2 = 9.5;

volatile byte pulseCount2;

34
float flowRate2;
unsignedint flowMilliLitres2;
unsigned long totalMilliLitres2;

unsigned long oldTime2;

intremaining_Lt=0;
void setup()
{

// Initialize a serial connection for reporting values to the host


Serial.begin(9600);
lcd.begin(16,2);

lcd.setCursor(3,0);
lcd.print("FUEL COST");
lcd.setCursor(3,1);
lcd.print("CALCULATOR");
delay(3000);

pinMode(sensorPin, INPUT);
digitalWrite(sensorPin, HIGH);
pinMode(sensorPin2, INPUT);
digitalWrite(sensorPin2, HIGH);

pulseCount = 0;
flowRate = 0.0;
flowMilliLitres = 0;
totalMilliLitres = 0;
oldTime = 0;

35
// The Hall-effect sensor is connected to pin 2 which uses interrupt 0.
// Configured to trigger on a FALLING state change (transition from HIGH
// state to LOW state)
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);

pulseCount2 = 0;
flowRate2 = 0.0;
flowMilliLitres2 = 0;
totalMilliLitres2 = 0;
oldTime2 = 0;

// The Hall-effect sensor is connected to pin 2 which uses interrupt 0.


// Configured to trigger on a FALLING state change (transition from HIGH
// state to LOW state)
attachInterrupt(sensorInterrupt2, pulseCounter2, FALLING);
}

/**
* Main program loop
*/
void loop()
{

remaining_Lt=totalMilliLitres-totalMilliLitres2;
lcd.setCursor(0,0);
lcd.print("A:");
lcd.print(totalMilliLitres);
lcd.print(" ");
lcd.setCursor(8,0);
lcd.print("T:");

36
lcd.print(totalMilliLitres2*0.093);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print("C:");
lcd.print(totalMilliLitres2);
lcd.print(" ");
lcd.setCursor(8,1);
lcd.print("R:");
lcd.print(remaining_Lt);
lcd.print(" ");

if((millis() - oldTime) > 1000) // Only process counters once per second
{
// Disable the interrupt while calculating flow rate and sending the value to
// the host
detachInterrupt(sensorInterrupt);

// Because this loop may not complete in exactly 1 second intervals we calculate
// the number of milliseconds that have passed since the last execution and use
// that to scale the output. We also apply the calibrationFactor to scale the output
// based on the number of pulses per second per units of measure (litres/minute in
// this case) coming from the sensor.
flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / calibrationFactor;

// Note the time this processing pass was executed. Note that because we've
// disabled interrupts the millis() function won't actually be incrementing right
// at this point, but it will still return the value it was set to just before
// interrupts went away.
oldTime = millis();

37
// Divide the flow rate in litres/minute by 60 to determine how many litres have
// passed through the sensor in this 1 second interval, then multiply by 1000 to
// convert to millilitres.
flowMilliLitres = (flowRate / 60) * 1000;

// Add the millilitres passed in this second to the cumulative total


totalMilliLitres += flowMilliLitres;

unsignedintfrac;

// Print the flow rate for this second in litres / minute


Serial.print("Flow rate: ");
Serial.print(int(flowRate)); // Print the integer part of the variable
Serial.print("L/min");
Serial.print("\t"); // Print tab space

// Print the cumulative total of litres flowed since starting


Serial.print("Output Liquid Quantity: ");
Serial.print(totalMilliLitres);
Serial.println("mL");
Serial.print("\t"); // Print tab space
Serial.print(totalMilliLitres/1000);
Serial.print("L");

// Reset the pulse counter so we can start incrementing again


pulseCount = 0;

// Enable the interrupt again now that we've finished sending output
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
}

38
if((millis() - oldTime2) > 1000) // Only process counters once per second
{
// Disable the interrupt while calculating flow rate and sending the value to
// the host
detachInterrupt(sensorInterrupt2);

// Because this loop may not complete in exactly 1 second intervals we calculate
// the number of milliseconds that have passed since the last execution and use
// that to scale the output. We also apply the calibrationFactor to scale the output
// based on the number of pulses per second per units of measure (litres/minute in
// this case) coming from the sensor.
flowRate2 = ((1000.0 / (millis() - oldTime2)) * pulseCount2) / calibrationFactor;

// Note the time this processing pass was executed. Note that because we've
// disabled interrupts the millis() function won't actually be incrementing right
// at this point, but it will still return the value it was set to just before
// interrupts went away.
oldTime2 = millis();

// Divide the flow rate in litres/minute by 60 to determine how many litres have
// passed through the sensor in this 1 second interval, then multiply by 1000 to
// convert to millilitres.
flowMilliLitres2 = (flowRate2 / 60) * 1000;

// Add the millilitres passed in this second to the cumulative total


totalMilliLitres2 += flowMilliLitres2;

unsignedint frac2;

// Print the flow rate for this second in litres / minute

39
Serial.print("Flow rate2: ");
Serial.print(int(flowRate2)); // Print the integer part of the variable
Serial.print("L/min");
Serial.print("\t"); // Print tab space

// Print the cumulative total of litres flowed since starting


Serial.print("Output Liquid Quantity2: ");
Serial.print(totalMilliLitres2);
Serial.println("mL");
Serial.print("\t"); // Print tab space
Serial.print(totalMilliLitres2/1000);
Serial.print("L");

// Reset the pulse counter so we can start incrementing again


pulseCount2 = 0;

// Enable the interrupt again now that we've finished sending output
attachInterrupt(sensorInterrupt2, pulseCounter2, FALLING);
}
}
/*
Insterrupt Service Routine
*/
voidpulseCounter()
{
// Increment the pulse counter
pulseCount++;
}
void pulseCounter2()
{
// Increment the pulse counter

40
pulseCount2++;}

Chapter 5
Experimental Work

5.1 Introduction
In this chapter we will study about the working of our project. We have
done some test on our prototype and it is done on three different fluids including
air, water and petrol to check its readings. The first test was very random i.e.
blowing air through sensors. It gave us the idea that the prototype is ready to
check on other fluids. Calibration factor for different fluids were used hit and
trials method. Prototype was also tested on bike using only one sensor i.e. at tank
outlet. Different tests and their results are given below.

5.2 Air Testing


The purpose of air testing was to check circuit all connections and coding.
We found that it’s working properly. No calibration factor was used in this testing
.this test was done by the help of our mouth by blowing air in the sensor.

5.3 Testing of Prototype on Water


The second test was performed using water. We found the calibration
factor as 6.5. After calibrating the sensors we put the measured amount of water
inlet sensor found the result given below. Min to max error in this result was 4 to
9 percent.

5.3aWater Testing Result


S.No Inlet Outlet Consumed Inlet Outlet Consumed Trip
Sensor Sensor Sensor Manual Manual Manual
1. 496 200 296 500 198 195 59

41
2. 595 100 495 600 98 293 99
3. 251 150 101 250 148 56 20
4. 99 40 59 100 41 56 12

5.3bError
S.No Inlet Error Outlet Error Consumed Total Error Min & Max
Error Error
1. 4 2 1 7 (4-9)ml
2. 5 2 2 9 (5-10)ml
3. 1 2 1 4 (1-4)ml
4. 1 1 1 3 (1-4)ml

5.4 Testing of Prototype on Bike


Here we only one sensor at the outlet of the tank. As the unburned fuel
remains in the carburetor and there is no back flow of fuel into tank there was no
need of second sensor. the flow rate of this sensor from 1L per minutes to 30L per
minutes and the flow from tank to engine is very low (flow under gravity) this
sensor was unable to measure the fuel passed through it because of its range
requirements. The prototype could work on bike if we use micro flow sensor
which can measure very small flow rate (not available in Pakistan)

5.5 Petrol Testing of Prototype


Calibration factor for petrol is 7.5 Min to max error in the following four
tests is 4 to 10 ml
5.5a Results of Petrol Testing
S.No Inlet Outlet Consumed Inlet Outlet Consumed Trip
Sensor Sensor Sensor Manual Manual Manual
1. 392 180 212 400 180 210 42
2. 352 200 152 350 200 150 30

42
3. 99 50 49 100 49 52 10
4. 48 25 23 50 27 22 5

5.5bError
S.No Inlet Error Outlet Error Consumed Total Error Min & Max
Error Error
1. 8 0 2 10% (4-10)ml
2. 2 0 2 4% (4-10)ml
3. 1 1 2 4% (4-10)ml
4. 2 2 1 5% (4-10)ml

43
Chapter 6
Conclusion and Future Works

6.1 Conclusion
The aim of this project was to design a calculator which could calculate
cost of consumption of fuel. It means that the amount of fuel consumed by the
engine will result in the cost calculation so that a well measured fare is charged
from the client. It is designed in such a way that two sensors are connected on
both the incoming and outgoing of the engine. The sensors are connected to an
Arduino. The Arduino are programmed which shows the amount of fuel
consumed. This done by finding the difference between the fuels passed from the
two sensors i.e. the inlet and outlet sensors. The Arduino is programmed in such a
way that it simultaneously shows the inlet reading, the outlet reading, the
difference between inlet and outlet reading which is the actual the fuel
consumption and the cost of fuel consumed. The reading noted by the arduino is
then registered on the LED connected to the arduino. The idea of the project was
conceived by the passengers. The hash conversation often seen between
passengers and cabs driver and the bargaining of both are disturb therefore to get
actual value of money we set the consumption cost calculators so that issue
related to bargaining of fare can be resolved.

44
Therefore in order to save the precious time of the passengers and avoid unnecessary
bargaining these calculators can be installed in the cabs with the help of ministry of
transport.

6.2 Future Works


A lot of future work can be done to improve the performance and the use
of
A lot of future work can be done to improve the performance and the use
of this project. We can use this calculator in many circuits a few of future work
are listed below:
1. On Diesel Engines
2. On Gas Engines
3. Sensors selection
4. Synchronization
5. Bikes
6.

6.2.1 Diesel Engines


Calibration factor of diesel fuel have different due to different density so
there will be a lot of changes in its cost calculation. Density of the diesel fluid is
different to that of petrol so it will have a different calibration factor which we
change in the programming while programming to Arduino.

6.2.2 Gas Engines


Gas engine are properly work on gases so here we use such sensors which
are use to detect the flow of gas and consumption of the fluid .So gases have
different calibration factors than that of the petrol and diesel so thus the value of
the calibration factor are changed.

6.2.3 Sensor Selection


We used a Hall Effect magnetic sensor named YF-S201 which is basically
a flow sensor. Flow sensor have some errors mostly vibration of the sensors due

45
to which it bring changes in the reading .so some future work on the sensors to
make the reading accurate. Future works regarding sensors are
 Less Vibration effect
We should choose such type of sensors which do not sense less vibration due to the error
are less and the reading most accurate.
 Installation
Sensors are installed in the engine and tight well that is there should not be any vibration
plus you should take care of the horizontal and vertical positions of the sensors connected
in engine.

6.2.4 Synchronization
All the calculators installed in the cars should have a data base such that it
could be synchronized simultaneously. Mostly in Pakistan the prices of fuel
changes so we must have a data base from which could change the prices of the
calculators installed in the cars at a same time like we change the price in the data
base so it should be applied to all the calculators installed at the same time

6.2.5 On Motor Bikes


It can also be done with on the bike with appropriate sensors connected.
The term appropriate we mean that such type of sensors whose flow rate range
from 0 ml/min because the fuel flow from tank to the engine of the bikes is very
low which is difficult to measure the ordinary sensors so for this purpose to
measure the fuel flow of the bike we have to design a special one to measure the
fuel flow.

46

You might also like