SparkFun Forums 

Where electronics enthusiasts find answers.

Questions &/or issues related to products in the Distance & Infrared category should be posted in this forum.
Three questions regarding the Simultaneous RFID Reader and its accoutrements, when said reader is set up to be a shield for an Arduino, and an external UHF antenna is attached.

Question 1: Simultaneous RFID Reader

Our old friend, that is, getting stuck on "Press a key to begin scanning for tags", is back. (See viewtopic.php?f=118&t=50555.) Any fresh insights would be much appreciated.

In addition to that, I've found another bug. The device which I'm building has two antennae, each with its own Arduino. These Arduinos are then plugged into an Ubuntu machine, which interrogates the two antennae by reading the serials that the two Arduinos put out. At the moment, I've got the Arduino for Antenna A writing to a serial with a baud rate of 115200, and the Arduino for Antenna B writing to a serial with a baud rate of 57600. So the code running on the two Arduinos (see ... OcISyoy-Fq) is identical, except that a baud rate of 57600 is used on the Arduino connected to Antenna B.

Now this is the fault: when I fire up the Arduino connected to Antenna B, and have a look at the Arduino IDE's serial monitor, I usually - more than 50% of the time - find the message, "Module failed to respond. Please check wiring." I've checked the wiring a number times, often with someone else present, and neither of can find any obvious problem with the wiring. However, the following trick has never failed to resolve the problem: 1) I upload the code corresponding to Antenna A instead; 2) At this point, the Arduino works normally, except that it's set up for the wrong baud rate; 3) I then re-upload the code corresponding to Antenna B; 4) The Arduino works perfectly hereafter, until it's switched off for longer than a few seconds.

At this point you may be thinking, If he knows how to solve the problem, why is he pestering us? The issue is that the next stage in the product's development is to allow it to start up and run without any human intervention. Thus I need to work out a way to get the equipment to start up correctly the first time, every time, and without any arcane rituals being performed. Any ideas?

Question 2: UHF Antenna

The product I'm developing is for an agri-tech project. Hence I was wondering, do you sell/would you be able to recommend/do you have any ideas regarding an ultra tough version of your UHF antenna? Ultra tough in this context means that it could be strapped to the side of a tractor and survive having potatoes, planks of wood, etc thrown at it at the same speed as a tractor travels.

Question 3: RedBoard

Is it possible to customise a RedBoard's serial number, or to order a RedBoard with a custom serial number? I ask because, as part of the product discussed above, the Ubuntu machine has to manage a whole fleet of USB devices, and thus being able to rely on a given format for the Arduinos' serial numbers would make things a lot simpler.


Sorry for such a long post, but you guys have never yet let me down!
A replay to Question 1:
In SetupNano() you have to the following :

if(ANTENNA_A) softSerial.begin(BAUD_A);
else if(ANTENNA_B) softSerial.begin(BAUD_B);
else softSerial.begin(BAUD_A);

This is NOT correct as BAUD_A and BAUD_B reflect the Serial Connection (Ubuntu to Arduino) not the connection Nano to Arduino. in SetupNano() it should set the connection speed to 115K for a moment, softSerial.begin(115200), and then sent the new (BPS) speed, then reset the softSerial back to BPS- defined speed. The BAUD_A happens to be 115200, BAUD_B 57600. Once you had loaed for BAUD_A, the connect is set to the right speed, until it is rebooted.
Question 3:
Not sure the serial number can be done. Sparkfun has to answer, but there could be another way. As part of setup(), where it now reads :

Serial.println(F("|Press a key to begin scanning for tags."));

you could decide either sent a user defined identity number to Ubuntu as part of the print/println or read the serial line input and check for the request to send that identity-number
Hi Tom.

On question 3, if you're using a RedBoard like part number DEV-13975 that uses a FTDI USB to serial converter chip, FTDI has a utility called FT-PROG that allows you to modify the serial number in the FTDI chip. (By default they are auto generated by FTDI) We can't assist with programming custom serial numbers but the FTDI utility might be helpful for this.

Just be careful with the FT-PROG utility as it's possible to brick a chip with it if you write invalid settings.
Thank you both for your helpful remarks.

Regarding Question 1: obviously, just
Code: Select all
on its own will do the trick for antenna A. Are you suggesting uploading something like the following onto antenna B's Arduino?
Code: Select all
#define ANTENNA_A false
#define ANTENNA_B true
#define INITIAL_BAUD 115200
#define BAUD_A 115200
#define BAUD_B 57600

void setup()

  if(setupNano(BPS) == false)
    Serial.println(F("|Module failed to respond. Please check wiring."));


  if(ANTENNA_A == true) Serial.begin(BAUD_A);
  else if(ANTENNA_B == true) Serial.begin(BAUD_B);
  else Serial.begin(BAUD_A);
Would that work?
Regarding Question 2:

I've been having a look at whip antennae. Something that would bend, rather than break, when it meets an immovable object. In principle, can *any* UHF antenna be connected to SparkFun's Simultaneous RFID Reader? Or does it have to be the antenna which SparkFun sells?

Regarding Question 3:

The FT-PROG looks like the way to go. I'm waiting for some more parts to arrive from SparkFun. Once they're here, I'll try out that suggestion.
with respect to Question1:
you keep mixing serial (between ubuntu and redboard) and softserial(between Nano and redboard). Use BAUD_A and BAUD_B only for serial. BTW NOT sure why ONE is 115200 and the other is 57600 as both could the same , but that is your choice. For softserial, if it does not connect due to speed, set the softserial.begin (115200) then sent the required speed command to the Nano followed by setting Softserial to the required speed of the Nano. (as it is in the original example)
Ah yes. I see the source of the confusion now... Okay, I'm happy with how to fix the code.

I need two different baud rates because I have two different antennae - each with its own Arduino-reader, because the Simultaneous RFID Reader can only have one antenna attached to it - which are feeding data to one Ubuntu machine simultaneously. I've been told that having Antenna A and Antenna B feeding data to the same machine over the same baud rate will cause outbreaks of lice and boils, toads and locusts to multiply, rivers to run blood red, and the sky to darken at noon. However, given such dire warnings, I've never actually tried doing it myself; so I'm happy to be corrected on that point.
hahahaha.. was that from a twitter message from a certain person from a large continent ??... just kidding.. I can't see that being an issue. It all comes down to processor speed to read/transfer/store the information and enough buffersize to hold the EPC data that has not been transfered/stored. The Nano speed is slower than the Ubuntu connection speed is either case. If the program on Ubuntu is reading the data fast enough, the softserial buffer on the Redboard should not overrun with EPC data. You could consider to increase the softserial buffer size (in SoftSerial.h) otherwise