MINIDOC14!!
MINIDOC14!!
1. Internet Dependency:
The system heavily relies on internet connectivity for cloud-based operations, making it
vulnerable to disruptions in remote areas with poor network coverage.
PAGE \* MERGEFORMAT 1
2. Security Risks:
The use of RFID technology may expose the system to cloning and unauthorized access
if robust encryption methods are not implemented.
3. Limited Scalability:
The reliance on the ATmega 2560 microcontroller may limit scalability in terms of
handling more complex operations or larger systems.
4. No Backup System:
5. Potential Latency:
Cloud-based data handling may introduce latency during peak usage, affecting
transaction speeds.
6. Maintenance Requirements:
Sensors like the ultrasonic and fire sensors require regular calibration and maintenance to
ensure accuracy and reliability.
The LCD display provides limited interaction, and more intuitive interfaces (e.g.,
touchscreens or mobile apps) could enhance usability.
PAGE \* MERGEFORMAT 1
CHAPTER III
PROPOSED SYSTEM
The proposed system, titled "IoT-Based Cashless Fuel Management System with
RFID Technology," aims to automate fuel dispensing and payment processes using
RFID readers and the Arduino Uno (Atmega 328) microcontroller. The system is
powered by an AC main supply, which is converted to a stable DC voltage using a step-
down transformer, bridge rectifier, and capacitive filter. A voltage regulator ensures the
power supply remains stable, providing reliable operation of all components. The
integration of IoT and RFID technology enables a modernized, cashless fuel
management process.
By automating fuel dispensing, this proposed system eliminates the need for
manual cash handling and human intervention. It ensures accurate transactions, enhances
security, and speeds up the payment process. Additionally, the system provides real-time
monitoring capabilities through an ESP32 module, which sends notifications about
transactions to the user’s registered email. Overall, this system offers a reliable, efficient,
and modern approach to fuel management using IoT and RFID technologies.
PAGE \* MERGEFORMAT 1
BLOCK DIAGRAM OF IoT BASED CASHLESS FUEL
MANAGEMENT SYSTEM USING RFID
The proposed system utilizes RFID readers, an Arduino UNO (Atmega 328),
and a relay driver to automate fuel dispensing and payment processes. The AC main
power is stabilized using a step-down transformer, bridge rectifier, and capacitive filter,
with a voltage regulator ensuring reliable operation. RFID readers validate user
credentials, while the keypad allows manual input for authentication. The Arduino
processes data from these components and controls the relay driver to initiate fuel
dispensing. This system ensures a cashless, automated fuel management process with
improved efficiency and security.
PAGE \* MERGEFORMAT 1
CHAPTER IV
DESCRPTION OF COMPONENTS
4.1 ARDUINO
PAGE \* MERGEFORMAT 1
Fig. 4.1.1:Arduino UNO
1.USB Interface:
Arduino board can be powered by using the USB cable from your computer. All you
need to do is connect the USB cable to the USB connection
Arduino boards can be powered directly from the AC mains power supply by connecting
it to the power supply (Barrel Jack)
PAGE \* MERGEFORMAT 1
3.Voltage Regulator:
The function of the voltage regulator is to control the voltage given to the Arduino board
and stabilize the DC voltages used by the processor and other elements.
4.Crystal Oscillator:
The crystal oscillator helps Arduino in dealing with time issues. How does Arduino
calculate time? The answer is, by using the crystal oscillator. The number printed on top
of the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000 Hertz or
16 MHz.
5,17.Arduino Reset:
It can reset your Arduino board, i.e., start your program from the beginning. It can reset
the UNO board in two ways. First, by using the reset button (17) on the board. Second,
you can connect an external reset button to the Arduino pin labelled RESET (5).
Most of the components used with Arduino board works fine with 3.3 volt
and 5 volt.
GND (8)(Ground): There are several GND pins on the Arduino, any of which can be
used to ground your circuit.
Vin (9): This pin also can be used to power the Arduino board from an external power
source, like AC mains power supply.
10.Analog pins:
The Arduino UNO board has five analog input pins A0 through A5. These pins can read
the signal from an analog sensor like the humidity sensor or temperature sensor and
convert it into a digital value that can be read by the microprocessor.
PAGE \* MERGEFORMAT 1
11.Main microcontroller:
Each Arduino board has its own microcontroller (11). You can assume it as the
brain of your board. The main IC (integrated circuit) on the Arduino is slightly different
from board to board. The microcontrollers are usually of the ATMEL Company. You
must know what IC your board has before loading up a new program from the Arduino
IDE. This information is available on the top of the IC. For more details about the IC
construction and functions, you can refer to the data sheet. The IC pins names are shown
in fig 4.2.2
PAGE \* MERGEFORMAT 1
4.2 POWER SUPPLY
The input to the circuit is applied from the regulated power supply. The a.c. input
i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a
rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to
get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any
a.c components present even after rectification. Now, this voltage is given to a voltage
regulator to obtain a pure constant dc voltage.
PAGE \* MERGEFORMAT 1
Usually, DC voltages are required to operate various electronic equipment and
these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus
the a.c input available at the mains supply i.e., 230V is to be brought down to the
required voltage level. This is done by a transformer. Thus, a step down transformer is
employed to decrease the voltage to a required level.
4.2.2 Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a
bridge rectifier is used because of its merits like good stability and full wave
rectification.
4.2.3 Filter:
Capacitive filter is used in this project. It removes the ripples from the output of
rectifier and smoothens the D.C. Output received from this filter is constant until the
mains voltage and load is maintained constant. However, if either of the two is varied,
D.C. voltage received at this point changes. Therefore a regulator is applied at the output
stage.
As the name itself implies, it regulates the input applied to it. A voltage regulator
is an electrical regulator designed to automatically maintain a constant voltage level. In
this project, power supply of 5V and 12V are required. In order to obtain these voltage
levels, 7805 and 7812 voltage
regulators are to be used. The first number 78 represents positive supply and the
numbers 05, 12
represent the required output voltage levels.
Features:
4.3 BATTERY
Batteries consist of one or more cells where chemical reactions generate a flow of
electrons. They have three main components: an anode ('-'), a cathode ('+'), and an
electrolyte, which facilitates the chemical reaction. When connected to a circuit,
reactions at the anode and cathode create electron flow. Once the anode or cathode
material is exhausted, the battery becomes "dead."
Fig. 4.3.1:Battery
The RFID reader enables communication between the RFID system and tags. It
plays a crucial role in identifying users by scanning the unique IDs stored in RFID tags.
Type: A 125 kHz low-frequency reader is used, suitable for short-range communication,
common in access control and payment systems. This frequency ensures reliable
detection even in environments with interference.
Interface: Uses serial data transmission for efficient communication with the
microcontroller. The reader sends the tag information in real-time, ensuring that fuel
dispensing happens only after valid authentication is completed.
PAGE \* MERGEFORMAT 1
Fig. 4.4.1:RFID Reader
RFID tags are the identification elements of the system, containing unique
information that can be read by the RFID reader. In our project, we use the following
types of RFID tags:
Passive RFID Tags: The RFID cards used are passive tags, meaning they do not
have an internal power source. Instead, they derive power from the electromagnetic field
generated by the RFID reader. This feature enhances their longevity and reduces
maintenance needs.
Data Storage: Each RFID tag is embedded with a unique identification number,
which is essential for tracking and authorizing users. The data storage capacity of these
tags is sufficient for our application, as they primarily store user IDs and related
information.
Design and Durability: The RFID tags are designed to be durable and compact,
allowing them to be easily carried by users. This convenience is crucial for a system that
aims to provide a quick and seamless fuel dispensing experience.
Applications: In our system, RFID tags function as prepaid cards, enabling users
to access fuel based on their available balance. This cashless approach not only enhances
convenience but also reduces the risk of human error and fraud at the fuel station.
PAGE \* MERGEFORMAT 1
Fig. 4.4.2:RFID Tag
16 * 2 Alphanumeric LCD
Description
An LCD is a thin, flat display using liquid crystals that require a light source as
they don't emit light directly. It offers high flexibility for displaying user-defined data.
Memory Types:
Display Data RAM (DDRAM): Stores 8-bit character codes. It has an 80x8-bit
capacity, with visible characters limited to the display size (e.g., 16 for a 1x16 LCD).
Non-visible data remains in DDRAM.
PAGE \* MERGEFORMAT 1
Fig. 4.5.2:DDRAM Address for 2 Line LCD
Busy Flag: Indicates the LCD’s current status to ensure proper synchronization
with the microcontroller. BF = 1 means the LCD is busy processing a command, while
BF = 0 means it is ready to accept new instructions. This avoids data loss by ensuring the
microcontroller only sends data when the LCD is available.
Instruction Register (IR) and Data Register (DR): The Instruction Register
(IR) holds control commands like clearing the display or setting the cursor position. The
Data Register (DR) stores data written to DDRAM or CGRAM and latches it for display
upon receiving the enable signal. These registers play a key role in managing both
instructions and displayed content efficiently.
Features:
61x15.8 mm viewing area with a 5x7 dot matrix format for clear visibility.
Displays 224 symbols with low power consumption (1 mA typical) and supports
both TTL/CMOS logic levels, making it suitable for embedded systems.
PAGE \* MERGEFORMAT 1
Schematic
Fig. 4.5.3:LCD
Specifications
PAGE \* MERGEFORMAT 1
Circuit Description
Above is the quite simple schematic. The LCD panel's Enable and Register
Select is connected to the Control Port. The Control Port is an open collector / open drain
output. While most Parallel Ports have internal pull-up resistors, there are a few which
don't. Therefore by incorporating the two 10K external pull up resistors, the circuit is
more portable for a wider range of computers, some of which may have no internal pull
up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we hard
wire the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on
the data lines. As a result we cannot read back the LCD's internal Busy Flag which tells
us if the LCD has accepted and finished processing the last instruction. This problem is
overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. You can use a
bench power supply set to 5v or use a onboard +5 regulator. Remember a few de-
coupling capacitors, especially if you have trouble with the circuit working properly.The
PAGE \* MERGEFORMAT 1
2 line x 16 character LCD modules are available from a wide range of manufacturers and
should all be compatible with the HD44780.
4.6 KEYPAD
The keypad is an essential input device for the RFID-based automated gasoline
pump system, enabling user interaction.
Functionality
User Input: Used for entering fuel amounts and PINs for secure access.
Compact Design: Space-saving design fits seamlessly into the fuel pump
interface.
User-Friendly Layout: Intuitive design with clearly labeled keys for quick and
accurate input.
The relay driver controls high-power devices like the fuel pump using low-power
signals from the microcontroller.
Functionality
Relay Activation: Energizes the relay coil, closing contacts to power the
fuel pump.
PAGE \* MERGEFORMAT 1
Isolation: Electrically isolates high-voltage circuits from low-voltage
microcontroller components for safety.
Microcontroller
Connection: Operates based on signals from the microcontroller, triggered by valid
inputs.
Power Supply: Shares power with the pump or uses a separate source,
depending on design.
Overview
PAGE \* MERGEFORMAT 1
Purpose: Connects the system to Wi-Fi for remote access and cloud-
based monitoring of fuel usage and transactions.
PAGE \* MERGEFORMAT 1
Fig. 4.8 : ESP32 Module
4.9 LED
An LED (Light Emitting Diode) is a semiconductor light source with two leads.
When current flows through, it produces light through electroluminescence, where
electrons recombine with electron holes. The light's color depends on the
semiconductor's energy band gap. LEDs are small (less than 1 mm²) and can be modified
with optical components to adjust radiation patterns. First introduced in 1962, LEDs
originally emitted infrared light, but now they are available in visible, UV, and infrared
spectrums with high brightness.
Fig.
4.9.1:Light Emitting Diode
PAGE \* MERGEFORMAT 1
CHAPTER V
The Internet of Things (IoT) connects physical objects and sensors to the Internet
via wireless and wired connections, enabling data exchange between devices. Initially
conceptualized by Kevin Ashton in the early 2000s, IoT has evolved with technological
advancements like smaller, cheaper wireless radios, IPv6, and improved mobile data
coverage. Today, IoT connects a wide range of devices, from industrial equipment to
everyday objects, using various communication protocols like Wi-Fi, Bluetooth, and
cellular networks.
IoT enables sensors to monitor conditions like location, temperature, and motion,
providing valuable data for systems and people. This data allows objects to communicate
their status, leading to automation, better decision-making, and improved efficiency. The
IoT also transforms business operations by enhancing communication, control, and cost
savings, and has a profound impact on areas like public safety, transportation, and
healthcare.
PAGE \* MERGEFORMAT 1
remotely unlock cars or start appliances. IoT also automates responses to anomalies,
such as notifying a company when truck brake pads need maintenance.
Cost Savings: IoT helps businesses save money by providing real-time data on
equipment performance and health. This reduces unexpected failures, allowing for
planned maintenance. It also reduces operational costs, such as fuel and wear and tear,
and provides insights into energy consumption for cost savings.
1. Define objectives: Identify the specific data you need to enhance business
processes. For instance, sensor data on equipment vibration can help predict
failures and reduce downtime. Clear goals ensure that the data collected drives
actionable insights.
3. Collect and manage data: IoT systems generate large volumes of data, so use
scalable tools like Hadoop or NoSQL to collect, store, and analyze this data
efficiently. Focus on data that is both relevant for immediate needs and valuable
for future analysis.
PAGE \* MERGEFORMAT 1
5.4 Advantages
Data: More information helps in making better decisions, like knowing what to
buy without checking yourself. It saves time and adds convenience.
Tracking: IoT tracks product quality and expiration dates, improving safety and
ensuring you never run out of essentials.
Wearable’s.
Smart City.
Smart grids.
Industrial internet.
Connected car.
Smart retail.
PAGE \* MERGEFORMAT 1
CHAPTER VI
ARDUINO SOFTWARE
Arduino IDE (Integrated Development Environment) is required to program the
Arduino Uno board. Download it here.
PROGRAMMING ARDUINO
After installing the IDE, connect the Arduino board to your computer via USB.
Open the IDE, select the correct board (Tools > Boards > Arduino/Genuino Uno), and
choose the correct port (Tools > Port). To blink the built-in LED, go to Files > Examples
> Basics > Blink. Upload the code by clicking the upload button. The LED will blink
once the upload is complete.
ARDUINO – INSTALLATION
Step 1:Have your Arduino board and USB cable (standard USB A to B for
Arduino Uno, Nano, Mega, etc.).
PAGE \* MERGEFORMAT 1
Step 2: Download Arduino IDE software from the official website, choosing the
version compatible with your operating system (Windows, macOS, or Linux). After
downloading, unzip
PAGE \* MERGEFORMAT 1
Step 5: Open your first project.
PAGE \* MERGEFORMAT 1
To open an existing project example, select File -> Example -> Basics -> Blink.
PAGE \* MERGEFORMAT 1
Here, we are selecting just one of the examples with the name Blink. It turns the
LED on and off with some time delay. You can select any other example from the list.
To avoid any error while uploading your program to the board, you must select
the correct Arduino board name, which matches with the board connected to your
computer.
PAGE \* MERGEFORMAT 1
Here, we have selected Arduino Uno board according to our tutorial, but you
must select the name matching the board that you are using.
Select the serial device of the Arduino board. Go to Tools -> Serial Port menu.
This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for
hardware serial ports). To find out, you can disconnect your Arduino board and re-open
the menu, the entry that disappears should be of the Arduino board. Reconnect the board
and select that serial port.
PAGE \* MERGEFORMAT 1
Step 8: Upload the program to your board.
Before explaining how we can upload our program to the board, we must
demonstrate the function of each symbol appearing in the Arduino IDE toolbar
F- Serial monitor used to receive serial data from the board and send the serial
data to the board.
Now, simply click the "Upload" button in the environment. Wait a few seconds;
you will see the RX and TX LEDs on the board, flashing. If the upload is successful, the
message "Done uploading" will appear in the status bar.
PAGE \* MERGEFORMAT 1
Note: If you have an Arduino Mini, NG, or other board, you need to press the
reset button physically on the board, immediately before clicking the upload button on
the Arduino Software.
We will study in depth, the Arduino program structure and we will learn more
new terminologies used in the Arduino world. The Arduino software is open-source. The
source code for the Java environment is released under the GPL and the C/C++
microcontroller libraries are under the LGPL.
Sketch: The first new terminology is the Arduino program called “sketch”.
Structure Arduino programs can be divided in three main parts: Structure, Values
(variables and constants), and Functions. In this tutorial, we will learn about the Arduino
software program, step by step, and how we can write the program without any syntax or
compilation error.
Let us start with the Structure. Software structure consist of two main functions:
Setup( ) function
Loop( ) function
PAGE \* MERGEFORMAT 1
PURPOSE: The setup() function is called when a sketch starts. Use it to initialize
the variables, pin modes, start using libraries, etc. The setup function will only run once,
after each power up or reset of the Arduino board.
INPUT: -
OUTPUT: -
RETURN:
PURPOSE: After creating a setup() function, which initializes and sets the initial
values, the loop() function does precisely what its name suggests, and loops
consecutively, allowing your program to change and respond. Use it to actively control
the Arduino board.
INPUT: -
OUTPUT: -
RETURN:
PAGE \* MERGEFORMAT 1
CHAPTER VII
The output kit of the proposed system includes essential components such as
RFID tags, Relay Driver, EM-18 RFID Reader, Arduino UNO, Keypad, and LCD.
These components work together to automate the process of fuel dispensing and payment
by ensuring secure user identification and real-time fuel monitoring. Below is a detailed
description of each component and how they function in the output kit setup.
1. RFID Tags
PAGE \* MERGEFORMAT 1
The system uses RFID tags as unique user identification tools. Each RFID tag is
preloaded with a prepaid balance and assigned to a specific user. When the tag is brought
near the RFID reader, it transmits its unique ID, allowing the system to recognize the
user. This ensures secure and cashless fuel transactions.
Functionality:
The EM-18 RFID Reader is responsible for scanning RFID tags. It generates a
radio frequency field to power passive RFID tags and read their unique identification
data. Once the RFID tag is scanned, the reader sends the tag's ID to the Arduino UNO for
verification.
Functionality:
The Arduino UNO is the central processing unit of the system. It handles all
input and output operations by receiving data from the RFID reader, keypad, and relay
driver, and displaying the output on the LCD.
Functionality:
Verifies RFID credentials and ensures only authorized users can access the fuel.
PAGE \* MERGEFORMAT 1
Manages user inputs from the keypad to calculate the fuel to be dispensed.
4. Keypad
The keypad is used by the user to enter the amount of fuel they want to dispense.
It allows manual input of the fuel quantity in liters, ensuring that the system is flexible
and user-friendly.
Functionality:
5. Relay Driver
The Relay Driver acts as a switch to control the fuel pump. Once the RFID tag is
authenticated and the fuel quantity is entered via the keypad, the Arduino triggers the
relay driver to start dispensing fuel. The relay driver ensures that the fuel pump operates
safely and efficiently.
Functionality:
Controls the fuel pump based on the instructions from the Arduino.
The LCD is a critical output component that displays real-time data to the user.
Once the RFID tag is authenticated, the LCD shows the available balance on the tag and
PAGE \* MERGEFORMAT 1
the remaining fuel quantity in the tank. After the user enters the desired fuel amount
via the keypad, the LCD displays the live dispensing of fuel in liters.
Functionality:
1. User Authentication: The process begins when the user places their RFID tag
near the RFID reader. The reader scans the tag and sends its unique ID to the
PAGE \* MERGEFORMAT 1
Arduino for verification. If the tag is authorized, the available balance and
remaining fuel in the tank are displayed on the LCD.
2. Fuel Quantity Input: After authentication, the user enters the desired amount of
fuel to be dispensed through the keypad. The Arduino receives this input and
calculates the fuel quantity in liters.
3. Fuel Dispensing: Once the user confirms the fuel quantity, the Arduino triggers
the relay driver to activate the fuel pump. The relay driver ensures that the pump
operates safely and begins dispensing fuel into the tank.
4. Real-Time Display: As the fuel is dispensed, the LCD shows the live progress in
liters, updating the user on the quantity of fuel delivered. The balance on the
RFID tag is also updated in real time.
5. Completion: After the desired fuel quantity is dispensed, the pump automatically
stops, and the LCD shows the remaining balance on the RFID tag, ensuring that
the user has a record of their transaction.
7.3 APPLICATIONS
➢ Fleet Management – Tracks fuel usage and prevents misuse in vehicle fleets.
➢ Fuel Station Optimization :Automates fuel dispensing to reduce delays
➢ Customer Loyalty Programs – Uses RFID tags to promote cashless transactions.
➢ Environmental Monitoring – Prevents wastage and manages fuel efficiently.
➢ Remote Monitoring and Control – Enables owners to track fuel usage remotely.
7.4 ADVANTAGES
➢ Enhanced Security – RFID ensures only authorized access to fuel.
➢ Improved Efficiency – Reduces manual tasks and human errors.
➢ Accurate Fuel Dispensing – Delivers the exact fuel quantity requested.
➢ Enhanced Customer Experience – Offers fast, cashless fuel transactions.
➢ Reduced Operational Costs – Lowers labor costs and prevents losses.
PAGE \* MERGEFORMAT 1
CHAPTER VIII
CONCLUSION AND FUTURE SCOPE
CONCLUSION
The fuel pump system project successfully achieved its goals by demonstrating
efficient performance in fuel delivery under various conditions. The system met all
specified flow rates and pressure requirements, while design improvements were
identified to enhance durability and efficiency. A cost-benefit analysis revealed long-
term savings through reduced maintenance and improved fuel efficiency. Additionally,
the project complied with all safety regulations, ensuring a reliable and safe operation.
Moving forward, incorporating smart technology for real-time monitoring and
conducting long-term field tests are recommended to further optimize the system and
gather valuable performance data. Overall, this project lays a strong foundation for
developing a robust and efficient fuel pump system.
FUTURE SCOPE
The fuel pump system project includes several promising avenues for
enhancement and innovation. Integrating smart technology, such as IoT sensors, could
enable real-time monitoring of fuel flow and pump health, facilitating predictive
maintenance and improved efficiency. Additionally, exploring design adaptations for
compatibility with alternative fuels like bio fuels and hydrogen will broaden the system’s
applicability in a shifting energy landscape. Researching advanced materials could
enhance durability, while energy-efficient designs and automation strategies would
optimize performance and reduce operational costs. Conducting extensive field tests will
provide valuable real-world insights, and ongoing assessments to ensure regulatory
PAGE \* MERGEFORMAT 1
compliance and minimize environmental impact will be crucial for the system’s long-
term viability. Overall, these initiatives promise to significantly advance the
functionality and relevance of the fuel pump system.
REFERENCES
[1] Sugumaran S; Jayana Mounika Sowmya; Matireddy Venkata Siva;
Nallamothu Rishitha; Matham Karthikeya Ganesh Siva Sagar; Mogalla Ganesh, “IOT
Enabled Smart Fuel Station Management System” [2024], Published in IEEE,
2024,DOI:10.1109/ICNWC60771.2024.10537573
[5] Budi Prijo Sembodo, Haris Atmajaya,” Design of Smart Fuel Station and
Management System Based on Arduino and Internet of Things”,[2021], Published in
ResearchGate, March 2021 , DOI:10.36456/best.vol3.no1.3534
[6] Dileep Reddy Bolla; Jijesh J; Satya Srikanth Palle; Mahaveer Penna;
Keshavamurthy; Shivashankar, “An IoT Based Smart E-Fuel Stations Using ESP-32”,
[2020],Published in IEEE, 2020 International Conference on Recent Trends on
PAGE \* MERGEFORMAT 1
Electronics, Information, Communication & Technology (RTEICT),
DOI:10.1109/RTEICT49044.2020.9315676
PAGE \* MERGEFORMAT 1
APPENDIX
#include <LiquidCrystal.h>
#define b1 7
#define b2 6
#define b3 5
int leter=0;
int water=100;
String rfid;
int soil=A0;
void setup()
pinMode(soil,INPUT_PULLUP);
Serial.begin(9600);
delay(1000);
lcd.begin(16, 2);
pinMode(b1, INPUT);
PAGE \* MERGEFORMAT 1
pinMode(b2, INPUT);
pinMode(b3, INPUT);
digitalWrite(b1,HIGH);
digitalWrite(b2,HIGH);
digitalWrite(b3,HIGH);
pinMode(motor, OUTPUT);
digitalWrite(motor,HIGH);
delay(1000);
lcd.clear();
lcd.print("FUEL DISPENCER");
delay(2000);
/*lcd.clear();
lcd.print("AT");
Serial.print("AT\r\n");
delay(1000);
lcd.clear();
lcd.print("ATE0");
Serial.print("ATE0\r\n");
delay(1000);
lcd.clear();
lcd.print("AT+CMGF=1");
PAGE \* MERGEFORMAT 1
Serial.print("AT+CMGF=1\r\n");
delay(1000);
lcd.clear();
lcd.print("AT+CNMI=1,2,0,0");
Serial.print("AT+CNMI=1,2,0,0\r\n");
delay(1000);
lcd.clear();
lcd.print("SENDING SMS");
delay(1000);
Serial.print("AT+CMGS=");
Serial.print('"');
Serial.print("8309685893");
Serial.print('"');
Serial.print("\r\n");
delay(1000);
Serial.print("welcome message");
delay(100);
Serial.write(0x1A);
delay(10000);
lcd.clear();
lcd.print("SMS SENT");
PAGE \* MERGEFORMAT 1
delay(1000);
*/
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("READY TO USE......");
delay(1000);
int keypad()
back:
do
int i=digitalRead(b1);
int d=digitalRead(b3);
int e=digitalRead(b2);
if(i==LOW)
val=val+1;
if(val==10)
val=0;
lcd.setCursor( temp,0);
PAGE \* MERGEFORMAT 1
lcd.print(val);
delay(500);
if(d==LOW)
val=val-1;
if(val<0)
val=9;
if(val>9)
val=0;
lcd.setCursor(temp,0);
lcd.print(val);
delay(500);
if(e==LOW)
key[temp]=val;
lcd.setCursor(temp,0);
lcd.print(val);
delay(500);
PAGE \* MERGEFORMAT 1
temp=temp+1;
val=0;
}while(temp<=2);
if(temp==3)
lcd.clear();
lcd.setCursor(3,1);
lcd.print("AMOUNT:=");
delay(1000);
lcd.print(key[0]);
delay(1000);
lcd.print(key[1]);
delay(1000);
lcd.print(key[2]);
delay(1000);
//lcd.print(key[3]);
delay(1000);
//lcd.print(key[4]);
delay(1000);
temp=0;
PAGE \* MERGEFORMAT 1
card=0;
amount=((key[0]*100)+(key[1]*10)+(key[2]*1));
lcd.clear();
lcd.print("AMOUNT:");
lcd.print(amount);
delay(5000);
if(amount>cardamount )
lcd.clear();
delay(1000);
lcd.clear();
lcd.print("try again");
lcd.setCursor(0,1);
lcd.print(cardamount);
delay(2000);
lcd.clear();
goto back;
int litre=amount/5;
PAGE \* MERGEFORMAT 1
lcd.clear();
lcd.print("AMOUNT:");
lcd.print(amount);
lcd.setCursor(0,1);
lcd.print("Litre:");
lcd.print(litre);
delay(2000);
if(amount>0)
int i;
for( i=0;i<=litre;i++)
digitalWrite(motor,LOW);
delay(1000);
lcd.clear();
lcd.print(" Liters:");
lcd.print(i);
lcd.setCursor(0,1);
lcd.print("Amount:");
lcd.print(i*5);
delay(2000);
PAGE \* MERGEFORMAT 1
}
lcd.clear();
lcd.print(" Liters:");
lcd.print(litre);
lcd.print(".");
lcd.print(leter%5);
delay(2000);
lcd.setCursor(0,1);
lcd.print("Amount:");
lcd.print(amount);
delay(2000);
water=water-litre;
delay(1000);
digitalWrite(motor,HIGH);
delay(1000);
leter=0;
delay(1000);
cardamount=cardamount-amount;
lcd.clear();
lcd.print("BALANCE:");
lcd.print(cardamount);
PAGE \* MERGEFORMAT 1
delay(1000);
if(cardamount<100)
lcd.setCursor(0,1);
lcd.print("PLEASE RECHARGE....");
delay(3000);
if(water<10)
lcd.clear();
delay(1000);
lcd.setCursor(0,1);
delay(3000);
String iot="water_"+String(water)
+"_liters_only_available_in_tank_please_refill_water";
delay(1000);
Serial.println(iot);
delay(1000);
PAGE \* MERGEFORMAT 1
}
else
String iot="water_"+String(water)+"_liters_only_available_in_tank";
delay(1000);
Serial.println(iot);
delay(1000);
lcd.clear();
lcd.setCursor(0 ,0);
lcd.print("READY TO USE......");
delay(1000);
void loop()
lcd.clear();
lcd.print(water);
lcd.print(" Li Of Fuel");
lcd.setCursor(0, 1);
lcd.print("Available Here");
PAGE \* MERGEFORMAT 1
delay(2000);
lcd.clear();
while(Serial.available())
String data=Serial.readString();
Serial.print(data);
if(data=="5500141F2A74")
lcd.clear();lcd.print(data);delay(1000);
lcd.clear();
lcd.print("BALANCE:");
lcd.print(cardamount);
delay(3000);
if(cardamount>=5)
lcd.clear();
lcd.print("ENTER AMOUNT");
lcd.setCursor(0,1);
lcd.print("IN 3 DIGITS");
delay(3000);
lcd.clear();
PAGE \* MERGEFORMAT 1
keypad();
else
lcd.clear();
lcd.print("LOW BALANCE");
delay(1000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("READY TO USE......");
delay(1000);
else
lcd.clear();
lcd.print(data);
delay(1000);
lcd.setCursor(0, 0);
lcd.print("INVALID CARD....");
delay(1000);
PAGE \* MERGEFORMAT 1
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("READY TO USE......");
delay(1000);
PAGE \* MERGEFORMAT 1