ATM Project
ATM Project
ATM Project
In this era of technology many systems are going to be automated through computerized systems.
ATM is also one of them. We are frequently doing transactions through ATM for our daily needs. I
This thought creates an idea to make this project for my practical evaluation and I talk to my group
members and they all agreed to do so. Then I talked to my teacher and he said develop it using
AIM: To develop an ATM software to understand how the ATM machine is working
Problem Definition: Developing a software for ATM machine to understand how the ATM machines
P a g e 1 | 36
Introduction to ATM Machine
An automated teller machine (ATM) is an electronic banking outlet that allows customers to
complete basic transactions without the aid of a branch representative or teller. Anyone with
a credit card or debit card can access cash at most ATMs, either in the USA or abroad.
ATMs are convenient, allowing consumers to perform quick self-service transactions such as
deposits, cash withdrawals, bill payments, and transfers between accounts. Fees are commonly
charged for cash withdrawals by the bank where the account is located, by the operator of the
ATM, or by both. Some or all of these fees can be avoided by using an ATM operated directly by the
bank that holds the account. Using an ATM abroad can cost more than using one in the USA.
ATMs are known in different parts of the world as automated bank machines (ABMs) or cash
machines.
The ATM MACHINE SOFTWARE which is as same as normal ATM machine. It allows the
user to create account, deposit money, withdraw money, transfer the money and check balance.
The ATM Machine Software is the project which is used to access their bank accounts in order to
make cash withdrawals. Whenever the user need to make cash withdrawals, they can enter
their PIN number (Personal Identification Number) and the amount will be withdrawn. Once their
withdrawn is successful, the amount will be debited from their account. The ATM System is
P a g e 2 | 36
Objectives of the project
The objective of this project is to learn and apply the programming knowledge into a real- world
problem and exposed how programming skills helps in developing a good software.
The ATM System is the project which is used to access their bank accounts in order to make cash
withdrawals. Whenever the user needs to make cash withdraws, they can enter their PIN number
(personal identification number) and it will display the amount to be withdrawn. Once their
The ATM will service one customer at a time. A customer will be required to enter ATM Card
number, Personal Identification Number (PIN) – both of which will be sent to the database for
validation as part of each transaction. The customer will then be able to perform one or more
transactions. Also customer must be able to make a balance inquiry of any account linked to the
card.
This project also helps to apply python programming principles and write effective procedural
code to solve real life problems and automate the manual process.
P a g e 3 | 36
The existing system
The person is visiting ATM to withdraw money or deposit money. The machine is capable to perform
the transactions related to withdrawal and deposit. Earlier people were going to bank and standing
in queue for withdrawal and deposit. People going to bank and filling the forms to perform a
transaction. The cashier will collect he form issue a token to the individual. The person has to wait
till token number announced. After announcement for the same person get money.
Another aspect is a person can withdraw money during scheduled time only. So, ATM machines
solve these all problems and allows a person to withdraw money anytime anywhere.
ATM machine will ask for a pin to perform a transaction. In this project, we have used account
The modern machine allows cash deposits also. Here we have integrated alike system after
entering account number, pin number and the amount person wants to deposit in his/her account.
P a g e 4 | 36
Scope of the project
This project will update as time goes and changes made by banks for learning purpose. This
python.exe yourself.
OVERVIEW OF PYTHON
Features of python:-
2)expensive language
3)interpreted language
4)cross-platform language
P a g e 6 | 36
OVERVIEW OF MYSQL
MySQL is popular among all databases, and is ranked as second most popular database, only
slightly trailing Oracle Database. Among open source databases, MySQL is the most popular
database in use today. Known as one of the most reliable and performative databases out there,
it was named after its founder’s daughter My, and is known for organizing data into one or more
data tables in which data types are related to each other. These relations help structure data, as
SQL is a language programmers use for creation, modification and extraction of data from a
relational database.
MySQL uses standalone clients that allow users to interact with MySQL, and also to use it with
other programs for applications that need relational database capabilities. MySQL's reputation
for reliability has led to its inclusion in the popular LAMP stack (Linux, Apache, MySQL,
Python/Perl/PHP) and is also used as the default DBMS in popular CMS options like Drupal,
Features of MySQL:
1.easy to use
2.scalable
3.secure
4.reliable
P a g e 7 | 36
OVERVIEW OF Tkinter
What is python Tkinter?
Python Tkinter is a python standard library that offers many functions and controls to develop
desktop based applications or Graphical User Interface (GUI) based applications .
2 Canvas Used to draw a complex layout and picture, it can hold text and graphics
3 Check Button Used to select an option from multiple options given in the window
Used to hold multiple widgets inside a frame and organize them in proper
5 Frame
order
P a g e 8 | 36
7 List Box Used to display a list of options
11 Radio Button Used to select a single option from given multiple options
P a g e 9 | 36
Modules Used-
➢ from tkinter import *
➢ from tkinter import messagebox
➢ import mysql.connector as my
➢ from PIL import ImageTk, Image
➢ from datetime import datetime
➢ import random
Functions Used-
➢ withdraw()
➢ money()
➢ balance()
➢ check()
➢ pinchange()
➢ change()
➢ ministatement()
➢ view()
➢ deposit()
➢ depst()
➢ info()
➢ viewinfo()
P a g e 10 | 36
MYSQL Tables Used-
P a g e 11 | 36
SOURCE CODE
from tkinter import *
import mysql.connector as my
import random
now=datetime.now()
date=now.strftime("%d/%m/%Y %H:%M:%S")
tid=random.randint(100,999)
d='Debit'
c='Credit'
window1=Tk()
window1.title('ATM')
window1.maxsize(1350,1500)
window1.minsize(1350,1500)
img=Image.open('welcome.png')
bg=ImageTk.PhotoImage(img)
label=Label(window1,image=bg)
P a g e 12 | 36
label.place(x=-320,y=-100)
def withdraw():
window2=Toplevel()
window2.title('Withdraw Money')
window2.maxsize(1350,1500)
window2.minsize(1350,1500)
img=Image.open('all.png')
r=img.resize((1350,1500))
img=ImageTk.PhotoImage(r)
label=Label(window2,image=img)
label.image=img
label.pack()
l1.place(x=150,y=100)
l2=Label(window2,text='Enter Pin',bg='white',fg='black',font=('Arial',30),width=20)
l2.place(x=150,y=250)
l3=Label(window2,text='Enter Amount',bg='white',fg='black',font=('Arial',30),width=20)
l3.place(x=150,y=400)
uname=StringVar()
passwd=StringVar()
amount=StringVar()
e1=Entry(window2,font=('Arial',30),width=20,bg='white',bd=2,textvariable=uname)
P a g e 13 | 36
e1.place(x=650,y=100)
e1.focus_set()
e2=Entry(window2,font=('Arial',30),width=20,bg='white',bd=2,textvariable=passwd,show='*')
e2.place(x=650,y=250)
e3=Entry(window2,font=('Arial',30),width=20,bg='white',bd=2,textvariable=amount)
e3.place(x=650,y=400)
def money():
global tid
global c
global d
global date
cn=my.connect(host='localhost',user='root',passwd='root',database='atm')
cur=cn.cursor()
da=cur.fetchall()
da=list(da)
rc=cur.rowcount
if rc==1:
dt=cur.fetchall()
dt=list(dt)
P a g e 14 | 36
c=dt[0][5]
if c>0:
tid+=1
cur.execute(m)
dt=cur.fetchall()
dt=list(dt)
c=dt[0][5]
cur.execute(m1)
cn.commit()
l8=Label(window2,text='Transaction
Successful!',bg='lightblue',fg='red',font=('Arial',30),width=20)
l8.place(x=450,y=500)
else:
l6=Label(window2,text='Insufficient Balance!',bg='white',fg='red',font=('Arial',30),width=20)
l6.place(x=430,y=525)
else:
l.place(x=430,y=525)
P a g e 15 | 36
b6=Button(window2,text='Withdraw
Money',font=('Arial',20),width=20,bd=2,bg='white',command=money)
b6.place(x=500,y=600)
b1=Button(window1,text='Withdraw
Money',font=('Arial',20),width=20,bd=2,bg='white',command=withdraw)
b1.place(x=200,y=300)
def balance():
window3=Toplevel()
window3.title('Balance Enquiry')
window3.maxsize(1500,1500)
window3.minsize(1350,1500)
img=Image.open('all.png')
r=img.resize((1350,1500))
img=ImageTk.PhotoImage(r)
label=Label(window3,image=img)
label.image=img
label.pack()
l4.place(x=150,y=100)
l5=Label(window3,text='Enter Pin',bg='lightblue',fg='black',font=('Arial',30),width=20)
l5.place(x=150,y=250)
accno=StringVar()
pin=StringVar()
P a g e 16 | 36
e4=Entry(window3,font=('Arial',30),width=20,bg='white',bd=2,textvariable=accno)
e4.place(x=650,y=100)
e4.focus_set()
e5=Entry(window3,font=('Arial',30),width=20,bg='white',bd=2,textvariable=pin,show='*')
e5.place(x=650,y=250)
def check():
cn=my.connect(host='localhost',user='root',passwd='root',database='atm')
cur=cn.cursor()
da=cur.fetchall()
da=list(da)
rc=cur.rowcount
if rc==1:
window3.title('Balance Inquiry')
window3.maxsize(1500,1500)
window3.minsize(1350,1500)
window3['bg']="lightblue"
bal=da[0][5]
s=StringVar()
s.set(bal)
l7=Label(window3,text='Available
Balance:',bg='lightblue',fg='black',font=('Arial',30),width=20)
P a g e 17 | 36
l7.place(x=150,y=400)
e=Entry(window3,state="disabled",textvariable=s,font=('Arial',30))
e.place(x=650,y=400)
b7=Button(window3,text='Check
Balance',font=('Arial',20),width=20,bd=2,bg='white',command=check)
b7.place(x=500,y=600)
b2=Button(window1,text='Balance
Enquiry',font=('Arial',20),width=20,bd=2,bg='white',command=balance)
b2.place(x=770,y=300)
def pinchange():
window4=Toplevel()
window4.title('Pin Change')
window4.maxsize(1500,1500)
window4.minsize(1350,1500)
img=Image.open('all.png')
r=img.resize((1350,1500))
img=ImageTk.PhotoImage(r)
label=Label(window4,image=img)
label.image=img
label.pack()
l4.place(x=150,y=100)
l5=Label(window4,text='Enter Pin',bg='white',fg='black',font=('Arial',30),width=20)
P a g e 18 | 36
l5.place(x=150,y=250)
accno=StringVar()
pin=StringVar()
npin=StringVar()
e4=Entry(window4,font=('Arial',30),width=20,bg='white',bd=2,textvariable=accno)
e4.place(x=650,y=100)
e4.focus_set()
e5=Entry(window4,font=('Arial',30),width=20,bg='white',bd=2,textvariable=pin,show='*')
e5.place(x=650,y=250)
def change():
cn=my.connect(host='localhost',user='root',passwd='root',database='atm')
cur=cn.cursor()
da=cur.fetchall()
da=list(da)
rc=cur.rowcount
if rc==1:
l6.place(x=150,y=450)
e6=Entry(window4,font=('Arial',30),width=20,bg='white',bd=2,textvariable=npin)
e6.place(x=650,y=450)
P a g e 19 | 36
cur.execute(q)
cn.commit()
l8.place(x=400,y=500)
else:
l.place(x=425,y=500)
b6=Button(window4,text='Change
Pin',font=('Arial',20),width=20,bd=2,bg='white',command=change)
b6.place(x=500,y=600)
b3=Button(window1,text='PIN
Change',font=('Arial',20),width=20,bd=2,bg='white',command=pinchange)
b3.place(x=200,y=500)
def ministatement():
window5=Toplevel()
window5.title('Mini-statement')
window5.maxsize(1500,1500)
window5.minsize(1350,1500)
img=Image.open('all.png')
r=img.resize((1350,1500))
img=ImageTk.PhotoImage(r)
label=Label(window5,image=img)
label.image=img
P a g e 20 | 36
label.pack()
l1.place(x=150,y=100)
l2=Label(window5,text='Enter Pin',bg='white',fg='black',font=('Arial',30),width=20)
l2.place(x=150,y=250)
uname=StringVar()
passwd=StringVar()
e1=Entry(window5,font=('Arial',30),width=20,bg='white',bd=2,textvariable=uname)
e1.place(x=650,y=100)
e1.focus_set()
e2=Entry(window5,font=('Arial',30),width=20,bg='white',bd=2,textvariable=passwd,show='*')
e2.place(x=650,y=250)
def view():
cn=my.connect(host='localhost',user='root',passwd='root',database='atm')
cur=cn.cursor()
da=cur.fetchall()
da=list(da)
rc=cur.rowcount
if rc>1:
window0=Tk()
window0.title('Mini-statement')
P a g e 21 | 36
window0.maxsize(1500,1500)
window0.minsize(1350,1500)
cn=my.connect(host='localhost',user='root',passwd='root',database='atm')
cur=cn.cursor()
i=0
e=Label(window0,width=35,text='Transaction ID',justify='center',borderwidth=2,
relief='ridge',anchor='center',bg='yellow')
e.grid(row=0,column=0)
e=Label(window0,width=35,text='Date/Time',borderwidth=2,
relief='ridge',anchor='center',bg='yellow')
e.grid(row=0,column=1)
e=Label(window0,width=35,text='Transaction type',borderwidth=2,
relief='ridge',anchor='center',bg='yellow')
e.grid(row=0,column=2)
e=Label(window0,width=35,text='Amount',borderwidth=2,
relief='ridge',anchor='center',bg='yellow')
e.grid(row=0,column=3)
e=Label(window0,width=35,text='Balance',borderwidth=2,
relief='ridge',anchor='center',bg='yellow')
e.grid(row=0,column=4)
i=1
for j in range(len(transaction)):
if j==5:
P a g e 22 | 36
continue
else:
e.grid(row=i, column=j)
e.insert(END, transaction[j])
i=i+1
b6=Button(window5,text='View recent
transactions',font=('Arial',20),width=20,bd=2,bg='white',command=view)
b6.place(x=500,y=600)
b4=Button(window1,text='Mini-
statement',font=('Arial',20),width=20,bd=2,bg='white',command=ministatement)
b4.place(x=770,y=500)
def deposit():
global tid
global c
global d
global date
window6=Toplevel()
window6.title('Deposit')
window6.maxsize(1500,1500)
window6.minsize(1350,1500)
img=Image.open('all.png')
r=img.resize((1350,1500))
P a g e 23 | 36
img=ImageTk.PhotoImage(r)
label=Label(window6,image=img)
label.image=img
label.pack()
l4.place(x=150,y=100)
l5=Label(window6,text='Enter Pin',bg='lightblue',fg='black',font=('Arial',30),width=20)
l5.place(x=150,y=250)
l6=Label(window6,text='Enter Amount',bg='lightblue',fg='black',font=('Arial',30),width=20)
l6.place(x=150,y=450)
accno=StringVar()
pin=StringVar()
depo=StringVar()
e4=Entry(window6,font=('Arial',30),width=20,bg='white',bd=2,textvariable=accno)
e4.place(x=650,y=100)
e4.focus_set()
e5=Entry(window6,font=('Arial',30),width=20,bg='white',bd=2,textvariable=pin,show='*')
e5.place(x=650,y=250)
e6=Entry(window6,font=('Arial',30),width=20,bg='white',bd=2,textvariable=depo)
e6.place(x=650,y=450)
def depst():
cn=my.connect(host='localhost',user='root',passwd='root',database='atm')
P a g e 24 | 36
cur=cn.cursor()
da=cur.fetchall()
da=list(da)
rc=cur.rowcount
if rc==1:
dt=cur.fetchall()
dt=list(dt)
cur.execute(m)
cr=dt[0][5]
cur.execute(m1)
cn.commit()
l=Label(window6,text='Transaction Successful!',bg='white',fg='red',font=('Arial',30),width=20)
l.place(x=450,y=525)
else:
l.place(x=450,y=525)
P a g e 25 | 36
b=Button(window6,text='Deposit
Money',font=('Arial',20),width=20,bd=2,bg='white',command=depst)
b.place(x=500,y=600)
b5=Button(window1,text='Deposit',font=('Arial',20),width=20,bd=2,bg='white',command=deposit)
b5.place(x=485,y=400)
def info():
window7=Toplevel()
window7.title('Info')
window7.maxsize(1500,1500)
window7.minsize(1350,1500)
img=Image.open('all.png')
r=img.resize((1350,1500))
img=ImageTk.PhotoImage(r)
label=Label(window7,image=img)
label.image=img
label.pack()
l1.place(x=150,y=100)
l2=Label(window7,text='Enter Pin',bg='lightblue',fg='black',font=('Arial',30),width=20)
l2.place(x=150,y=250)
accno=StringVar()
pin=StringVar()
e1=Entry(window7,font=('Arial',30),width=20,bg='white',bd=2,textvariable=accno)
P a g e 26 | 36
e1.place(x=650,y=100)
e1.focus_set()
e2=Entry(window7,font=('Arial',30),width=20,bg='white',bd=2,textvariable=pin,show='*')
e2.place(x=650,y=250)
def view():
cn=my.connect(host='localhost',user='root',passwd='root',database='atm')
cur=cn.cursor()
da=cur.fetchall()
da=list(da)
print(da)
rc=cur.rowcount
if rc==1:
window=Toplevel()
window.title('Info')
window.maxsize(1500,1500)
window.minsize(1350,1500)
img=Image.open('all.png')
r=img.resize((1350,1500))
img=ImageTk.PhotoImage(r)
label=Label(window,image=img)
label.image=img
P a g e 27 | 36
label.pack()
ah=da[0][1]
ab=da[0][5]
h=StringVar()
b=StringVar()
h.set(ah)
b.set(ab)
l4=Label(window,text='Account Number',bg='lightblue',fg='black',font=('Arial',30),width=20)
l4.place(x=150,y=100)
l5=Label(window,text='Account Holder',bg='lightblue',fg='black',font=('Arial',30),width=20)
l5.place(x=150,y=250)
l6=Label(window,text='Balance',bg='lightblue',fg='black',font=('Arial',30),width=20)
l6.place(x=150,y=400)
e0=Entry(window,state="disabled",textvariable=accno,font=('Arial',30))
e0.place(x=650,y=100)
e20=Entry(window,state="disabled",textvariable=h,font=('Arial',30))
e20.place(x=650,y=250)
e03=Entry(window,state="disabled",textvariable=b,font=('Arial',30))
e03.place(x=650,y=400)
else:
l.place(x=450,y=525)
b=Button(window7,text='View Details',font=('Arial',20),width=20,bd=2,bg='white',command=view)
P a g e 28 | 36
b.place(x=500,y=600)
b6=Button(window1,text='View Details',font=('Arial',20),width=20,bd=2,bg='white',command=info)
b6.place(x=200,y=400)
OUTPUTS
Main Screen:
P a g e 29 | 36
(b) If details are wrong-
P a g e 30 | 36
2. For money deposit:
P a g e 31 | 36
(b) If details are wrong-
P a g e 32 | 36
(b) If details are wrong-
P a g e 33 | 36
(b) If details are wrong-
P a g e 34 | 36
6. To view recent transactions-
P a g e 35 | 36
BIBLIOGRAPHY
➢ www.tutorialaicsip.com
➢ www.slidesharenet.net
➢ www.scribd.com
P a g e 36 | 36