I am trying to communicate with an RFID reader via its serial port. The serial port has an RS232 connector on it. I also want to display the RFID tags ID on a 16x2 LCD screen using an Arduino.
I, therefore, purchased an RS-232 to TTL converter (shown below).
I connected an RS-232 cable from the reader to the converter (male to male RS-232 cable) and then to my Arduino Nano. I connected TX (RS-232 converter) to RX (Arduino) and RX (RS-232 converter) to TX (Arduino).
After uploaded a simply sketch:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(5, 6); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// set the data rate for the SoftwareSerial port
mySerial.begin(115200);
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}
The code is not mine, it is an example sketch from Arduino. I set the baud rate as per the RFID reader's settings, which was 115200.
After connecting everything, I then opened up the serial monitor and set the correct baud rate. However, no info was sent to the monitor. I also got a Serial to the USB connector. I connected this cable to the reader and then to my PC USB input (no Arduino). I tested the serial connection with this cable and opened up the serial monitor, set the COM port and baud rate. The serial monitor started to display the correct data.
After investigating the RS-232 cable (male to male RS-232 cable) I noticed the DCD (Data Carrier Detect) and the RX pin of the RS-232 was shorted (I tested with the continuity tester from my multimeter). Could this be the reason why no data is been displayed?
Update: