Simultaneous RFID Tag Reader and Particle Photon

I’m attempting to use the Simultaneous RFID Tag Reader with a Particle Photon. If you’re unfamiliar, the particle photon is microcontroller board that is arduino-like with hardware UART pins.

Software documentation for this board can be found here:

https://docs.particle.io/reference/devi … re/photon/

Hardware datasheets can be found here:

https://docs.particle.io/datasheets/wi- … datasheet/

I’ve successfully compiled and ran the arduino library on particle (Particle has done extensive work to make arduino libraries compatible with their platform) but I run into issues at run time when sending commands. With debugging turned on, I get ‘Incomplete response’ or ‘Response timeout’ errors with all commands over a range of baudrates using the ‘Example1_HardwareSerial_Constant_Read.ino’ sketch.

My hardware configuration is as follows:

-Sparkfun RFID board is powered by an external bench supply set at 5v, which is connected through a 3.5mm screwdown connector on the provided footprint

-Photon is powered by an onboard usb and the ground pin is connected to the ground of the power supply

-The RX/TX pins on the photon are jumpered over to TX/RX pins on the Sparkfun board that would normally attach through the ‘Hat’ stacking headers

-Hardware/Software switch is set to HW-UART

-Using internal antenna

Is there anything obvious in my configuration that would cause the issues I’ve seen?

What logic level are the RX/TX pins expecting on the Sparkfun board? Would a mismatch here cause these issue?

Are there other pins, other than RX/TX, that are necessary to connect on the sparkfun board?

I normally only use 4 wires with the switch to hardware:

GND to GND

VCC to VUSB (this is enough power to connect the board, but not enough when reading orwriting a tag)

TX to RX

RX to TX

Even on a “slow” processor (like an 32U4) it will connect on 38400.

You will have to use Serial1 and try to use 9600 on the Nano connection.

Maybe the photon does not like the 5V signal from the Nano and then try making a voltage bridge to 3V3 for the photon RX line with resistors 10K and 4K7.

A level converter will not work, as the Nano already has a level converter and 2 converters after each other is just asking for trouble.

After you fixed the connection, please be aware that the Serial1 on the Photon only seems to have a hard coded receive buffer of 64 bytes… that will fill up quickly in continuous read.

Thanks so much for your quick reply.

It sounds connections were find because I have the RX/TX configured as stated and I’m definitely getting power through the 3.5mm terminal as I get the power light on and have gotten it working with this power config with the Universal Reader Assistant.

The photon supposedly has a more powerful processor than ardunio, so I’m not too concerned with high baudrates, but will test at 38400 as you suggested.

I was already testing with Serial1 as you suggested, but was unaware of the buffer limitations, so I’ll look into that.

The logic levels will now be my main focus for testing, I’ll start by voltage dividing down from 5v to 3.3v on the Nano-to-Photon line, and probably next boost 3.3v to 5v on the Photon-to-Nano line. On the note of level converters, thanks for the heads up about the built in one, didn’t know that was the case and didn’t know doubling them up can cause issues.

A question for my curiosity’s sake, what is the issue with doubling up level converters?

HI

To the remark of double level converters… I tried that on multiple devices, including the Nano … they all failed. I also have an ESP32 to which I connected the Nano. With a level converter it did not work. I then made a voltage bridge with resistors… perfect !! It seems it has to do with enough current flowing through the FET’s to allow the next converter (also based on FET) to work correctly. Have not done the in-depth investigation why… but the (practical) experience proved enough the point for me to share.

Another aspect you could try in the library, in SparkFun_UHF_RFID_Reader.cpp, routine sendCommand(), around line 810 just after msg[spot] = _nanoSerial->read(); put a line DPRINTLN(msg[spot], HEX); It will show the real bytes that are received from the Nano before indicating it is incomplete or timed up. Share that as it maybe it can help to diagnose

Huh interesting stuff on the level converters front, I have more of a CSE background than an EE. So those kind of things are not always immediately intuitive to me, but your explaination clarified enough for me.

That’s a great suggestion on debugging, I’ll go ahead and make that change now. Should have some results in the next hour or less, so wish me luck!

After testing with the voltage divider, I get no response on all commands. Leading me to believe it was originally at a reasonable logic level for the Photon and the voltage divider actually dropped it too low.

The extra debugging line has yeilded more data as to what is going on, though I’m not sure if I can interpret it correctly. It is still getting incomplete or corrupt responses according to the debugger.

On another, probably unrelated note. I’m using the Universal Reader Assistant and I’m only getting a read distance of an inch or two.

Share some of the data you got with the extra debugging line. Ihave studied that in detail and know what to expect. The first 20 lines could be enough, maybe on an personal message. When connected the URA you can increase the read power to get stronger signal. That said, you might need a strong power-supply for that.

Paulvha and I took this into a long thread of PMs and have come out successful. You can indeed use the RFID Reader and Particle Photon together over HW-UART with the existing Arduino library and the Hardware Example Sketch.

The configuration that ended up working was as follows:

-Used the ‘Serial’ pins on the top of the board, not the RX/TX pins that the hat would connect to.

-Matched the Output (Serial) and Nano Connection (Serial1) at a 115200 baudrate (not sure if there is some restriction on the photon to match baudrates, but hey it works).

-Powered RFID Board and Photon off of a idling arduino powered with a barrel connector.

I’m sure there are other, more intuitive and flexible, configurations that would work for the power and serial lines, but this is what worked for me in the end. I’d like to express appreciation to Paulvha for his significant time and insight contribution to get this working, as well as the SparkFun forum community. If you’re attempting to the same or similar connection feel free to reach out here or to me directly and I’d be willing to share what I’ve learned.