Professional Documents
Culture Documents
ATM Software Project Documentation
ATM Software Project Documentation
transactions through ATM for our daily needs. I visited ATM machine was
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 user friendly tkinter library in Python with
MySQL connectivity.
working
how the ATM machines are working, handles data and managing the bank
accounts.
P a g e 1 | 37
Introduction to ATM Machine
ATMs are known in different parts of the world as automated bank machines
(ABMs) or cash machines.
It allows the user to create account, deposit money, withdraw money, transfer
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
successful, the amount will be debited from their account. The ATM System is
P a g e 2 | 37
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
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 withdrawn was successful,
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 | 37
The existing system
The person is visiting ATM to withdraw money or deposit money. The machine
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
The modern machine allows cash deposits also. Here we have integrated alike
system after entering account number, pin number and the amount person wants
P a g e 4 | 37
Scope of the project
This project will update as time goes and changes made by banks for learning
P a g e 5 | 37
You need root or administrator privileges to perform the installation process.
python.exe yourself.
OVERVIEW OF PYTHON
Features of python:-
1)easy to learn and use 4)cross-platform language
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, Joomla, phpBB,
and WordPress.
Features of MySQL:
1.easy to use
2.scalable
3.secure
4.reliable
P a g e 7 | 37
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.
Used to draw a complex layout and picture, it can hold text and
2 Canvas
graphics
P a g e 8 | 37
8 Menu Used to prepare command menus for tkinter window
Menu
9 Used to add a menu item in the main menu
Button
Radio
11 Used to select a single option from given multiple options
Button
Paned
17 Used to handle different panes of a window
Window
Label
18 Used to handle complex widgets
Frame
P a g e 9 | 37
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 | 37
MYSQL Tables Used-
P a g e 11 | 37
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)
label.place(x=-320,y=-100)
def withdraw():
window2=Toplevel()
P a g e 12 | 37
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=Label(window2,text='Enter Account
Number',bg='white',fg='black',font=('Arial',30),width=20)
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=un
ame)
e1.place(x=650,y=100)
P a g e 13 | 37
e1.focus_set()
e2=Entry(window2,font=('Arial',30),width=20,bg='white',bd=2,textvariable=pas
swd,show='*')
e2.place(x=650,y=250)
e3=Entry(window2,font=('Arial',30),width=20,bg='white',bd=2,textvariable=am
ount)
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 | 37
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 | 37
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=Label(window3,text='Enter Account
Number',bg='lightblue',fg='black',font=('Arial',30),width=20)
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 | 37
e4=Entry(window3,font=('Arial',30),width=20,bg='white',bd=2,textvariable=acc
no)
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)
P a g e 17 | 37
l7=Label(window3,text='Available
Balance:',bg='lightblue',fg='black',font=('Arial',30),width=20)
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=Label(window4,text='Enter Account
Number',bg='white',fg='black',font=('Arial',30),width=20)
l4.place(x=150,y=100)
P a g e 18 | 37
l5=Label(window4,text='Enter
Pin',bg='white',fg='black',font=('Arial',30),width=20)
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=acc
no)
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=Label(window4,text='Enter NEW
PIN:',bg='white',fg='black',font=('Arial',30),width=20)
P a g e 19 | 37
l6.place(x=150,y=450)
e6=Entry(window4,font=('Arial',30),width=20,bg='white',bd=2,textvariable=npi
n)
e6.place(x=650,y=450)
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)
P a g e 20 | 37
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
label.pack()
l1=Label(window5,text='Enter Account
Number',bg='white',fg='black',font=('Arial',30),width=20)
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=un
ame)
e1.place(x=650,y=100)
e1.focus_set()
e2=Entry(window5,font=('Arial',30),width=20,bg='white',bd=2,textvariable=pas
swd,show='*')
e2.place(x=650,y=250)
def view():
cn=my.connect(host='localhost',user='root',passwd='root',database='atm')
P a g e 21 | 37
cur=cn.cursor()
da=cur.fetchall()
da=list(da)
rc=cur.rowcount
if rc>1:
window0=Tk()
window0.title('Mini-statement')
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)
P a g e 22 | 37
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:
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
P a g e 23 | 37
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))
img=ImageTk.PhotoImage(r)
label=Label(window6,image=img)
label.image=img
label.pack()
l4=Label(window6,text='Enter Account
Number',bg='lightblue',fg='black',font=('Arial',30),width=20)
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()
P a g e 24 | 37
depo=StringVar()
e4=Entry(window6,font=('Arial',30),width=20,bg='white',bd=2,textvariable=acc
no)
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=de
po)
e6.place(x=650,y=450)
def depst():
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 25 | 37
m="update atm_mac set creditamt={},balance=balance+{} where
accountnumber='{}'".format(e6.get(),e6.get(),e4.get())
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)
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)
P a g e 26 | 37
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=Label(window7,text='Enter Account
Number',bg='lightblue',fg='black',font=('Arial',30),width=20)
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=acc
no)
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()
P a g e 27 | 37
cur.execute("select * from atm_mac where accountnumber='{}' and
pin='{}'".format(e1.get(),e2.get()))
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
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)
P a g e 28 | 37
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),widt
h=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)
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)
P a g e 29 | 37
OUTPUTS
Main Screen:
P a g e 31 | 37
2. For money deposit:
P a g e 32 | 37
3. For balance enquiry:
P a g e 33 | 37
4. For changing PIN:
P a g e 34 | 37
5. For viewing customer info:
P a g e 35 | 37
6. To view recent transactions-
P a g e 36 | 37
BIBLIOGRAPHY
www.tutorialaicsip.com
www.slidesharenet.net
www.scribd.com
P a g e 37 | 37