Hello!
I'm bulding a system using an Arduino UNO to read the identification code and temperature in the tags "Biotherm 13 Pit Tag". The RFID Reader I have is this one.
Using the following code I was already able to read the identification code of 15 characters, but the tags are also supposed to send additional information related to the temperature.
#include <SoftwareSerial.h>
const byte rxPin = 4;
const byte txPin = 5;
char c;
String code = "";
SoftwareSerial RFID(rxPin, txPin); //rx, tx
void setup() {
Serial.begin(9600);
RFID.begin(9600);
Serial.println("Communication has started");
}
void loop() {
if (RFID.available() > 0) {
c = RFID.read();
//Last characters were reached
if (c == '\r') {
Serial.print("\n");
Serial.println("Code: " + code);
Serial.println("Tag Detected: " + returnTagName(code));
}
//The code ends with a \n
else if (c == '\n')
code = "";
//Add the new character to the code
else {
code = code + c;
}
}
}
//Returns the name of the tag
String returnTagName(String code) {
if (code == "989001025046146") {
return "Tag 1";
}
else if (code == "989001025046156") {
return "Tag 2";
}
else if (code == "989001025045056") {
return "Tag 3";
}
else {
return "Unknown Tag";
}
}
For example, if I use a PIT Reader from Biotherm, like this one the temperature is read.
So my question is why isn't the temperature information being read in the Arduino. Do I need a different RFID Reader?
The information that is printed in the Serial Monitor can be seen in the image below.
