1

Good day, I have this problem with my simple project. I have a database with all RFID number of employee. What I want to do is to use an rfID to check if it is registered in the database. If it is, it would return a value of 1 else would be a value of 0.

I tried with arduino HanRun Ethernet shield. I was able to get a response from the php web server to the serial monitor. Tried the seeedrfid it successfully get the rfcard number. However, when i tried to combine the two, it would hang on Ethernet.begin(mac, ip) initialization. My code is below.

#include <Ethernet.h>
#include <SoftwareSerial.h>
#include <SeeedRFID.h>
#define RFID_RX_PIN 10
#define RFID_TX_PIN 11
SeeedRFID RFID(RFID_RX_PIN, RFID_TX_PIN);
char state = '0';
char c;
byte mac[] = {0x60, 0xF8, 0x1D, 0xBA, 0x1D, 0x52};
IPAddress ip(192, 168, 20, 228);
EthernetClient client;
void setup() {
 // put your setup code here, to run once:
 Serial.begin(9600);
 Serial.println("Serial set up");
 Ethernet.begin(mac, ip);
 Serial.print("My IP Address: ");
 Serial.println(Ethernet.localIP());
}
void loop() {
 long rfID;
 // put your main code here, to run repeatedly:
 if (RFID.isAvailable()) {
 rfID = RFID.cardNumber();
 Serial.println(rfID);
 }
}

Serial.println(rfID) is not executed unless I remove the Ethernet.begin(mac, ip). Can anybody point me to the right direction?

asked Aug 23, 2017 at 7:47
2
  • It's NOT a HanRun Ethernet Shield! It's an unbranded Ethernet Shield happens to use a HanRun HR911105A RJ45 Socket with Integrated Magnetics on it. kosmodrom.com.ua/pdf/HR911105A.pdf Commented Aug 23, 2017 at 10:02
  • What pins did you connect the RFIC board to? Commented Aug 25, 2017 at 15:02

1 Answer 1

1

The Arduino Ethernet shield uses pins 4, 10,11,12,13. You have a conflict with the RFID pins.

Avamander
6242 gold badges11 silver badges35 bronze badges
answered Aug 25, 2017 at 14:32
3
  • SPI pins can overlap, SS should be independent. There's not too much info about the chipset used though. Commented Aug 25, 2017 at 15:01
  • can they overlap with software serial RX/TX? Commented Aug 26, 2017 at 5:08
  • 1
    SPI can't overlap with softserial. Commented Aug 26, 2017 at 11:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.