Texas Instruments RFID reader - getting serial data

Hi all,

I'm very new to arduino, so please excuse any silly comments or mistakes below!

I'm trying to use an arduino uno as a datalogger - I want it to read serial data coming from a Texas Instruments RFID reader and log it to a file.
I have an arduino uno, with a sparkfun microSD shield (SparkFun microSD Shield - DEV-12761 - SparkFun Electronics), and am using a sparkfun max3232 breakout (SparkFun Transceiver Breakout - MAX3232 - BOB-11189 - SparkFun Electronics)

I'm connecting the max3232 breakout to the RX and TX pins, and initially am looking at using SerialEvent to do this. Connected to my PC via USB (with the RX and TX pins connecting to the max3232 on the arduino unplugged) and using the arduino serial monitor to send text, it works great and things are logged to the SD card. Connected to my PC via the serial port I've wired to the max3232 also works fine

My code is below

#include <SD.h>

// SPI settings
// MOSI, MISO, SCLK set by default
// CS = ChipSelect
// pow_pin = power for SD card shield
int CS_pin = 8;
int pow_pin = 10;

String inputString = "";          // a string to hold incoming data
boolean stringComplete = false;   // whether the string is complete



void setup()
{
  Serial.begin(9600);
  inputString.reserve(200);
   
  Serial.println("Initializing card");
  // CS Pin as output
  pinMode(CS_pin, OUTPUT);
 
  // power PIN for SD card
  pinMode(pow_pin, OUTPUT);
  digitalWrite(pow_pin, HIGH);
  
  // Check if card is ready
  if(!SD.begin(CS_pin))
  {
    Serial.println("Card failed");
    return; // return ends the program right here!
  }
  Serial.println("Card ready"); 

  // open the log file 
  // if you don't specify FILE_WRITE it will open the file read-only
}
void loop()
{

  
  // print the string when a newline arrives:
  if (stringComplete) {
    Serial.println(inputString);
    File logFile = SD.open("log.txt", FILE_WRITE); // open the log file
    logFile.println(inputString);
    logFile.close();
    // clear the string:
    inputString = "";
    stringComplete = false;
  }
}

void serialEvent() {
  while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read(); 
    // add it to the inputString:
    inputString += inChar;
    // if the incoming character is a newline, set a flag
    // so the main loop can do something about it:
    if (inChar == '\n') {
      stringComplete = true;
    } 
  }
}

The problem is, when I connect the serial port to the TI RFID reader, I get absolutely nothing!! written to the SD card

Connecting the RFID reader to my PC, and using serial port settings 9600-8-1-N everything works fine. Here is an example of what it spits out

LI
LI
LI
LI
LI
LI
LI
LI
LI
LI
LR 0113 0379091200509523
LR 0113 0379091200509523
LR 0113 0379091200509523
LR 0113 0379091200509523
LR 0113 0379091200509523
LR 0113 0379091200509523
LR 0113 0379091200509523
LR 0113 0379091200509523
LR 0113 0379091200509523

LI just seems to be a default, the LR lines are actual reads of a RFID tag

Can anyone help me out? I'm really not sure what to do from here :frowning:

Thanks!
Dylan

Sorry I've had to edit this as I was wrong - having talked to the person I'm trying to do this for, we can change the configuration of the RFID reader - so it now has flow control disabled.

I'm still not getting any data from the RFID module :frowning:
To test my max3232 I set it up as a softwareserial and used this example code to talk between my serial ports: http://arduino.cc/en/Tutorial/SoftwareSerialExample
This works as expected :slight_smile:

On my max3232 breakout I have:
T1Out -> PIN2 of a male serial port
R2In -> PIN3
GND -> PIN5

Then on the arduino side
T1In -> PIN7
R1Out -> PIN8

(in the softwareserial example I linked to above I've edited the code like this:

SoftwareSerial mySerial(6, 7); // RX, TX

Hi there Dylan, did you note this...

"If you want to run the Control module in a 3-wire connection (RXD, TXD, and GND), without remote
controlled activation, Jumper 5 (JP5) must be closed. This connects DSR and DTR together."

Just to be sure you do have the module configured correctly for 3 wire operation, it would be a good idea to isolate all other signals electrically and try again with the pc to make sure the module is in fact configured correctly for operation in this mode.

Hi Dale,

thanks for your reply. Yes I had noted that and jumper 5 is closed.

I have made a 3 wire serial cable, so there are only 3 wires connecting the reader to the serial port of the PC - is this what you mean by isolating all other signals?

Thanks again
Dylan

What reader are you using?

Hi,

I'm using an S2000 reader - RI-CTL-MB2B-30 + RI-RFM-008B-30
(the S2000 is a combination of the two modules listed)

Dylan

I'm using an S2000 reader - RI-CTL-MB2B-30 + RI-RFM-008B-30
(the S2000 is a combination of the two modules listed)

You want US to google that for you. I'll pass.

Hi Paul,

sorry I thought I had actually included the link to the PDF for the module in question further up, as it turns out I haven't! My mistake - here it is!

I don't expect anyone to google anything for me, what a strange reply :slight_smile:

So, that device appears to be an RS232C device. RS232C devices are not compatible with TTL serial data. You need a MAX232 chip, or equivalent, between the Arduino and the RFID device, before you destroy your Arduino.

Hello dylanbaars.... how did your project finish up with the union of Arduino and the TI Reader.

I have an interest in doing something similar.

Kind Regards
Ray