Digital Taxi Fare Meter using Arduino & Speed Sensor
Digital Taxi Fare Meter using Arduino, Encoder & Speed Sensor that measures distance, speed using Arduino Code & display Price value on LCD
- Suitable forB.Tech/Diploma Arduino students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
Overview
In this project we will build a prototype of a
Digital Taxi Fare Meter
using
Arduino
&
Speed Sensor
. This project calculates the
speed
and
distance
traveled by the taxi’s wheel using the
LM393 Speed Sensor
. The
LCD Display
will display the speed and distance traveled continuously. It also generates the final
fare amount
when we press the push button.
The overall idea of this project is to develop a
cost-effective fare meter
that can accurately measure the distance and also can give solutions to
fare payment
difficulties. Using this technology we can digitize the current system in such a way that would be convenient both for the driver, vehicle owner, and passenger.
The display unit displays the parameters by means of the
number of rotations
of the wheel using the LM393-based Speed Sensor. This system mainly consists of an
Arduino board
, a Liquid Crystal Display, and Slotted
Encoder
Bill of Materials
Following is the list of materials for making the
Arduino Digital Taxi Fare Meter
project. You can purchase all these components online from the Amazon link.
S.N.
Components
Quantity
Purchase Link
Arduino Nano Board
Amazon
AliExpress
LM393 Speed Sensor + Encoder Wheel
Amazon
AliExpress
16x2 I2C LCD Display
Amazon
AliExpress
10K Potentiometer
Amazon
AliExpress
1K Resistor
Amazon
AliExpress
Push Button Switch
Amazon
AliExpress
ULN2003 Motor Driver IC
Amazon
AliExpress
6-12V DC Motor
Amazon
AliExpress
Zero PCB
Amazon
AliExpress
9V Power Adapter
Amazon
AliExpress
LM-393 Speed Sensor Module
The
LM-393
module is an IR counter that has an IR transmitter and receiver. The Infrared Light sensor consists of the light source (IR-LED) and a phototransistor sensor. If any obstacle is placed between these sensors, an interrupt signal is generated which is sent to the microcontroller.
It requires an encoder disc to count the number of times the sensor goes low to high or vice versa, we can calculate the revolution in a given period of time.
The module can be used in association with a microcontroller for motor speed detection, pulse count, position limit, etc.
Features
Main Chip: LM393
Working Voltage: 3.3V to 5V
Output Form: digital switch output (0 and 1)
Output: Covered, output high level; Without sunscreen, the output is low level
Slotted Width: 5mm
Pinout
VCC:
Connect the positive 3.3v-5v power supply
GND:
Connect power negative
DO:
TTL switch signal output
AO:
Analog output
Digital Taxi Fare Meter using Arduino & Speed Sensor
Now let us see the circuit diagram for Digital Taxi Fare Meter made using Arduino & LM-393 Speed Sensor Module. The connection is fairly simple.
Connect the 16X2 LCD Display I2C SDA/SCL Pins to Arduino A4/A5 Pin. Similarly, connect the digital output pin DO of the Speed Sensor to the D2 of Arduino. The push button is connected to the D3 of Arduino and is pulled low via a 1K resistor.
A push button is used for generating the fare amount when pressed. Similarly, the potentiometer is used for varying speeds of the motor wheel.
As a motor driver IC, we can use ULN2003 Darlington Pair IC & connect its input pin 1 to D8 of Arduino. Connect the output pin 16 of ULN2003 to DC Motor. You can use any DC motor between 5V-12V and power it via a 9V external power supply as in the schematic above.
For the demo purpose, you can use a Robot base and chassis along with the complete body part. The speed sensor LM393 should be attached on one of the wheels from the inside.
The encoder disk should be placed between the gap of the Slotted Speed Sensor.
Project PCB Gerber File & PCB Ordering Online
If you don’t want to assemble the circuit on a breadboard and you want
PCB
for the project, then here is the PCB for you. I used EasyEDA to design the PCB. The PCB Board for
Arduino Digital Taxi Fare Meter
looks something like below.
The Gerber File for the PCB is given below. You can simply download the Gerber File and order the PCB from
ALLPCB
at
1$
only.
Download Gerber File:
Digital Taxi Fare Meter
You can use this Gerber file to order high quality PCB for this project. To do that visit the
ALLPCB
official website by clicking here:
https://www.allpcb.com/
You can now upload the Gerber File by choosing the Quote Now option. From these options, you can choose the Material Type, Dimensions, Quantity, Thickness, Solder Mask Color and other required parameters.
After filling all details, select your country and shipping method. Finally you can place the order.
You can assemble the components on the PCB Board.
System Working & Speed + Fare Calculation
In this Arduino Taxi Fare Meter project, we need to measure the Speed of the rotating wheel. For this, we placed the encoder slot between the gap of the Speed Sensor which has a total number of 20 holes in it.
When the slot makes a complete rotation, 20 pulses are calculated. Therefore to calculate speed we need the total number of pulses produced per second.
Speed = No. Of pulses / No. of slots
To get the value of RPM (Revolution Per Minute), multiply the speed by 60.
RPM = speed x 60
In order to calculate the distance covered in one rotation, we need to measure the circumference of the wheel, which is given by the formulae:
circumference = π x diamter
The wheel used in this project has a diameter of 6.60 cm. So the circumference is 20.7 cm.
In order to calculate the distance traveled, multiply the no. of pulses detected by the circumference.
distance = π x diameter x (No. of Pulses / No. of slots)
Divide the total distance by 100 to convert the distance from centimeter to meter.
To get the final total fare amount, multiply the distance traveled by the fare rate. For example in this project, we are assuming the fare rate to be 0.5$ per meter.
Fare = distance x fare rate
Source Code/Program
The source code/program for Fare Meter Arduino is written on Arduino IDE. Before moving to the coding part download and install
I2C LCD Library
and also the
TimerOne Library
Copy the following code and upload it to the Arduino Nano board.
#include "TimerOne.h"
#include <LiquidCrystal_I2C.h> //https://www.arduino.cc/reference/en/libraries/liquidcrystal-i2c/
LiquidCrystal_I2C
lcd
(
0x27
)
;
volatile
unsigned
int
mycounter
=
;
volatile
unsigned
int
turns
=
;
float
turnsperminute
=
;
unsigned
int
speed
=
;
void
setup
(
)
{
pinMode
(
A5
INPUT
)
;
pinMode
(
OUTPUT
)
;
lcd
init
(
)
;
lcd
backlight
(
)
;
lcd
clear
(
)
;
lcd
setCursor
(
)
;
lcd
(
" Welcome To "
)
;
lcd
setCursor
(
)
;
lcd
(
"Taxi Fare Meter"
)
;
delay
(
2000
)
;
lcd
clear
(
)
;
Timer1
initialize
(
1000000
)
;
Timer1
attachInterrupt
(
timerIsr
)
;
attachInterrupt
(
digitalPinToInterrupt
(
)
count
RISING
)
;
attachInterrupt
(
digitalPinToInterrupt
(
)
finalfare
HIGH
)
;
}
void
count
(
)
{
mycounter
++
;
turns
++
;
delay
(
)
;
}
void
timerIsr
(
)
{
detachInterrupt
(
digitalPinToInterrupt
(
)
)
;
Timer1
detachInterrupt
(
)
;
lcd
clear
(
)
;
float
speed
=
(
mycounter
/
20.0
)
*
60.0
;
float
totalturns
=
*
(
turns
/
)
;
turnsperminute
=
totalturns
/
;
lcd
setCursor
(
)
;
lcd
(
"Dist:"
)
;
lcd
(
turnsperminute
)
;
lcd
(
"m"
)
;
lcd
setCursor
(
)
;
lcd
(
"Speed:"
)
;
lcd
(
speed
)
;
lcd
(
"rpm"
)
;
mycounter
=
;
int
analoginput
=
analogRead
(
A5
)
;
int
motorspeed
=
map
(
analoginput
1023
)
;
analogWrite
(
motorspeed
)
;
Timer1
attachInterrupt
(
timerIsr
)
;
attachInterrupt
(
digitalPinToInterrupt
(
)
count
RISING
)
;
}
void
finalfare
(
)
{
detachInterrupt
(
digitalPinToInterrupt
(
)
)
;
Timer1
det
In this project we will build a prototype of a
Digital Taxi Fare Meter
using
Arduino
&
Speed Sensor
. This project calculates the
speed
and
distance
traveled by the taxi’s wheel using the
LM393 Speed Sensor
. The
LCD Display
will display the speed and distance traveled continuously. It also generates the final
fare amount
when we press the push button.
The overall idea of this project is to develop a
cost-effective fare meter
that can accurately measure the distance and also can give solutions to
fare payment
difficulties. Using this technology we can digitize the current system in such a way that would be convenient both for the driver, vehicle owner, and passenger.
The display unit displays the parameters by means of the
number of rotations
of the wheel using the LM393-based Speed Sensor. This system mainly consists of an
Arduino board
, a Liquid Crystal Display, and Slotted
Encoder
Bill of Materials
Following is the list of materials for making the
Arduino Digital Taxi Fare Meter
project. You can purchase all these components online from the Amazon link.
S.N.
Components
Quantity
Purchase Link
Arduino Nano Board
Amazon
AliExpress
LM393 Speed Sensor + Encoder Wheel
Amazon
AliExpress
16x2 I2C LCD Display
Amazon
AliExpress
10K Potentiometer
Amazon
AliExpress
1K Resistor
Amazon
AliExpress
Push Button Switch
Amazon
AliExpress
ULN2003 Motor Driver IC
Amazon
AliExpress
6-12V DC Motor
Amazon
AliExpress
Zero PCB
Amazon
AliExpress
9V Power Adapter
Amazon
AliExpress
LM-393 Speed Sensor Module
The
LM-393
module is an IR counter that has an IR transmitter and receiver. The Infrared Light sensor consists of the light source (IR-LED) and a phototransistor sensor. If any obstacle is placed between these sensors, an interrupt signal is generated which is sent to the microcontroller.
It requires an encoder disc to count the number of times the sensor goes low to high or vice versa, we can calculate the revolution in a given period of time.
The module can be used in association with a microcontroller for motor speed detection, pulse count, position limit, etc.
Features
Main Chip: LM393
Working Voltage: 3.3V to 5V
Output Form: digital switch output (0 and 1)
Output: Covered, output high level; Without sunscreen, the output is low level
Slotted Width: 5mm
Pinout
VCC:
Connect the positive 3.3v-5v power supply
GND:
Connect power negative
DO:
TTL switch signal output
AO:
Analog output
Digital Taxi Fare Meter using Arduino & Speed Sensor
Now let us see the circuit diagram for Digital Taxi Fare Meter made using Arduino & LM-393 Speed Sensor Module. The connection is fairly simple.
Connect the 16X2 LCD Display I2C SDA/SCL Pins to Arduino A4/A5 Pin. Similarly, connect the digital output pin DO of the Speed Sensor to the D2 of Arduino. The push button is connected to the D3 of Arduino and is pulled low via a 1K resistor.
A push button is used for generating the fare amount when pressed. Similarly, the potentiometer is used for varying speeds of the motor wheel.
As a motor driver IC, we can use ULN2003 Darlington Pair IC & connect its input pin 1 to D8 of Arduino. Connect the output pin 16 of ULN2003 to DC Motor. You can use any DC motor between 5V-12V and power it via a 9V external power supply as in the schematic above.
For the demo purpose, you can use a Robot base and chassis along with the complete body part. The speed sensor LM393 should be attached on one of the wheels from the inside.
The encoder disk should be placed between the gap of the Slotted Speed Sensor.
Project PCB Gerber File & PCB Ordering Online
If you don’t want to assemble the circuit on a breadboard and you want
PCB
for the project, then here is the PCB for you. I used EasyEDA to design the PCB. The PCB Board for
Arduino Digital Taxi Fare Meter
looks something like below.
The Gerber File for the PCB is given below. You can simply download the Gerber File and order the PCB from
ALLPCB
at
1$
only.
Download Gerber File:
Digital Taxi Fare Meter
You can use this Gerber file to order high quality PCB for this project. To do that visit the
ALLPCB
official website by clicking here:
https://www.allpcb.com/
You can now upload the Gerber File by choosing the Quote Now option. From these options, you can choose the Material Type, Dimensions, Quantity, Thickness, Solder Mask Color and other required parameters.
After filling all details, select your country and shipping method. Finally you can place the order.
You can assemble the components on the PCB Board.
System Working & Speed + Fare Calculation
In this Arduino Taxi Fare Meter project, we need to measure the Speed of the rotating wheel. For this, we placed the encoder slot between the gap of the Speed Sensor which has a total number of 20 holes in it.
When the slot makes a complete rotation, 20 pulses are calculated. Therefore to calculate speed we need the total number of pulses produced per second.
Speed = No. Of pulses / No. of slots
To get the value of RPM (Revolution Per Minute), multiply the speed by 60.
RPM = speed x 60
In order to calculate the distance covered in one rotation, we need to measure the circumference of the wheel, which is given by the formulae:
circumference = π x diamter
The wheel used in this project has a diameter of 6.60 cm. So the circumference is 20.7 cm.
In order to calculate the distance traveled, multiply the no. of pulses detected by the circumference.
distance = π x diameter x (No. of Pulses / No. of slots)
Divide the total distance by 100 to convert the distance from centimeter to meter.
To get the final total fare amount, multiply the distance traveled by the fare rate. For example in this project, we are assuming the fare rate to be 0.5$ per meter.
Fare = distance x fare rate
Source Code/Program
The source code/program for Fare Meter Arduino is written on Arduino IDE. Before moving to the coding part download and install
I2C LCD Library
and also the
TimerOne Library
Copy the following code and upload it to the Arduino Nano board.
#include "TimerOne.h"
#include <LiquidCrystal_I2C.h> //https://www.arduino.cc/reference/en/libraries/liquidcrystal-i2c/
LiquidCrystal_I2C
lcd
(
0x27
)
;
volatile
unsigned
int
mycounter
=
;
volatile
unsigned
int
turns
=
;
float
turnsperminute
=
;
unsigned
int
speed
=
;
void
setup
(
)
{
pinMode
(
A5
INPUT
)
;
pinMode
(
OUTPUT
)
;
lcd
init
(
)
;
lcd
backlight
(
)
;
lcd
clear
(
)
;
lcd
setCursor
(
)
;
lcd
(
" Welcome To "
)
;
lcd
setCursor
(
)
;
lcd
(
"Taxi Fare Meter"
)
;
delay
(
2000
)
;
lcd
clear
(
)
;
Timer1
initialize
(
1000000
)
;
Timer1
attachInterrupt
(
timerIsr
)
;
attachInterrupt
(
digitalPinToInterrupt
(
)
count
RISING
)
;
attachInterrupt
(
digitalPinToInterrupt
(
)
finalfare
HIGH
)
;
}
void
count
(
)
{
mycounter
++
;
turns
++
;
delay
(
)
;
}
void
timerIsr
(
)
{
detachInterrupt
(
digitalPinToInterrupt
(
)
)
;
Timer1
detachInterrupt
(
)
;
lcd
clear
(
)
;
float
speed
=
(
mycounter
/
20.0
)
*
60.0
;
float
totalturns
=
*
(
turns
/
)
;
turnsperminute
=
totalturns
/
;
lcd
setCursor
(
)
;
lcd
(
"Dist:"
)
;
lcd
(
turnsperminute
)
;
lcd
(
"m"
)
;
lcd
setCursor
(
)
;
lcd
(
"Speed:"
)
;
lcd
(
speed
)
;
lcd
(
"rpm"
)
;
mycounter
=
;
int
analoginput
=
analogRead
(
A5
)
;
int
motorspeed
=
map
(
analoginput
1023
)
;
analogWrite
(
motorspeed
)
;
Timer1
attachInterrupt
(
timerIsr
)
;
attachInterrupt
(
digitalPinToInterrupt
(
)
count
RISING
)
;
}
void
finalfare
(
)
{
detachInterrupt
(
digitalPinToInterrupt
(
)
)
;
Timer1
det
Technologies used
Hardware components
- Arduino
- Motor Driver
Software & tools
- Arduino IDE
- EasyEDA
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.