How can ? use arduino with this module. I can not communicate with this module. I want to read my rfid cards and monitor card number on serial monitor.
How can ? write arduino code ? I am not have enough information about arduino programming. II waiting yours best reply.
Connect GND, VCC, RXD, and TXD to Gnd, 5V, RX (Pin 0), and TX (Pin 1) on the Arduino. Connect RESET pin on Arduino to Gnd pin on Arduino. Start Serial Monitor and switch to 9600 baud. Anything you type will go to the RFID reader. Anything the RFID reader sends will appear on the Serial Monitor.
MarkT:
You don't mean this bit: "Connect RESET pin on Arduino to Gnd pin on Arduino" ... Perhaps connect RESET on the RFID module to GND?
If you check what I said you'll see that it will work. Holding Reset low will disconnect the ATmega from the RX and TX lines so the PC and talk to the RFID module directly. It also eliminates the possibility of an incorrectly programmed sketch.
Ok. Thanks for reply.
I new user of arduino so how can change my program for read rfid card number ?
My rfid have for pins 5V, GND, RX and TX. I connected 5V, GND. And ? connected RFid RX pin to arduino mega TX1 pin18 and RFid TX pin to arduino RX1 pin 19.
RFid Manual :: Send : AB 02 02 and RFid must return AB 06 02 DE CE C9 61
I try it but nothing return from rfid. I thing ? program my arduino wrong. So how can test my rfid with my arduino mega.
On RFid tree led has. One led is stat it is on always. One led is card When ? show card it is on. Last led is mode led. ?t is off always so rfid is in basic command mode.
My Last Code is;
#include "SoftwareSerial.h"
#define txPin 22
#define rxPin 24
SoftwareSerial RFID(rxPin, txPin);
void setup()
{
Serial.begin(9600);
RFID.begin(9600);
pinMode(txPin, OUTPUT); //pin 22
pinMode(rxPin, INPUT); //pin 24
Serial.println("Seriport Menu");
Serial.println("a - Test Menu");
Serial.println("b - Read card");
Serial.println("");
delay(2000); // RFID wait time:
}
void loop() {
if (Serial.available() > 0) {
char incomingByte = Serial.read();
switch (incomingByte) {
case 'a': // if user enters 'a' show test print
Serial.print("Test menu....");
break;
case 'b': // if user enters 'b' start card reading
Serial.print("Card Reading Started");
RFID.write(0xAB);
RFID.write(0x02);
RFID.write(0x02);
if (RFID.available()>0)
{
Serial.print("Card number is:");
Serial.print(RFID.read(), HEX);
Serial.println(" ");
}
break;
}
}
}
But it is not work. I can not see anything on serial mon?tor.
You're still using software serial, on a pins that can't be used for that purpose on a Mega. As it says on the SoftwareSerial reference page:
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
Move your RFID reader to one of the other hardware serial ports, RX1/TX1 for example.
void setup()
{
Serial.begin(9600);
Serial2.begin(9600);
Serial.println("Seriport Menu");
Serial.println("a - TEST MENU");
Serial.println("b - CARD READ");
Serial.println("");
delay(2000); //
}
void loop() {
if (Serial.available() > 0) {
char incomingByte = Serial.read();
switch (incomingByte) {
case 'a': // if user enters 'a' then store tag number
Serial.print("TEST MENU");
break;
case 'b': // if user enters 'a' then store tag number
Serial.println("CARD RETURN:");
Serial2.write(0xAB);
Serial2.write(0x02);
Serial2.write(0x02);
if (Serial2.available()>0)
{
Serial.print(Serial2.read(), HEX);
Serial.print(Serial2.read(), HEX);
}
break;
}
}
}
It is work but not right work. When reiceve only 2AB. But after send AB 02 02 ; RFid must be return AB 06 02 DE CE C9 61 and ? must take rfid returns. Where is my code mistake ? How can ? take rfid return sentence ?