NFC Payment System

Introducere

Using an Arduino microcontroller and an NFC module, a Near Field Communication (NFC) Payment System is a system that enables contactless payments. The system initiates and completes a payment transaction by exchanging data between the NFC module and a compatible device, such as a smartphone or contactless card.

When a user initiates a payment, the Arduino microcontroller processes the transaction and transmits a signal to the NFC module in order to establish communication with the user's device. The user then affirms the transaction via their device, after which the system verifies the transaction and completes it.

Overall, an Arduino-based NFC Payment System provides a basic and efficient method for making contactless payments that can be implemented in a variety of applications, from vending machines to transportation systems.

Descriere generală

Block Schema:

Hardware Design

List of parts

LCD 1602A: The LCD 1602A is a common character display module seen in embedded systems and electronic projects. It has a 16×2 character display, therefore it can show up to 16 characters per line for a total of 32 characters. It interfaces with microcontrollers via a 4-bit or 8-bit parallel interface and is controlled by a Hitachi HD44780 controller.

PN532: The PN532 is a highly integrated NFC (near-field communication) controller chip that enables device-to-device contactless communication. It is compatible with a variety of NFC standards, including ISO/IEC 14443 Type A/B, FeliCa, and ISO/IEC 15693. It has a wide range of uses, including payment systems, access control, and mobile devices.

ESP-01: The ESP-01 is a popular Wi-Fi module based on the ESP8266 chip. It has a small form factor and can be easily integrated into various electronic projects. It supports 802.11 b/g/n Wi-Fi standards and can be programmed using AT commands or with the NodeMCU firmware. It is commonly used in Internet of Things (IoT) applications such as home automation, smart sensors, and remote control systems.

Logic Level Shifter: A logic level shifter is a versatile circuit that plays a crucial role in bridging the gap between different voltage levels in digital signals. It acts as a compatibility translator, facilitating seamless communication and integration between devices operating at varying logic levels. This enables smooth interaction and ensures efficient data exchange in electronic projects, including those in the realm of Internet of Things (IoT) applications like home automation, smart sensors, and remote control systems.

Arduino UNO - a microcontroller board based on the ATmega328P processor. It is one of the most popular Arduino boards and is intended to be a simple foundation for constructing a variety of electronic projects.

Electrical Schema

Software Design

This app was written using Arduino IDE and Visual Studio Code. The software is divided in 3 parts:

  1. Arduino Code
  2. ESP (Wifi) Code
  3. Web Server

Arduino

1. First, we include all the libraries we need to use for the project.

#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
#include <NfcAdapter.h>
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
#include <SerialESP8266wifi.h>

2. Next, we define the pins of the LCD, NFC, buzzer and ESP01 modules, as noted in the electrical schema.

3. In the setup() function, we initialize the serial communication between Arduino and computer, and between Arduino and ESP01 module, with the baud rate of 115200.

4. We call the initLCD() function, which initialises the LCD screen, the initNFC() function , which turns the NFC module on, and the initWifi() function. which initialises the module. We also send a packet to the server, so that it knows that the Arduino is online.

5. We display on the LCD “Awaiting Transaction”. During this time, we wait for a NFC reading request from the ESP.

6. When a packet is received (a transaction initiated from the web interface), the value of the transaction is displayed on the LCD, along with the indication to tap a payment card to the NFC reader, which is activated.

7. If a card is presented, its information is sent to the server for the processing of the transaction and balance updates.

ESP (WiFi) Code

1. First we initialise the Serial connection with the Arduino.

2. We connect to the WiFi network, and send a confirmation packet through the Serial.

3. We create an HTTP server, with the endpoint /pay, which listens for payment requests from the web interface.

4. When a request is received, a reading from the NFC sensor is requested from the Arduino.

5. The reading is send back to the web as a response to the request.

Web Server

The web server is written using PHP, and uses an MySQL database for data storage.

The server contains the following pages:

1. Main page

  It contains the list of products, a login/logout button, a link to the admin interface

2. Purchase pages (/buy, /pay)

  Get the list of POS Terminals from the DB, send to the chosen one a NFC reading request, use the acquired data to process the transaction

3. Account pages (/login, /logout, /register, /account, /card)

  Get and store user data such as accounts, cards, balances

4. Managment page (/products)

  List and update the products.

Rezultate Obţinute

Concluzii

In conclusion, the NFC Payment System project utilizing an Arduino microcontroller, NFC module, and ESP-01 Wi-Fi module successfully demonstrates the implementation of a contactless payment system. The project provides a user-friendly interface through an LCD display and enables communication between the Arduino and a compatible device for initiating and verifying payment transactions.

By leveraging the capabilities of the PN532 NFC controller chip and the logic level shifter, the system ensures reliable communication and compatibility between devices operating at different voltage levels. The integration of the ESP-01 Wi-Fi module enables seamless connectivity and enables the system to interact with web-based interfaces for transaction processing and user management.

Overall, the NFC Payment System project offers a practical and accessible solution for implementing contactless payment functionality in various applications, such as vending machines, transportation systems, and more.

Download

Bibliografie/Resurse

pm/prj2023/apredescu/nfc_system.txt · Last modified: 2023/05/30 15:37 by bogdan.stefanescu02
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0