I have connected my RFID reader with Arduino using max232 via RS232 cable. My rfid reader in timing work mode so it will send automatically data to arduino. but the data is not in readable form. I have checked my max232 circuit using my computer its working fine. Also that data in readable format when i have connected my RFID reader with my system using RS232 circuit and MAX232 buffer. Please reply as soon as possible.
manigandavenkatesh:
I have connected my RFID reader with Arduino using max232 via RS232 cable. My rfid reader in timing work mode so it will send automatically data to arduino. but the data is not in readable form. I have checked my max232 circuit using my computer its working fine. Also that data in readable format when i have connected my RFID reader with my system using RS232 circuit and MAX232 buffer. Please reply as soon as possible.
Have you set the receiving baud rate in Arduino to match that of the RFID reader, and also the baud rate in the serial monitor to match the Arduino's serial transmission baud rate?
We can't help if you don't show us your code. And please post it between code tags, not inline. (The </> button in the "Reply" window.)
my baud rates are all same. I am getting the data from max232 buffer. Also I am checking the data by two ports. In direct connection of the pc from RFID is ok. but the rfid to arduino is not ok.
my coding is:
#include<SoftwareSerial.h>
SoftwareSerial gtSerial(13, 12);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
gtSerial.begin(115200);
}
void loop()
{
if (gtSerial.available())
{
//gtSerial.println(str);
String str="";
while(gtSerial.available())
{
char t= gtSerial.read();
str=str+t;
}
Serial.println(str);
delay(10);
//gtSerial.print(str);
//delay(100);
gtSerial.end();
gtSerial.begin(115200);
}
}
As I suggested, you must post code between code tags, not inline:-
You really should have read the How to use this forum - please read post at the top of the index page and How to use this forum before posting.
ie Your code and any error messages should always be placed between code tags. Posting it inline as you have done makes it much harder to read or copy and paste for diagnosis.
It's still not too late to edit your post and do this. You'll make potential helpers much happier.
Please try it at know
A baud rate of 115200 sounds very high for an RFID reader. Are you sure this is correct?
manigandavenkatesh:
Please try it at know
No idea what those words mean.
Here's the image attached to the top post so others don't have to download the image to view it.
Do you have a link to the RFID reader you're using?
@manigandavenkatesh, thanks for adding the code tags.
Closing and re-opening the SoftwareSerial port shouldn't be necessary, but it shouldn't stop your code from working. Since you say you've independently tested your MAX232 circuit, I'm at a loss if the baud rate is correct.
Also if you hadn't said that you can read it directly on the PC, I would have suggested that it might be encrypted. (It doesn't appear to be totally random garbage.)
Maybe someone else will have an idea.
the baud rate is same only.
may be encryption problem.
may be encryption problem.
No it is not.
Please cooperate with the questions asked of you otherwise all we can do is guess.
So post a link to your RFID reader
manigandavenkatesh:
I have connected my RFID reader with Arduino using max232 via RS232 cable. My rfid reader in timing work mode so it will send automatically data to arduino. but the data is not in readable form.
OK
manigandavenkatesh:
I have checked my max232 circuit using my computer its working fine.
How? What did you connect to what? Computer serial port -> serial cable -> max232 -> arduino? Or computer serial port -> serial cable -> max232 and connect the input and output of the max232 (loopback test)? Or ...
manigandavenkatesh:
Also that data in readable format when i have connected my RFID reader with my system using RS232 circuit and MAX232 buffer.
Which system? Your computer? What is RS232 circuit?
My first interpretation of this latest part is that you need a MAX232 to communicate from the reader to computer's serial port. If that is the case, your reader does not use RS232 levels; in which case you don't need the MAX232 when you connect the reader to the Arduino.
But as the others said, please provide the link to the reader.
And clarify the tests that you did with a little more detail.
Note:
There is no encryption if you can read the data from the reader if it's directly connected to the serial port of the computer (as you described) and use a program like hyperterm or putty (on windows) or minicom (on linux).
My rfid reader direct link below:
Have you read the data sheet about communication with this device?
It is attached.
You will see the default baud rate is 9600 and on encountering an error it defaults back to that speed.
You will also see that the data format is not in a simple ASCII form that your code expects. Also you are not sending any command frames at all with your code.
When you say it works when connected to a computer I suspect that you are using some sort of program that will convert the data into a viewable form.