It has an Arduino library, but haven’t seen an existing port in the Particle libraries. It seems to compile fine with the simple ‘Particle.h’ header adjustment but haven’t gotten it functional.
It communicates over serial connection and supports both HW-UART or SW-UART but I’ve only tried HW so far. The issue lies in the receiving of serial responses to the commands I’ve sent.
So if anyone has experience with this device and/or using/porting arduino serial based libraries on a particle device, I’d greatly appreciate the help.
I haven’t used this device - but perhaps some suggestions for trouble shooting, if I may:
NB: This reader and an UNO are 5V devices - so don’t use on GEN3 unless you have a level shifter in between
It also consume a lot of power - so make sure your supply is big enough - normal USB power might not be enough based on the technical documents.
Have you tried with an Arduino board (Uno or similar) - this will allow you to validate that the reader is functional and that the library works.
If you have access to a logic analyser - you could attach to the serial i/o and see what its being sent/received. Other wise modify the library to print to Serial when it sends or receives something?
However why not post some code and perhaps someone can contribute better suggestions?
I’ll be posting some code shortly, but in the meantime:
I’ve thought about logic shifting or voltage dividing but shouldn’t it theoretically work natively? With 5v tolerant pins on a photon, it shouldn’t be hurt and the logic HIGH signals should be more than enough to trigger the gate. On the reverse end, generally a 3.3v logic HIGH is enough to trigger a 5v gate’s 2.2(ish) threshold. Not saying its not a bad idea to try, but curious as to why that may be necessary.
On the point of using a Arduino, I got one in the mail today so I will be trying out the reader as they intend it to be used to see if that reveals anything. But I have already used the ‘Universal Reader’ software on a PC and tested and it works reasonably well.
I wish I had a logic analyzer but I do not. I will, however, be putting together a test suite where the Arduino and Photon will talk over Serial connection in an attempt to be able to do this analysis.
@rkast4321, as you had only specified “a Particle device” in your post, @shanevanj was stating that you couldn’t use a GEN3 device due to the voltage incompatibilities. As you indicated, using a Photon IS possible for reasons you stated. His concerns regarding power are still valid however.
You didn't mention photon originally so a warning is always not a bad idea....
You could connect the arduino up and run softSerial to "snoop" on the serial traffic and print it to the usb serial so you can see what's traversing between the two ...
Sorry, thought I had specified a Photon, my bad. But I do have a few GEN3 devices and didn’t know about that incompatibility, so good info either way.
I’ll be posting code then running the softSerial test on an arduino in a little bit to see what I can find there. Also I may try out the SoftSerial library for Photon and see if that changes anything
@rkast4321, looking at the library for this device, I believe it should work as-is with the Photon. The choice of hardware or software serial is done in the user code. I suggest you use the hardware serial Serial1 port (TX/RX pins) on the Photon and refer to the hardware serial examples in the library.
The serial port is referenced as inherited “Stream” class (Serial1 is a child of this class). I have to test if passing the Serial1 object in the nano.begin() call works with the Particle code. If not, it will require minor fixes.
That’s been my software configuration so far. With your comments, I’m becoming increasingly confident that my issue relies somewhere in my hardware configuration, namely the power connection. I’ll will still be posting code shortly, to make sure I didn’t mess anything up there.
I appreciate, as always, the dedication you guys put into helping people learn and develop in this avid and active community.
Got delayed trying to find a mini-usb cable to power the arduino. But after hooking it all up via stackable headers and running the ‘Example1_Constant_Read’, the RFID board seems to be functioning correctly. I will rerun my Photon tests now.
Ok, after swapping around connections and trying different baudrates, I have gotten it working with the Photon.
The working configuration was as follows:
-Use the ‘Non-hat’ Serial connector pins on the RFID reader board
-Matching the Serial/Serial1 baudrates at 115200
-Power RFID Board and Photon off the 5v/GND pins of the idling Arduino with barrel power connector.
Not sure exactly which of those changes made the difference but likely a combination of them. I suspect that some of my other wiring configs may have worked but it’s possible I hurt those pins in my testing and/or soldering process.
I am trying to configure the same setup here. I have a Particle Boron which I am using to talk to SRTR. I built the Arduino library on Particle Web IDE successfully and was able to download/run “HardwareSerial_Constant_Read” example. But I am getting a “Time out 2: Incomplete response” message. I am wondering if my HW connections are correct.
I am powering SRTR via Li-Po 3.7 battery using the RST header (top-right corner). I have set the board to “HW-UART” via the dip-switch (bottom-right). I have connected the RX/TX lines (next to the dip-switch) on SRTR with the TX/TX lines on the Particle Boron. I am powering Boron via USB. So, I am guessing, my 2 boards do not have a common ground that is why the communication is messed up.
I went through a variety of different power sources. Bench power supply for both, usb for the photon, and eventually to a 5v/2amp capable barrel-jack style power supply. So I suspect as long as both devices have their power light on then your solution will work.
You will definitely need to tie them to a common ground, so I would just wire the Boron’s GND pin to one of the GND pins on the SRTR.
I would also try playing around with different Baud Rates, while I was debugging my setup I ended up tweaking this and saw some different results. I settled on a rate of 115200 in my final version.
I don’t have device currently in front of me, but if I get the chance today, I can snap a picture of my wiring. If not, shoot me a reminder next week and I get that for you. Though it’s quite possible the common ground may solve your issue.
Thanks for the info. I did connected the GND pin of Boron to the GND pin on the SRTR (top-right corner).
Now, I am getting a “Time out 1: No response from module” message.
Please refer to the following pic for my setup and let me know if something is wrong.
The wiring looks correct to me. But I’m now remembering a post at the beginning of this thread cautioning against using the SRTR with Gen3 device.
I believe the SRTR uses 5v logic levels which worked with the Gen2 Photon I was using because the pins are 5v tolerant. I don’t believe this is the case with the Boron or any Gen3 device.
So you will need to assess whether this damaged the pins on the Boron and use a logic shifter inbetween.
@shanevanj@peekay123 were the ones who put out the caution at the beginning of the thread, so they might be able to help with logic shifting.
I was finally able to have the communication between SRTR and Boron working. It turned out that the RX/TX lines need to be swapped meaning in my initial connection, I had this:
TX (SRTR) -> RX (Boron)
RX (SRTR) -> TX (Boron)
I re-connected the lines like this:
TX (SRTR) -> TX (Boron)
RX (SRTR) -> RX (Boron)
and the modules are communicating now. Typically, I have never seen this swapping a requirement but not sure why is this the case here?
I still need to continue with the application development but at least I have crossed this initial hump.
Huh, that’s a bit puzzling since I’ve always seen Serial connections work with the first configuration. Since the SRTR is intended to be a hat compatible with Arduino, I now suspect the labels on the SRTR are meant to signify the RX/TX pins of the Arduino and it handles flipping them internally.
Either way, glad it’s working for you. Once I got through my first time connection issues, the reader seemed to work incredibly well.
I want to power SRTR via Boron 3.3v pin but I guess the current draw on the SRTR is way too much for the Boron 3.3V pin to handle. I used RFP30N06LE MOSFET and Pololu 5V Step-Up Voltage Regulator U3V12F5 to try out but was not able to power SRTR successfully.
Has anyone used Boron or Photon to power SRTR? I cannot use a separate power supply for SRTR.
OK - you need to read the data sheets - this device can consume up to 1.1A - the Boron device CANNOT provide this level of power. At best you will have to connect the SRTR to the VUSB and supply it with 5V. You will then need to use a level shifter to reduce the level for connection to the Boron pins. IMHO - this means you will need an external battery pack to power the whole solution and not rely on the boron's LiPo and associated charging circuit.
A use case description may help you get better advice from this community?
Thanks for the pointer. I was aware of the 1A requirement but I was thinking that the voltage regulator will do the trick. Looks like my HW capabilities are not up to the mark.
My use case is simple. I have a setup where Boron and SRTR are in the same enclosure powered by a single battery and SRTR is being used to read surrounding RFID tags.
The voltage regulator on the Boron is rated for 1000mA and the Boron needs a considerable amount of that for itself - only the remaining reserve can be used to power external devices.