(+39) 351 838 6453 [email protected]
Home · Projects · STM32 and PN7150
Project · NFC firmware

NFC reader with STM32 and PN7150

Custom firmware for STM32 microcontrollers paired with the NXP PN7150 NFC controller: reading and writing tags, contactless cards and talking to smartphones, ready to build into your product.

STM32NXP PN7150NFC · RFID 13.56 MHzI²CC / HAL

The project

Many products need to recognise a card, a badge or a smartphone held close to the device: access control, a machine that only unlocks for an authorised operator, a vending machine, an item to track through production.

In this project we combined an STM32 microcontroller from STMicroelectronics with NXP's PN7150, a complete NFC controller with built-in firmware. The STM32 runs the application logic and the PN7150 handles all of the radio-frequency side: the result is a compact, low-power NFC reader that is easy to integrate into the customer's board.

In short: we deliver the STM32 firmware that drives the PN7150 and hands your application simple data (card UID, NDEF content, card-present events), already tested on the real hardware.

The PN7150 NFC controller

The PN7150 is an NXP NFC controller that integrates the RF front end and internal firmware compliant with the NFC Forum NCI (NFC Controller Interface) standard. The microcontroller does not have to generate the 13.56 MHz signal: it sends commands and receives responses and notifications over an I²C bus.

  • Read and write NFC Forum Type 1, 2, 3, 4 and 5 tags, MIFARE Classic, ISO/IEC 14443 A/B, ISO/IEC 15693 and FeliCa
  • Card emulation: the device can act as a card towards a smartphone or a reader
  • Peer-to-peer to exchange data with another NFC device
  • Low-power card detection: the reader waits drawing very little current and wakes up when a card comes close
  • I²C host interface with an interrupt line (IRQ) and an enable pin (VEN)

How the system is built

The hardware is simple: a few connections between the STM32 and the PN7150, plus the antenna and its matching network. The firmware is layered, so your application does not need to know the details of the NCI protocol.

Applicationyour logic
STM32StepLab firmware
PN7150NFC controller
Card / tagbadge, smartphone

Hardware

  • I²C bus between STM32 and PN7150
  • IRQ: the PN7150 tells the STM32 when data is ready
  • VEN: power-up and reset of the NFC controller
  • Antenna and matching network sized for the board

Firmware

  • I²C driver and interrupt handling on the STM32
  • NCI initialisation and configuration of the PN7150
  • Polling, card detection and NDEF reading
  • A simple API for the application, with error handling

Where it is used

The same firmware base fits very different products: what changes is the application logic and the type of card to read.

Access control

Opening doors, cabinets and gates with a badge or smartphone, with a list of authorised users.

Machine unlocking

A machine or tool only starts with the operator's card, and every use is logged.

Traceability

NFC tags on products, batches or tools to follow them through production and the warehouse.

Setup from a smartphone

The device receives settings or shows its status when you hold a phone near it, with no display or buttons.

Ticketing and prepaid

Reading contactless cards and tickets for vending machines, gates and pay-per-use services.

Home automation and IoT

Quick pairing of new devices and proximity commands at home and in buildings.

How we work on your project

Whether you start from an idea or from an existing board, the path is the same: a few clear phases, each with a start and an end.

01

Gather your ideas

Organise your ideas in a simple, complete outline: which cards to read, what should happen, what the priorities are.

02

Split the project into phases

Even if you plan future developments, break the project into small pieces: for example UID reading first, then NDEF and card emulation.

03

Contact us

Once your ideas are clear, write to us: we review the board, pick the right STM32 and propose times and costs for each phase.

Already have hardware? We can develop the firmware on your board with STM32 and PN7150, or design the electronics and antenna ourselves. See also STM32 firmware developers and Examples and applications.

Further reading

More projects

See what else we have built

All projects on the home page →

Need an NFC reader in your product?

Tell us what it needs to read and how it should behave: we develop the STM32 firmware and, if needed, the electronics with the PN7150.