Designed by: Marius-Tudor Zaharia, 333CA, May 2025
Contact: marius.zaharia2305@stud.acs.upb.ro
GitHub repository
What is BankApp?
Purpose
Why this idea?
ATMega328P microprocessor.engine of the system, controls the whole behind-the-scenes logic of the app.I2C with the microcontroller.SPI with the microcontroller.analog input from the user, which is then converted to digital data.OK/Confirm button.debouncing.No debouncing needed.10 is used as 011 is used as backspaceBack/Cancel button.debouncing.PWM.
Created using Cirkit designer.
| Component | Link to Vendor | Datasheet Link |
|---|---|---|
| Arduino Uno (ATmega328P) | Vendor Link | Datasheet |
| Capacitive touch (TTP229) | Vendor Link | Datasheet |
| LCD I2C 16×2 | Vendor Link | Datasheet |
| Card scanner (MFRC522) | Vendor Link | Datasheet |
| Dual-axis Joystick | Vendor Link | Datasheet |
| Passive buzzer | Vendor Link | Datasheet |
| Red Push-button module | Vendor Link | Datasheet |
| RGB LED module | Vendor Link | Datasheet |
LOGOUT menu can be reached by pressing the red button from any menu of the LOGGED IN state (i.e. the yellow menus).NOTIFICATIONS_SEE, SEE_FRIENDS and ADD_FRIENDS menus offer interfaces where the user can navigate between entries.0 key, so 10 is used as a 0, while 11 is used as backspace.Start menu
Welcome menu. By flicking the joystick to the left/right, the user can navigate between menus and choose the next action, Login or Register, by clicking the joystick button. A Debug menu is also available.Register menu
register, a card should be placed next to the card reader, and then a 4-digit PIN code is required. If the user is already registered, an error message is displayed, else, the user's home menu is accessed.Login menu
login, the same steps as for register should be followed, with the exception that the validity of the PIN code is checked. Also, if the user has not previously registered, an error message is displayed.Logged-in menu
Hello menu.Main account, Economies account, Friends, Change PIN.Notifications menu can be found.Logout menu is accessed, where the user is asked to confirm the logout.Main account menu
add cash, make a payment, transfer money to the economies account and send money to a friend.add cash), the existing sum is first checked. If the balance is insufficient, an error message is displayed, and the transaction is aborted.Economies account menu
transfer money to the main account, in a similar way as described above.Friends menu
See friends and the Add friends menus.Notifications menu
Friend request, Accepted friend request, Received money from friend.Arduino.h - from PlatformIOpinMode() or tone().LiquidCrystal_I2C.h - GitHubLiquidCrystal_I2C class, which offers methods for initialization, cursor placing and writing characters.MFRC522.h - GitHubMFRC522 class, which offers methods for initialization, card detection and UID reading.TTP229.h - GitHubTTP229 class, which offers a non-blocking method for key reading.Lab 0 - GPIO: The RGB LED is connected to 3 digital GPIO pins of the Arduino, which are set as output.Lab 2 - Interrupts: The Watchdog Timer is programmed to generate an interrupt every second (to manage the interest gain times for the savings accounts).Lab 3 - PWM: The passive buzzer is controlled using the tone() function, which uses PWM behind the scenes.Lab 4 - ADC: The Arduino reads analog values from the Joystick - analogRead(JOYSTICK_VRX_PIN).Lab 5 - SPI: The Arduino communicates by SPI with the RFID card scanner.Lab 6 - I2C: The Arduino communicates by I2C with the LCD.pins
sounds
lights
wdt_counter
millis() function, which is also used in the project.debounce
utils
extern and various helper functions.User structure is declared here, containing the necessary information each user must posses.menus
main
switch statement by which the current menu function is chosenregister menu to become active.main loop is rather simple: at each iteration, it checks the value of the curr_menu global variable via a switch and launches the associated routine accordingly. Each such routine then displays its message and enters a while(true) loop, waiting for user input.menus.cpp file.ERROR menu if such a case occurs (i.e. if the current menu is the home page of a user, but there is no user logged in).enum class have been used for their own namespace feature and for their expressivity compared to numerical constants.registered status was saved as a single 8-bit variable, using bitwise operations: user i is registered if the i-th bit (from the right) of the variable is 1. If each user had a boolean variable associated for this matter, 6 bytes would have been used in total, instead of 1. Thus, 5 bytes are saved.F() macro. Also, variable types from <stdint.h> were used, for a better control.Notification struct contains the type (RecvFromFriend, FriendReq, ReqAccepted), the index of the user who sent it and the sum of money sent (used when it is the case).