AnsweredAssumed Answered

Can't send data via NFC to mobile phone

Question asked by Kamel NFC on Jul 15, 2019
Latest reply on Jul 16, 2019 by Estephania Martinez

Hi there,

 

I'm using NT3H2111 nfc tag, I tried via arduino to send data to my mobile phone using this code :

 

#include <Wire.h>

 

int i = 0;
int j = 0;

 

#define ADDR 0x55

 


uint8_t NDEF_DATA[] = { 0x03, // NDEF Message
  15, // Message size
  0xD1, // Record header
  1, // Type Length - 1 byte
  11, // Payload Length - 11 bytes
  'U', // Type / URI
  0x01, // Payload
  'm', 'i', 'k', 'r', 'o', 'e', '.', 'c', 'o', 'm',
  0xFE
}; // NDEF Message End Mark

 


void setup()
{

 

  delay(5000);
  Wire.begin();
  // initialisation de la liaison I2C
  Serial.begin(9600);
  // initialisation de la liaison série vers la console
 
 
  Wipe_Tag();
 
  Wire.beginTransmission(ADDR);
  Wire.write(0x00);
  Wire.endTransmission();
 
  Wire.requestFrom(ADDR , 7);
  Serial.println("UUID:");
 
  while(Wire.available())
  {
  Serial.print(Wire.read(),HEX);
  }
 
  Serial.println();
 
  Wire.beginTransmission(ADDR);
  Wire.write(0x01);
 
  for (i = 0; i < 16; i++)
  {
   Wire.write(NDEF_DATA[i]); //Fill Block with Data
  }
  Wire.endTransmission();
  delay(50);
 
  Wire.beginTransmission(ADDR);
  Wire.write(0x02);
  for (i = 16; i < 32; i++)
  {
   if(i<=18)
     Wire.write(NDEF_DATA[i]); //Fill Block with Data
   else
     Wire.write(0x00); //Fill Block with Data
  }
  Wire.endTransmission();
  delay(50);

 

  Serial.println("Start wrting");
  delay(100);

 


}
void loop()
{
 
 
}

 

void Wipe_Tag()
{
  for (i = 1; i < 50; i++)
  {
    Wire.beginTransmission(ADDR);
    Wire.write(i);
    
    for (j = 0; j < 16; j++)
    {
     Wire.write(0x00); //Fill Block with Zeros
    }
    
    Wire.endTransmission();
    delay(50); //Delay 50 ms
 
  }
}

 

All I get is the right UUID than nothing happened, if I try to put my phone I can't read nothing ( it should send me to mikroe website).

 

As I'm using the nfc 2 click from mikroe.

 

Thanks for reading.

Outcomes