Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Digital Taxi Fare Meter using Arduino & Speed Sensor
Arduino Projects

Digital Taxi Fare Meter using Arduino & Speed Sensor

Mamtaz AlamBy Mamtaz AlamUpdated:May 28, 20236 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Digital Taxi Fare Meter using Arduino & Speed Sensor
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

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.ComponentsQuantityPurchase Link
1Arduino Nano Board1Amazon | AliExpress
2LM393 Speed Sensor + Encoder Wheel1Amazon | AliExpress
316x2 I2C LCD Display1Amazon | AliExpress
410K Potentiometer1Amazon | AliExpress
51K Resistor1Amazon | AliExpress
6Push Button Switch1Amazon | AliExpress
7ULN2003 Motor Driver IC1Amazon | AliExpress
86-12V DC Motor1Amazon | AliExpress
9Zero PCB1Amazon | AliExpress
109V Power Adapter1Amazon | 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.

Speed Sensor

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.

Digital Taxi Fare Meter using Arduino & Speed Sensor Circuit

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.

Taxi Fare Meter Arduino

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "TimerOne.h"
#include <LiquidCrystal_I2C.h>      //https://www.arduino.cc/reference/en/libraries/liquidcrystal-i2c/
LiquidCrystal_I2C lcd(0x27, 16, 2);
 
volatile unsigned int mycounter = 0;
volatile unsigned int turns = 0;
float turnsperminute = 0;
unsigned int speed = 0;
 
void setup()
{
  pinMode(A5, INPUT);
  pinMode(8, OUTPUT);
  
  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("   Welcome To  ");
  lcd.setCursor(0, 1);
  lcd.print("Taxi Fare Meter");
  delay(2000);
  lcd.clear();
  
  Timer1.initialize(1000000);
  Timer1.attachInterrupt(timerIsr);
 
  attachInterrupt(digitalPinToInterrupt(2), count, RISING);
  attachInterrupt(digitalPinToInterrupt(3), finalfare, HIGH);
}
 
void count()
{
  mycounter++;
  turns++;
  delay(10);
}
 
void timerIsr()
{
  detachInterrupt(digitalPinToInterrupt(2));
  Timer1.detachInterrupt();
  lcd.clear();
 
  float speed = (mycounter / 20.0) * 60.0;
  float totalturns = 230 * (turns / 20);
  turnsperminute = totalturns / 100;
 
  lcd.setCursor(0, 0);
  lcd.print("Dist:");
  lcd.print(turnsperminute);
  lcd.print("m");
  lcd.setCursor(0, 1);
  lcd.print("Speed:");
  lcd.print(speed);
  lcd.print("rpm");
 
  mycounter = 0;
 
  int analoginput = analogRead(A5);
  int motorspeed = map(analoginput, 0, 1023, 0, 255);
  analogWrite(8, motorspeed);
 
  Timer1.attachInterrupt(timerIsr);
  attachInterrupt(digitalPinToInterrupt(2), count, RISING);
}
 
void finalfare()
{
  detachInterrupt(digitalPinToInterrupt(2));
  Timer1.detachInterrupt();
  float price = turnsperminute * 0.5;
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Fare: ");
  lcd.print(price);
  lcd.print("$");
  lcd.setCursor(0, 1);
  lcd.print("0.5$ Per Meter");
}
 
void loop()
{
}




Test & Demo of Arduino Taxi Fare Meter

After uploading the code, you can start testing your Arduino Digital Taxi Fare Meter.

Initially the LCD will display the Speed and Distance both as zero.

Rotate the potentiometer so that the motor and wheels start rotating. You can also adjust & vary the speed of the motor using the potentiometer.

After rotating the motor wheel for some time, you can finally stop the motor using a Potentiometer. The speed will become zero but the distance covered is some meters.

Press the push button to calculate the final fare amount in dollars.

Digital Taxi Fare Meter using Arduino

The LCD will also display the rate of the distance traveled. In our case, it’s 0.5$ per meter. You can change the rate in your code.


Video Tutorial & Demo

Digital Taxi Fare Meter using Arduino & Speed Sensor || Speedometer + Distance Meter
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleGetting Started with Raspberry Pi Pico W using MicroPython
Next Article Send Sensor Data to Thingspeak with Raspberry Pi Pico W

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
Add A Comment

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • Half Wave Rectifier Basics, Circuit, Working & Applications
    Half Wave Rectifier Basics, Circuit, Working & Applications
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.