ST's library will not run an Arduino UNO (ATmega328 or ATmega32u4) - you need a chip with more memory like SAMD, ST, ESP chips

Using the ST25DV16K breakout with Arduino is a simple matter of wiring up the sensor to your Arduino-compatible microcontroller, installing the ST25DV library they've written, and running the provided example code.

I2C Wiring

Use this wiring to connect via I2C interface. The ST25DV is one device but responds to THREE I2C addresses: 0x2D, 0x53 (user memory) and 0x57 (system memory)

  • Connect board VIN (red wire) to Arduino 5V if you are running a 5V board Arduino (Mega, etc.). If your board is 3V, connect to that instead.
  • Connect board GND (black wire) to Arduino GND
  • Connect board SCL (yellow wire) to Arduino SCL
  • Connect board SDA (blue wire) to Arduino SDA

Here is how to wire the sensor to a board using a solderless breadboard:

  • Connect board VIN (red wire) to Arduino 5V if you are running a 5V board Arduino (Mega, etc.). If your board is 3V, connect to that instead.
  • Connect board GND (black wire) to Arduino GND
  • Connect board SCL (yellow wire) to Arduino SCL
  • Connect board SDA (blue wire) to Arduino SDA

Library Installation

You can install the ST32Duino ST25DV library for Arduino using the Library Manager in the Arduino IDE.

Click the Manage Libraries ... menu item, search for ST25DV , and select the STM32duino ST25DV library:

Load Example

Open up File -> Examples -> STM32duino ST25DV -> ST25DV_HelloWorld

You'll need to define the pins, regardless of whether you're using them. The section below requires a set of pins.

Update this section to the following:

#else
// Please define the pin and wire instance used for your board
#define GPO_PIN A1
#define LPD_PIN A2
#define SDA_PIN D4
#define SCL_PIN D5

If you'd like, scroll down to setup() and you can modify the URL written to the tag

If you're using a microcontroller with native USB (which many are) we recommend adding the line

while (!SerialPort) delay(10);

after

// Initialize serial for output.
SerialPort.begin(115200);

So that you'll see the error report or success when the serial console is opened (otherwise you can miss it)

Now upload! You can open the serial console for debug information. Once programmed, you can scan the tag with your phone - the tag does not need to be powered to be scanned, it acts like a 'normal' RFID tag. Since the antenna's a little small you will need to physically tap the tag.

This guide was first published on Aug 10, 2020. It was last updated on Aug 10, 2020.

This page (Arduino IDE Usage) was last updated on Aug 10, 2020.

Text editor powered by tinymce.