RFID PN5180 Sensor Issues

So last year I made a Halloween dark ride using an Arduino Uno with a Sabretooth 2x32 motor driver, powering two mobility scooter motors. The motors pulled the cart along a track through the spooky ride.

I also used a nRF24L01 transceiver connecting a remote device to the cart's Uno for dispatch, emergency stop, etc. Finally, I used a levered limit switch to change speeds when it hit a marker on the track. Long story short, the limit switch was not as reliable as I would like. After trying some other options I liked the idea of using a long range RFID reader. I settled on the PN5180 which does quite well however, the sensor is very new to me and support is limited.

I got the RFID sensor to work, but have not been able to share the SPI connection with the nRF24L01. So far I have shared the SCK, MISO, and MOSI lines between the PN5180 and nRF24L01 (pins 11,12,13). Still I have had no luck. I could use some help on this. Like I said, both devices work independently, but fail when combined (leading me to believe it is a software issue rather than hardware):


#include <Servo.h>
#include <USBSabertooth.h>
USBSabertoothSerial C; 
USBSabertooth ST(C, 128); 

#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>

#include <PN5180.h>
#include <PN5180ISO15693.h>

#define PN5180_NSS  6
#define PN5180_BUSY 5
#define PN5180_RST  7

PN5180ISO15693 nfc(PN5180_NSS, PN5180_BUSY, PN5180_RST);

uint8_t correctSpeed1Uid[8] = {0x86,0x3D,0xE5,0x88,0x0,0x1,0x4,0xE0}; // Tag 2
uint8_t correctSpeed2Uid[8] = {0xEF,0x5B,0xE5,0x88,0x0,0x1,0x4,0xE0}; // Tag 3
uint8_t correctSpeed3Uid[8] = {0x22,0x6E,0xE5,0x88,0x0,0x1,0x4,0xE0}; // Tag 4
uint8_t correctSpeed4Uid[8] = {0x16,0x2C,0xE5,0x88,0x0,0x1,0x4,0xE0}; // Tag 5
uint8_t correctSpeed5Uid[8] = {0x37,0x7B,0xE5,0x88,0x0,0x1,0x4,0xE0}; // Tag 6
uint8_t correctSpeed6Uid[8] = {0x89,0x87,0xE5,0x88,0x0,0x1,0x4,0xE0}; // Tag 7

uint8_t thisUid[8];     

RF24 radio(9, 8); // CE, CSN
RF24Network network(radio);

const uint16_t remote_node = 01;  // Slave
const uint16_t cart_node = 00; // Master
const uint16_t signal_node = 02;  // Slave 

int button_send[3];
int signal_send[4];

int dispatch_state = 0;
int dispatch_new;
int dispatch_old = 0;

int estop = 0;
int ereturn = 0;

int zone_signal = 0;
int e_state = 1;
int zone = 0;
int last_zone = 0;
int dt = 200;

int current_speed = 0;
int last_speed = 0;
int ramp;
int ramp_speed;
int ramp_time;

int wifi_signal = 1;
int estop_signal = 0;
int dispatch_signal = 1;
int operating_signal = 0;


//*************************** SETUP *********************************


void setup() {
  Serial.print(9600);
   
   SabertoothTXPinSerial.begin(9600);
  
//**** Radio *****
   SPI.begin();
   radio.begin();
   network.begin(90, cart_node);  //(channel, node address)
   radio.setDataRate(RF24_2MBPS);

//**** PN5180 *****
   Serial.print("Reader #");
   Serial.println(F("Initialising..."));
   nfc.begin(); 
   Serial.println(F("Resetting..."));
   nfc.reset(); 
   Serial.println(F("Enabling RF field..."));
   nfc.setupRF();
   Serial.println(F("Setup Complete")); Serial.println();

}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.