1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Design and construction of bus fees payment model

71 13 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Design and Construction of Bus Fees Payment Model
Tác giả Nguyen Van Duc, Truong Nhu Vinh Loc
Người hướng dẫn PhD. Nguyen Thanh Nghia
Trường học Ho Chi Minh City University of Technology and Education
Chuyên ngành Electrical and Electronic Engineering Technology
Thể loại graduation project
Năm xuất bản 2023
Thành phố Ho Chi Minh City
Định dạng
Số trang 71
Dung lượng 7,27 MB

Cấu trúc

  • CHAPTER 1: OVERVIEW (17)
  • CHAPTER 2: THEORETICAL BASIS (19)
    • 2.1. OVERVIEW OF BUS FARE PAYMENT SYSTEM (19)
      • 2.1.1. Learn about bus fare payment system (19)
      • 2.1.2. Overview model (19)
    • 2.2. INTERNET OF THINGS OVERVIEW (20)
      • 2.2.1. Internet of things (IoT) (20)
      • 2.2.2. Requirements of an IoT system (21)
      • 2.2.3. Applications of IoT (22)
    • 2.3. RFID RADIO WAVE TEHNOLOGY (22)
      • 2.3.1. RFID technology (22)
      • 2.3.2. Pros and cons of RFID technology (24)
    • 2.4. DATA TRANSMISSION COMMUNICATION STANDARDS (25)
      • 2.4.1 I2C communication standard (25)
      • 2.4.2. SPI Protocol (26)
    • 2.5. OVERVIEW OF WEBSITE, WEB SERVER AND PHP (27)
      • 2.5.1 About the website (27)
      • 2.5.2. Introduction to Firebase (27)
      • 2.5.3. Introduction to programming Java (29)
    • 2.6. ANDROID (29)
    • 2.7. WIFI NETWORK (30)
  • CHAPTER 3: CALCULATION AND DESIGN (32)
    • 3.1. DESIGN REQUIREMENTS (32)
    • 3.2. BLOCK DIAGRAM OF THE SYSTEM (32)
      • 3.2.1. Card reading block (33)
      • 3.2.2. Central processing block (35)
      • 3.2.3. Display blocks (36)
      • 3.2.4. Information management block (38)
      • 3.2.5. Power block (39)
      • 3.2.6. Full circuit wiring diagram (39)
  • CHAPTER 4: CONSTRUCTION SYSTEM (41)
    • 4.1 PROGRAMMING SOFTWARE FOR COMPUTER (41)
      • 4.1.1 Programming software for websites (41)
      • 4.1.2. Programming software for mobile applications (41)
    • 4.2. SYSTEM ALTERNATIVE FLOWCHART (42)
      • 4.2.1. Main program algorithm flowchart (42)
      • 4.2.2. Flowchart of management program for admin (0)
    • 4.3. MODEL CONSTRUCTION (45)
  • CHAPTER 5: APP ON PHONE AND CODES (46)
    • 5.1. APP ON PHONE (46)
      • 5.1.1. Apps for users on Android phones (46)
      • 5.1.2. Management page on web server (55)
      • 5.1.3. Website for Users (58)
      • 5.1.4. System operation (62)
    • 5.2. CODES (64)
  • CHAPTER 6: CONCLUSIONS AND DEVELOPMENT DIRECTIONS (69)
    • 6.1. CONCLUSION (69)
    • 6.2. DEVELOPMENTDIRECTIONS (69)

Nội dung

NGUYEN THANH NGHIASTUDENTS: NGUYEN VAN DUC Trang 2 HO CHI MINH UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING ------ HO CHI MINH CITY- 12/2022 GRADUATIO

OVERVIEW

The continuous progress of the scientific and technological revolution significantly influences and inspires the globalization process Innovations and advanced technical measures, along with modern technological approaches and new management techniques, enhance production and commercial practices, ultimately boosting labor productivity.

Buses have become a popular mode of public transportation in major cities across Vietnam, effectively meeting the transportation needs of many while promoting a cleaner environment by reducing traffic congestion and reliance on private vehicles In rural provinces, bus services typically require cash payments or monthly subscriptions, which can be inefficient and time-consuming, particularly during health crises like last year's epidemic when safety is paramount.

In Ho Chi Minh City, the smart e-bus card scheme was also piloted in October

In 2022, the Ho Chi Minh City Public Transport Management Center launched a pilot program for an automatic bus fare payment system utilizing smart electronic cards across nine bus routes This initiative involves 141 buses and aims to attract a young demographic with a high propensity for e-wallet usage, particularly those traveling to and from educational campuses.

Customers can make payments using two methods: a physical card known as UniPass or a QR code via their smartphone This payment model has received approval from Ho Chi Minh City's Center for Public Transport Management, the Department of Transport, and the People's Committee.

Despite over a year of testing the smart bus card in Ho Chi Minh City, its usage remains low among passengers, particularly manual laborers who lack email addresses and e-wallets The main issue is the entrenched habit of using traditional payment methods For many middle-aged users, the concepts of scanning QR codes, setting up accounts on smartphones, and linking prepaid payments to e-wallets or bank accounts feel unfamiliar and daunting.

Despite over a year of testing in Ho Chi Minh City, the smart bus card remains underutilized, primarily by manual laborers who want to travel but often lack email addresses or e-wallets The predominant barrier to adoption is users' preference for traditional payment methods.

QR codes, setting up accounts on mobile devices, merging bank accounts, and connecting prepaid payments via e-wallets are still too strange to middle-aged customers

The article focuses on the "Design and Building of a Bus Fare Payment Model," utilizing RFID technology and an ESP8266 Wi-Fi microcontroller This innovative system allows users to efficiently manage and monitor their travels through a user-friendly smartphone app.

Implementing an IoT-based automatic bus cash register system enhances efficiency by reducing the need for service staff and minimizing disease transmission This innovative system leverages RFID technology for streamlined money management and payment processing Additionally, users can conveniently monitor their payment accounts through a mobile app, while the entire database is securely managed by a central server.

Document reference strategy: consult documents on data colleting using magnetic cards Scientific experimental methods: Direct data collection, web and mobile application posting

• The security of the system was not high

• Management software only meets the basic requirements

• The model is designed with a protective box with a Mica box.

THEORETICAL BASIS

OVERVIEW OF BUS FARE PAYMENT SYSTEM

2.1.1 Learn about bus fare payment system

To alleviate traffic congestion caused by urbanization, the government and various agencies are promoting public transportation, such as buses, while enhancing infrastructure These initiatives aim to reduce the reliance on private vehicles and manage the strain on urban transport systems In our country, users can conveniently access this mode of transport by purchasing monthly tickets or paying cash for individual trips.

New means of payment, including direct payments using cards, bank accounts, and

The development and testing of QR code scanning mobile applications in major cities have emerged from the rapid advancement of science and technology However, the results have fallen short of expectations, primarily due to user behavior and the challenges some consumers face with card payments.

RFID technology, while inheriting limitations from previous experimental models, offers adaptability for payment systems, facilitating gradual changes in user behavior This technology serves as a foundation for enhancing the existing system, with the potential for widespread application across various infrastructures in cities and towns nationwide.

After studying the previous bus fare payment model, students would like to come up with the following basic model:

Passengers must first get and register a user card, which contains details including their full name, contact information, and address, before using the service

The client then adds money to the account to start using it

Users can easily access the system by scanning their cards at the bus card scanners This triggers data retrieval, allowing information to be transferred to the database via Wi-Fi Payment processing occurs only if the data is accurate and the account balance is sufficient.

To enhance user experience and assist managers in tracking payment history, the system will securely store trip information on both the web server and mobile application after a successful payment This proactive measure aims to mitigate future issues, such as the loss of personal items in vehicles.

INTERNET OF THINGS OVERVIEW

The Internet of Things (IoT) enables devices to communicate with each other over the internet or other networks, allowing for remote information tracking This technology provides valuable feedback to support decision-making across commercial, industrial, and residential sectors, typically utilizing sensors that connect to a centralized system.

Some common day-to-day examples could be:

• Temperatures in refrigerator or food hearing units in the food and beverage industry

• Assistance with the control of temperature and humidity levels

• Detection of gas and dust levels

• Monitoring of water levels and herd locations for agricultural purposes

• Different applications in the automotive, aviation and nautical sectors such as the sensing of type pressure for trucking fleets

Basically, IoT is represented by 4 parts: Devices (Things), Gateways, Network and Cloud Infrastructure, Service-creation and Solution layers

Figure 2.2 Structure of an IoT

The new gadgets will feature advanced sensor chips capable of recognizing and converting natural elements into usable data for online applications, facilitating navigation and executing user-defined commands.

2.2.2 Requirements of an IoT system

An IoT system must have the following requirements:

• Because the connection is based on identification, “Things” must each have a unique

ID the system must facilitate connections between Things, and the connection itself is based in the identities of things

• Ability to collaborate: A basic IoT system must have interaction between networks and things

Self-management capabilities in networks, such as self-configuration, self-management, self-healing, optimization, and self-protection against hazardous agents, are essential for ensuring flexibility across various application domains, communication environments, and device types.

The Internet of Things (IoT) connects numerous devices, leading to increased risks in information security These risks include fraudulent authentication, exposure of sensitive information, and the potential for data manipulation or fabrication.

• Privacy Protection: Since everything has its own owners and users, it contains some information IoT systems must safeguard privacy when transmitting, storing, and analyzing data

• Service Agreement: This Service may be delivered through automatic data collection, communication, and processing between "Things" in accordance with operator- or user-defined rules

Effective network management is essential for the proper functioning of Internet of Things (IoT) systems While many IoT applications can operate independently, it is crucial for stakeholders to monitor the entire operational process to ensure optimal performance.

The prevalence of IoT smart devices has surged in industries, enterprises, and healthcare facilities, significantly improving management and quality of life These devices offer a wide range of applications that are increasingly being highlighted to showcase their benefits.

• Traffic cameras: vehicle monitoring and traffic control

• Smart energy system: monitor and manage energy consumption situation

• Smart agriculture: automatic irrigation, feeding, temperature and humidity monitoring management… remotely

• Smart alarm: Monitor the amount of radiation, gas leaks, dangerous explosive gases and notify the situation in a timely manner

RFID RADIO WAVE TEHNOLOGY

Radio Frequency Identification Technology (RFID) is a wireless technology that allows devices to read data from a non-contact chip over long distances without physical interaction Utilizing a radio transceiver system, RFID facilitates the monitoring and management of items efficiently Its significance and utility are increasingly evident in the current era of Internet of Things (IoT) development.

A tag (an RFID chip carrying information) and a reader that receives the information from the chip are typically the two primary components of an RFID system

RFID tags are essential for item recognition, featuring a unique code for each tag to prevent overlap These tags are attached to the items and work in conjunction with a reading device equipped with an electromagnetic wave antenna There are two main types of RFID tags: passive RFID tags, which do not have their own power source, and active RFID tags, which are powered and can transmit signals over greater distances.

• Passive tags: No external power source is required, reading services provide electricity, allowing for close reading

• Active tags: PIN-fed, used when the reading distance is large

An RFID system consists of many components that work together to create a complete and unified system [3]:

• Any RFID system must contain a tag as a necessary element may use radio waves to store and send data to a reader Typically, tags contain data about specific items

• Reader: Is an essential part that handles signal processing from the antenna and communication with the control circuit

• An essential element that must be present for Reader to connect with Tag is the Reader Antenna

• The Controller, a necessary component, handles signals from the Reader and communicates with the data server

• Data server and system software: Has the ability to communicate with users and store data

• Between the control circuit and the data server, communication infrastructure (data transmission standards) serves as a data transmission bridge

- Use a wireless radio system, do not use light rays like barcodes

- The frequencies used range from 125kHz or 900MHz

- Barcodes and other technologies cannot successfully increase information reading through hard ice, concrete, fog, or other conditions and materials

- Information is transmitted over small

An RFID system operates by using an RFID reader that emits electromagnetic waves at a specific frequency When an RFID tag enters the active region, it captures the emitted waves, harnesses their energy, and transmits its unique code back to the reader This process allows the RFID scanner to identify the tag present within the designated area.

Figure 2.4 The principle of operation of RFID systems

RFID chip cards typically have 32-bit IDs, which amount to more than 4 billion unique codes RFID tags have a wide range of reading ranges

RFID tags vary in type based on their operating frequency, antenna size, and whether they are active or passive These tags can read distances from a few millimeters to several meters Comprising small semiconductor chips and antennas within a specific packaging, RFID tags can store between 96 and 512 bits of data, offering up to 64 times more storage capacity than traditional barcodes.

2.3.2 Pros and cons of RFID technology a Advantages of RFID technology

• RFID tags can work well in unfavorable environment

• Each chip card is assigned a different code, so the likelihood of getting the wrong card and getting the wrong data has a very low probability

• It is possible to store data on RFID tags many times, thereby saving costs

• Allows using a reader to read multiple tags in its reading area over a period of time, thereby saving operating time

• Large data storage capacity: 92-bit RFID tags provide the ability to identify billions of objects

• An RFID tag can be read without having to have contact with the reader b Disadvantages of RFID technology

• The cost is more than using barcodes

• Environmental influences, due to the abundances of metals and liquids that hinder the reader

• Ineffective with RF absorbers and breakers such liquids, chemicals, and metals

• Limit the length of time it takes to read a card

• When several readers are present at once, it affects hardware noise

• Relying on the reader’s strength limits one’s capacity to manipulate RF wave energy.

DATA TRANSMISSION COMMUNICATION STANDARDS

Microcontroller families include a variety of common date transfer communication protocols such as:

• Synchronous and asynchronous serial data transmission (USART – Universal Synchronous Asynchronous Receiver and Transmitter)

• Data exchange between peripherals and microcontrollers (SPI – Serial Peripheral Interface – Serial Peripheral Interface)

• Data transfer using two wires (I2C – Inter integrated Circuit)

The Inter-Integrated Circuit (I2C) is a communication bus that enables integrated circuits (ICs) to connect and interact seamlessly Widely adopted as a peripheral communication channel, I2C supports various IC types, including 8051 microcontrollers, PIC, AVR, and ARM Its reliability and efficiency have established it as the industry standard for control communications.

The serial clock line (SCL) is a crucial component of the I2C protocol, exclusively controlled by the Master device and operating at frequencies of 100 kHz and 400 kHz, with maximum levels reaching 1 MHz and 3.4 MHz It works in tandem with the serial data line (SDA), ensuring that data transfers are synchronized with the SCL signal before being transmitted via the SDA line Importantly, both the SCL and SDA lines are shared among all devices connected to the I2C network.

The I2C bus supports various operating modes, including one master with one slave, one master with multiple slaves, and multiple masters with multiple slaves Regardless of the selected mode, an I2C connection always necessitates a master-slave relationship.

The Serial Peripheral Interface (SPI) is a synchronous serial communication standard that facilitates full duplex data transfer, enabling simultaneous transmission and reception of data Commonly known as a 4-wire interface, SPI is widely used in various applications for efficient communication between devices.

There are four digital signals utilized in the SPI interface:

MOSI (Master Out Slave In) is the communication port responsible for transmitting data from the master device to the slave device, while also facilitating the reception of data from the passive side.

MISO (Master In Slave Out) refers to the data transfer process where information flows from the slave device to the master device via the master side's gateway and the exit port of the passive side.

• SCK or SCLK: Serial clock pulse signal used to transmit signals to salve devices

• CS or SS (Chip Select, Slave Select): Choose the slave device or the microchip

The host device initially communicated with only one device by activating its SS line It controls the SS lines for each device before transmitting pulses on the SCLK line to manage data transfer Simultaneously, the host device receives data from my device through MISO and sends data via MOSI.

Each Master and Slave chip features an 8-bit data register During each clock cycle generated by the Master, a bit from the Master's data register and a bit from the Slave's data register are transmitted via the MISO line.

Figure 2.8 SPI data transfer process

OVERVIEW OF WEBSITE, WEB SERVER AND PHP

A website, often called a web page, consists of a collection of related web pages accessible on the Internet, usually within a single domain or subdomain Each web page is an HTML or XHTML file that can be accessed via the HTTP protocol Static websites are created using HTML files, while dynamic websites are hosted on servers using Content Management Systems (CMS).

Three essential components are required for a website to function in an international setting:

• Domain name: a Website’s official address On the internet, there is only one domain name, users must pay an annual maintenance cost

• Code sources (can be html, xhtml, files)

Hosting serves as the central repository for all website data, including source files, emails, and user information, facilitating communication between users and service providers.

A website can be built on many different programming languages such a PHP, ASP.NET, Java, Ruby on Rails, Perl…

Depending on the purpose of use, websites can basically classify as follows:

Firebase, a Backend-as-a-Service (BaaS) platform, offers developers a comprehensive suite of tools and services designed to enhance app development, expand user engagement, and drive profitability Leveraging Google's robust infrastructure, Firebase ensures reliable performance and scalability for modern applications.

Firebase is categorized as a NoSQL database program, which stores data in JSON like documents

Figure 2.9 Basic operating model of a firebase

Google Firebase is a versatile platform designed for developing applications across Android, iOS, and web environments It provides essential tools for conducting marketing and product experiments, gathering analytics, and identifying and resolving app errors One of its key features is robust authentication support.

User identity is crucial for most applications, as it enables secure cloud storage of user data and ensures a consistent personalized experience across all devices.

Firebase Authentication offers robust backend services and user-friendly SDKs, along with pre-built UI libraries to streamline user authentication for your application It enables secure sign-in options through passwords, phone numbers, and well-known federated identity providers such as Google, Facebook, and Twitter, among others.

Cloud Firestore is a scalable and flexible database solution from Firebase and Google Cloud, designed for mobile, web, and server development It ensures data synchronization across client applications through Realtime listeners and provides offline support, enabling the creation of responsive apps that function effectively despite network latency or connectivity issues Additionally, Cloud Firestore integrates seamlessly with other Firebase and Google Cloud products, including Cloud Functions.

The Firebase Realtime Database is a cloud-hosted NoSQL database that stores data as JSON and synchronizes it in real-time across all connected clients When developing cross-platform applications using Apple, Android, and JavaScript SDKs, all clients share a single Realtime Database instance, ensuring they receive updates with the latest data automatically This seamless synchronization allows data to remain accessible even when the app is offline, enhancing user experience and functionality.

Firebase Cloud Messaging (FCM) is a free cross-platform messaging solution that enables reliable message delivery It allows you to notify client apps about new data, such as emails, ready for synchronization FCM is effective for enhancing user engagement and retention through notification messages Additionally, it supports instant messaging by allowing payloads of up to 4000 bytes to be sent to client applications.

Java is a straightforward, object-oriented programming language that emphasizes simplicity in writing, compiling, and debugging code It facilitates the development of modular programs and promotes code reusability Designed to have minimal implementation dependencies, Java enables developers to "write once, run anywhere," as all systems supporting Java can execute its code Java programs are compiled into bytecode, which can run on any Java Virtual Machine, and its syntax closely resembles that of C/C++.

ANDROID

Android is the leading mobile operating system, known for its rapid growth and widespread adoption Acquired by Google, the Linux kernel was transformed into an open-source platform, allowing developers, mobile networks, and device manufacturers the freedom to modify and distribute Android under a non-binding license This flexibility has solidified Android's position as the most popular smartphone platform globally.

Android consists of 5 main parts contained in 4 layers:

The Android operating system is built on the Linux version 2.6 kernel, which provides essential system functions such as network management, drivers, memory management, and security Acting as an intermediary, the Linux kernel creates an abstract layer between the hardware and software stack.

The Android System comprises various C/C++ libraries that support different components of the platform Developers leverage the Android application framework to utilize these libraries effectively Key libraries include Free Type, Surface Manager, Media Framework, SQLite, and Webkit, which are essential for building robust Android applications.

• Application: Android versions come with fundamental programs like email, SMS, calendar, map, and contacts The programming language Java is used to create all apps

• Android framework: Shows how various Android features (connecting, informing, and obtaining data) may be constructed for usage in apps by application developers

The Android Runtime layer, in conjunction with the Android runtime library, provides essential libraries for developers to create applications using Java Android applications utilize the Dalvik virtual machine, which manages their operations similarly to programs built on the Java virtual machine Additionally, virtual machines play a crucial role in optimizing the battery and CPU performance of Android smartphones.

Figure 2.10 Basic architecture of an android operating system

The Android operating system utilizes multiple programming languages such as Java, C, C++, CSS, Python, Lua, and XML, which facilitates easier development for programmers This diverse language support is especially beneficial for beginners, making it more accessible to navigate the Android environment.

WIFI NETWORK

Wireless Fidelity (WiFi) is a wireless technology that utilizes radio waves to provide internet connectivity, much like mobile phones, televisions, and radios This system allows for a cable-free internet connection, making it a convenient choice for users.

WiFi connectivity enables fast wireless communication and Internet access for a variety of smart devices Utilizing the IEEE 802.11 connection standard, WiFi has become essential for numerous applications across modern technology.

The radio waves used for WiFi are essentially the same as the radio waves used for mobile phones, portable devices, and other gadgets It can convert binary codes 1 and

0 to radio waves and vice versa, transmitting and receiving radio waves

WiFi waves differ from radio waves by transmitting signals at frequencies of 2.5GHz or 5GHz, enabling the transfer of more data compared to the frequencies utilized by mobile phones and other portable devices.

CALCULATION AND DESIGN

DESIGN REQUIREMENTS

RFID tags are revolutionizing bus fare payment by providing a convenient alternative to cash transactions Passengers can easily register and collect their cards at operational stations near their residences To use the service, they simply scan their cards at the card readers located at the vehicle's entrance The system then verifies the card information and processes the payment according to established regulations.

To handle user data, create a database and develop a client management page on an admin computer The mobile application also allows users to track and manage their information.

BLOCK DIAGRAM OF THE SYSTEM

Figure 3.1 Block diagram of the system

The system consists of blocks with the following functions:

The system caused by many components coming together Each component plays a few important roles in the system:

• Data retrieval block: Read the RFID code and transfer it to this block for central processing,

The Wifi ESP8266 board functions as the central processing unit of the system, receiving data from the RC522 module It utilizes SQL to send this data to a database for information retrieval and controls the LCD panel to display status updates.

In the Information Management block, data is received from the processor block, which is then used to query customer information using the card number to facilitate transactions After processing this data, the results are exported to the LCD panel and instructions are sent to the CPU block To enhance user experience, a database is created and maintained to support updated websites and mobile applications.

• Power block: Offers the system’s operating power

The card reading block is responsible for decoding the RFID tag's information and transmitting it to the central processing unit for analysis In the system model for this topic, students opt for NFC readers due to the minimal distance between the user and the reader This choice enhances practicality by allowing for smaller card sizes and minimizing movement, while also providing quick, accurate, and energy-efficient data processing.

The NFC-RFID ttCR95HF and RFID RC522 are popular NFC card readers that meet essential requirements for efficient data management For students developing system models, the RC522 RFID module is an excellent choice due to its quick and accurate information handling, as well as its ease of repair and replacement when issues arise.

The RC522 RFID module is an affordable and compact solution ideal for RFID card writing applications Utilizing the Philips MFRC522 IC, it effectively reads and writes data at a frequency of 13.56MHz for NFC cards.

The team chose the RC522 RFID module for its reliability, speed, and ease of use as an RFID card reader This economical option allows for quick card reading and is simple to repair or replace in case of issues.

• Sleep mode line: less than 80àA

• Data transfer rate: up to 10Mbit/s

• Supported RFID tags: mifare1 S50, mifare1 S70, mifare1 Ultralight, mifare1 Pro, mifare1 Desfire

Without extra external circuitry, the MFRC522 IC's inbuilt transmitter may drive a read/write antenna created to connect with the card and transponder

Figure 3.3 Connecting the wire between the RC522 and the ESP8266 Wifi

The Wifi ESP8266 board integrates wifi connectivity to facilitate communication between the microcontroller and the RC522 module Upon successfully scanning a card, the microcontroller transmits the data to the server and manages the display on the LCD panel, while an additional buzzer sounds to indicate success.

To effectively manage peripheral devices like LCD screens and RFID card readers, the system can also connect to the internet for access to customer databases The WiFi ESP8266 perfectly fulfills these requirements.

Figure 3.4 Integrated ESP8266 Wifi board

• Number of I/O pins: 10 (all I/O pins have interrupt/PWM/I2C/1-wire)

• Number of Analog Input pins: 1-Flash memory: 32MB – Input voltage:9-24V

• Programming on languages: C/C++, Micro-python, Node MCU – Lua

The LCD 16x2 screen serves as the primary display block in this system, effectively showcasing user notifications and consumer information Its selection is driven by its user-friendly interface, cost-effectiveness, and adherence to display standards, making it a convenient choice for members.

The 16 pins of the LCD are divided into 4 signal types as follow [3]:

The power pins of the device include Pin 1, which serves as the mass connection (0V), and Pin 2, connected to a +5V power source (VDD) Additionally, a third leg is typically attached to a rheostat for contrast adjustment, allowing users to fine-tune visibility until the characters are clearly displayed.

The register selection control pin (RS pin) is pin 4, essential for operation The R/W pins manage read and write functions, while the E pin enables the latch pulse Pins 7 to 14 consist of eight D700 data pins, facilitating data transmission between the control device and the LCD.

• Pins 15, 16, which are used to power the backlight so that the LED A and LED K may be viewed at night

Pins Pin name Input/Output Signal function

4 RS Input Register Select H: data signal, L: instruction signal

5 R/W Input Read/Write H: read mode, L: write mode

Table 1 Pin function of 16x2 LCD

Utilizing an I2C LCD module allows for efficient operation of the LCD display while conserving CPU resources This module communicates with the central processing unit using the I2C protocol, enabling seamless data exchange and enhancing overall system performance.

This approach offers the advantage of reducing the number of peripheral connection pins on the microcontroller, making them easier to manage and connect to the LCD Furthermore, it simplifies programming, allowing for easy adjustments to screen contrast, lighting, and LCD address with minimal modifications.

• Supported display: LCD1602, 1604, 2004 (HD44780 driver)

• Default address: 0X27 (adjustable by A0/A1/A2 pin short circuit)

• Built-in Jump latch to provide lights for LCD or shut-off

• Built-in contrast-adjustable rotational rheostat for LCD

Create a website that connects to a computer database, featuring both login and administrative interfaces This platform will facilitate passenger fare payments, offering details about the traveler, remaining time after payment, and the account balance The website's data will be hosted on a web server.

Students provide access privileges to two objects, admin and user, using various administration interfaces to operate the website as follows:

The system operates on a bus, drawing power from the bus's battery This power is then converted to 3.3 V to meet the requirements of the system's equipment.

STT Component name Consumption current (mA) Quantity Total current (A)

Table 2 Consumption current of component in the system

CONSTRUCTION SYSTEM

PROGRAMMING SOFTWARE FOR COMPUTER

We utilize Microsoft Visual Studio software to create websites, which has several benefits, including an intuitive user interface that is suitable even for those new to web development

Figure 4.1 Interface of Microsoft Visual Studio

Microsoft Visual Studio is a powerful and lightweight code editor that offers significant advantages, including a compact size, a wide array of free plugins, and robust cross-platform compatibility with Windows, Linux, and Mac OS.

4.1.2 Programming software for mobile applications

Android Studio is the most advanced and official tool for Android programming, developed by Google specifically for the Android platform It is the primary Integrated Development Environment (IDE) used by developers to create the majority of mobile apps today.

Figure 4.2 Interface of Android studio

Android Studio provides essential tools for building and debugging applications during development It includes the Android Build toolkit, which facilitates the creation, testing, execution, and packaging of apps.

Android Studio serves as an intuitive interface for app creation, efficiently managing complex file tasks in the background However, users must separately install the Java programming language on their devices to ensure proper functionality.

SYSTEM ALTERNATIVE FLOWCHART

Upon system activation, the ESP8266 initializes the Serial Peripheral Interface (SPI) communication speed with the RFID module, computer, and LCD, along with the input and output pins The microcontroller then searches for a known Wi-Fi network to establish a connection When a user scans their card, the card code is retrieved to access the user's information stored in Firebase If the information is valid and the account balance is sufficient, the system queries and compares the data before processing the payment A confirmation of a successful transaction is sent back, enabling the ESP8266 to operate the LCD display Additionally, the ESP8266 notifies the app of the payment status, whether successful or failed due to insufficient funds.

Figure 4.3 Flowchart of the system

If a card is not registered, the notice will be shown on the LCD for the passengers

To pay for your trip expenses, be aware of and carry out cash transactions

4.2.2 Flowchart of recharge program for admin

Figure 4.4 Algorithm flowchart of making a deposit

The ESP8266 initializes various components including Serial, SPI, LCD, Firebase, I/O pins, and Wi-Fi connection Upon scanning a card, the microcontroller retrieves user information from Firebase; if no data is found, the LCD prompts the user to register The admin website displays all user details, allowing the manager to recharge funds Once the transaction is complete, a successful payment message is shown on the LCD and sent as a notification in the app, with the updated amount reflected in Firebase.

MODEL CONSTRUCTION

Figure 4.5 completed app on phone and web

Connect the components after constructing the circuits The following elements make up the final system model: Card reader, administrative administration website, and user-facing Android app for mobile devices

It is vital to verify that the circuit is functioning properly after it has been built while also fixing mistakes brought on by the construction process Take these actions:

• Step 1: Check the wire connection on the card reader

• Step 2: Check Wifi or 4G connection on card reader, website and android app

• Step 3: Supply power to check the input source at the power pins of the microcontroller board

• Step 4: Load the basic program into the microcontroller and check if it works well

To ensure seamless functionality, scan the card at the reader and verify that the microcontroller is connected to the database This process facilitates the transfer of information to websites and mobile applications Following these tests, the results can be effectively analyzed.

Wiring Connect the wire firmly, do not drop during the move

Source The voltage provided by the adapter is about 5V, the output voltage of the ASM1117 module is exactly 3.3V

Website Stable running, friendly interface

App android Works well, less error in network connection

APP ON PHONE AND CODES

APP ON PHONE

5.1.1 Apps for users on Android phones

The Android app designed for the automatic bus ticket payment system enhances user experience by providing essential features that make ticket purchasing convenient and enjoyable on mobile devices.

The application's user interface is broken down into the following sections: login, user information, payment history, and password change a Login screen

To log in to your account, please enter the correct email address and password that were previously registered in the system's database By selecting the "Remember Me" option, the app will save your login credentials, allowing for automatic entry of your email and password during future visits.

Figure 5.1 Login Interface b Sign up screen

To register a new account for the app, users must provide essential information, including a username, email address, ID card, RFID, and password It's important to fill in all required fields; otherwise, an error message will appear.

Figure 5.1 Password wrongly filled Figure 5.3 Password not enough character

Figure 5.4 Sign up screen c Main Screen

Upon successfully logging into their account, users are greeted by the homepage screen, which displays essential information, including their name and account balance Additionally, this screen provides a convenient search feature for users to explore bus routes.

Customers may verify that the information they previously entered is accurate by visiting this page, which will display all of the cardholder's information

Figure 5.7 User information screen Figure 5.8 Edit information screen

On this screen, you need to choose your province from a given list as a private information e Change password screen

To change a password, the app will prompt the user to enter their old password before allowing the creation of a new one If any fields are filled out incorrectly, a warning notice will appear to alert the user.

The software will route users to a different screen after a successful password change by the user f Payment history screen

Using an RFID card for bus fare payments allows the interface to monitor the user's payment history, detailing both the amount paid and the time of each transaction.

The transaction bus section displays the bus number used by the passenger, while the time section includes details such as the date, year, and minute When customers pay their bus fare using an RFID card, this information serves as a transaction record and helps users effectively plan their routes.

When people successfully linked the baking account with the app, they can easily deposit throughout the app

Figure 5.14 Linking with bank screen

Figure 5.15 Successfully linked with bank h Note screen

People can read these notes in order to know how to use the app and also the card while using buses i Notification

When a user swipes their card, the corresponding amount is deducted from their account, and a notification is sent to confirm the successful payment.

Figure 5.17 Notification of successful payment

When users' accounts lack sufficient funds for bus services, the system promptly sends notifications to alert them to recharge their accounts to maintain uninterrupted access to the service.

Figure 5.18 Notification of not having enough money to pay for bus service

When people successfully recharge for the account, a notification will be delivered to the device

Figure 5.19 Notification of successful recharging 5.1.2 Management page on web server

To develop a comprehensive website, users must implement essential features such as login and logout functionalities, user registration, account recharging, and user management The website's structure includes a dedicated login page for administrators, ensuring secure access to vital data and user management tools.

This page displays the admin's login credentials, including username and password, for the database-connected system There is no registration information for the Admin, as the account was created by the programmer and is exclusively accessible to IT personnel Upon successful login, the system directs users to the website's admin interface.

Figure 5.20 Login page for admin b Admin website homepage

Figure 5.21 Admin homepage after successful login

After successfully logging into the admin account and validating the account identification through Firebase's Authentication database, the admin can access the homepage, where the registered email is prominently displayed Additionally, the customer deposit page is available for managing transactions.

Figure 5.22 Online credit card for customers

Figure 5.23a Other account balance entries on Firestore Database when admin tops up successfully

Figure 5.23b Other account balance entries on Firestore Database when admin tops up successfully

The customer's card balance will be loaded online using Firebase's "remain" database

A website where users may only register after receiving a card code from the administrator and paying with cash or online a Website homepage for Users

Figure 5.24 Website homepage for users who are not logged in

Users can conveniently check and update their personal information on this website, allowing administrators to effectively monitor user data and ensure robust security This system also tracks the stations where customers have utilized their cards, facilitating quick cashless payments and saving valuable time and effort for bus employees.

Users may register their email account and password on this page thanks to its user-friendly UI

Figure 5.25 Website account registration page for User

The "Authentication" method on Firebase will be used to update the data in the database

Figure 5.26 Email and password are stored on Authentication on Firebase Database c Website login page for Users

Figure 5.27 Website account login page for Users d User information home page after successful login

Figure 5.28 User information after successful login e Update information, as well as modify information on the user’s homepage

The webpage will open when a user clicks the "EDIT DETAIL" button, allowing them to alter their avatar, email, name, contact phone number, address, ID card, and bus card code

Figure 5.29 User information registration fields

Figure 5.30 User information after updating information

Admins may easily follow users thanks to the installation of user information data in the Realtime Database area of Firebase at the same time

Figure 5.31 User information after updating information to Realtime Database on

Figure 5.32 Model of the scanning card system

Figure 5.33 Module of recharging system

The bus boarding gate features a system consisting of a card reader and a display for payment notifications As passengers enter through the front door, they swipe their cards at the card reader to complete their payment The students successfully simulated two card readers for this system.

2 separate bus routes due of the topic's narrow scope

When the customer card is scanned at the reader, a notification will appear on the LCD screen if the card has not been registered

If a client has registered a card but their account balance is insufficient for the journey, the system will automatically request additional funds from the LCD to be added to the card.

CODES

Figure 5.37 Codes of login screen

Figure 5.38 Codes of Signup screen

Figure 5.39 Codes of Main screen

Figure 5.40 Codes of User information

Figure 5.41 Codes of Change Password screen

Figure 5.42 Codes of Payment history

Figure 5.43 Codes of Recharge screen

Figure 5.44 Codes of Note screen

CONCLUSIONS AND DEVELOPMENT DIRECTIONS

CONCLUSION

• The model is completed in line with the construction outcomes

• The system runs relatively stable

• User-friendly web interface and android application

• The product is easy to use for users

The aim of this initiative is to keep the cost of bus travel affordable for each user while transitioning from direct payment methods to an automated system This shift is similar to the previous payment approach, which can lead to feelings of alienation among some customers who struggle with technology Furthermore, this process serves as a way for consumers to gradually adapt to the new payment system before they receive and utilize smart bus cards.

DEVELOPMENTDIRECTIONS

The team suggests many development directions to make the system better, more reliable, and highly useful in real life:

• Increase its exposure so that individuals and students may find it on social network fast and effortlessly

• For long distance travel, change the default fare computation to include the number of stations or distance traveled

[1] Utility from smart bus card

(https://mt.gov.vn/vn/tin-tuc/59762/tien-ich-tu-the-xe-buyt-thong-minh.aspx)

[2] An overview of RFID technology in the 4.0 era

(https://haphan.com/News/17500/tong-quan-cong-nghe-rfid-trong-thoi-dai-4-0)

(https://androidcoban.com/gioi-thieu-ve-dieu-hanh-android.html)

[4] Nguyen Thi Huyen Trang, "Research on IoT trends and applications to traffic management problems in Hanoi", Graduation Project, Hanoi University of Technology,

[5] Ha Duyen Trung, Nguyen Huu Trung, Internet of Things, STINFO magazine, no

[6] How Smart City Barcelona Brought the Internet of Things to life, http://datasmart.ash.harvard.edu/news/article/how-smart-city-barcelona-brought-the- internet-of-things-to-life-789

[7] J.Paul, S.Dale, Baljeet Malhotra, Meng Qiang (2013), RFID based vehicular networks for smart cities

[8] Laisheng Xiao (2011), Internet of Things: A new application for Intelligent Traffic

Monitoring System, Journal of Networks

[9] Https://www.pololu.com/product/772/specs

Ngày đăng: 04/01/2024, 13:44

w