2
\$\begingroup\$

I got the following rfid reader from a colleague enter image description here

https://www.aliexpress.com/item/4000035966273.html?spm=a2g0o.productlist.0.0.4ac14adcZL3H9M&algo_pvid=af835e25-e532-4426-8714-cd80a9871169&algo_expid=af835e25-e532-4426-8714-cd80a9871169-0&btsid=0ab6d70515978825018782158e600d&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

I have connected it to my raspberry pi 4 module b using the following pinoutenter image description here;

  • raspberry pin 2 (5V)-- reader module pin VDD
  • raspberry pin 6 (GND)-- reader module pin GND
  • raspberry pin 19 (MOSI) --reader module pin MOSI
  • raspberry pin 21 (MISO)-- reader module pin MISO
  • raspberry pin 23 (CLK) --reader module pin SCLK
  • all other pins left unconnected

I have followed the setup steps described in this video https://www.youtube.com/watch?v=evRuZRxvPFI

My problem is that the reader is not reading data. I confirmed that the system does power up using an LED and (a resistor) in series connected to the VDD. The reader was pulling 0.46mA using a 3.3V supply, and 0.74mA using a 5V supply (measured using a multimeter).

When I fire up the raspberry and run the code, the reader does not seem to be reading any data from the rfid chips I have. I did confirm that the chips contain data using an other reader module.

I did go through the documentation but I havent found anything useful.

http://read.pudn.com/downloads567/ebook/2333609/THM3060_UM.pdf?fbclid=IwAR1y0qh-cUdnnL9wfk-ZVLEcNVTvyHoviiM6Qsg6VQggS1zu8OVPTPRnPrU

I tried connecting pins RSTN and STDBY to ground but it made no difference. I have no contact with the seller unfortunately(wasnt the one who made the order), so i cant get any more information about the reader. Has anyone had any luck with these specific types of readers? How else could I trouble shoot the system? Continuity tests have confirmed that there are no damaged traces on the reader board itself.

How can I get it to read/write data?

\$\endgroup\$
13
  • \$\begingroup\$ #Malcommand, Welcome and nice to meet you. Ah, let me see. Your RFID thing uses the 522 chip, and your tutorial is Pi My Life Up. I once used both a well, and found everything OK. Let me see if I can find my old posts and let you know. In the mean time I am drafting an answer. Please feel free to comment, suggest, or ask newbie question. Cheers. \$\endgroup\$
    – tlfong01
    Aug 20, 2020 at 1:15
  • \$\begingroup\$ Please let me know more about your Arduino/Rpi/IT background, such as, do you know how to use Rpi to blink a LED? or read a button? or used Rpi UART, I2C, SPI before? I will then try to tailor my answer gearing up to your knowledge and skills. Take your time, not urgent at all. Cheers. \$\endgroup\$
    – tlfong01
    Aug 20, 2020 at 1:36
  • \$\begingroup\$ (1) I read the user manual which says that the optimum power to the module is 3.3V~ 3.6V. If you power 5V to the module, you might have a problem. Please read Part 2 of my draft answer for more details. (2) Please let me know you project time frame. If you have a tight schedule, then I would try to give a short answer, without the TLDR explanation. But if your main objective is to learn NFC/RFID and Rpi SPI, then I can be more long winded. I will let you clarify and confirm, before I move on. Cheers. \$\endgroup\$
    – tlfong01
    Aug 20, 2020 at 2:30
  • 1
    \$\begingroup\$ 1-I have read it yes! 2- i have managed to get an english version of the manual. I have tried a number of different methods but nothing seemed to work. Basically, im unable to communicate with any of the registers. I have written my own code and i also tried the arduino built in SPI library. I have a few more options to try out, but so far the chip registers are not possible to read/ write \$\endgroup\$
    – Malcommand
    Sep 7, 2020 at 10:16
  • 1
    \$\begingroup\$ I have actually reverse engineered their library and created an arduino compatible version. But sadly i can not read /write any of the registers. I have also tried with the stabdard spi library of the arduino but still nothing. Im beginning to think that the issue might be at hardware level. I have tested various spi frequencies and used other projects for reference. Nothing seems to make a difference \$\endgroup\$
    – Malcommand
    Sep 9, 2020 at 16:26

2 Answers 2

1
\$\begingroup\$

Question

How to set up the THM3060 RFID reader?

The OP's RFID module wiring is show below.

rfid 1


Answer

Contents

Part A - Schematic

Part B - User Manual Reading Notes

Part C - Pi My Life Up Library Testing Notes


Part A - Schematic

Introduction

The AliExpress product sheet says the OP's RFID module is RC522 based, but the user guide only mentions THM3060, nothing about RC522. So I need to study carefully if the two chips are 100% compatible, and if standard RC555 wiring is used. Therefore I need to read the schematic very carefully, to find any incompatibility.


rfid module schematic

thm3060 pinout

thm3060 pin function


Part B - User Manual reading summary notes

  1. The user manual is dated 2009. This might be a problem. I need to check if it is updated with current version of RC522.

  2. his might be a problem. I need to check if it is updated with current version of RC522.

  3. The features section says operation voltage is 3V to 5V, with a foot notes saying the optimum power supply is 3.3 ~3.6V. This might be another problem. If the OP uses 5V power, the modules PI logic signals might be 5V, and this might be a serious problem, because Rpi's SPI signals are definitely 3V3 logic. Even if Rpi 3V3 SPI can talk to the module's 5V SPI, there is a very small risk of Rpi's SPI circuit latching up, frying the SPI or complete SBC, or shortens Rpi's working life.


Part C - Pi My Life Up Library Testing Notes

Introduction

The OP says that he is following the Pi My Life Up tutorial. So I search my old files to find a similar test I did for his reference. It is not clear if he has already done the basic test of SPI loop. So I also include the loopback test, as shown below. The details is described in Ref 4.


Setting Up

rfid 3


SPI Loopback Test

rfid 4


RC522 Pi My Life Up Test using CLI Commands

rfid 5


RC522 Pi My Life Up Library Test Using Python

rfid 6


/ to continue, ...


References

(1) AliEXpress THM3060 13.56MHz RC522 RFID Module - US$5

(2) How to setup a Raspberry Pi RFID RC522 Chip - Pi My Life Up, 2019oct28 11,578 views

(3) THM3060 Multiple Protocols Contactless Reader IC Version 1.1 - 2009Aug Beijing Tsinghua Tongfang Microelectronics

(4) How can Rpi SPI python read the MFRC522 NFC module? - Rpi SE 2020mar28

(5) How can Rpi read a PN532 NFC Module? - SO 2020apr12

(6) Problem with detecting badge with PN532 and Raspberry Pi - SO 2020mar23

(7) SPI setup/loopback/repeat send byte utilities and MCP3008/3201/M208 ADC Python Test Programs - Rpi SE 2020aug

(8) 淘宝 THM3060, 兼容 RC522 RFID 模块 - 中国集成电路店 ¥16 (~= US$2)

(9) RC522 RFID Module Testing Program V0.3

/ to continue, ...


Appendices

/ to continue, ...


End of answer

\$\endgroup\$
12
  • 1
    \$\begingroup\$ Hi and thank you for the detailed answer. Firstly I will clarify a few of your questions. I am experienced with arduinos and raspberry pi, although it is the first time I need to use SPI communication. Secondly, Im not a tight schedule but I would like to pin down the source of the problem as quickly as possible. Currently the project is a bit of a pilot, and future developments are based on the success of its proper functioning. \$\endgroup\$
    – Malcommand
    Aug 20, 2020 at 7:34
  • 1
    \$\begingroup\$ Regarding the 5V power supply concerns. I was confident in the 5V supply due to the product description on aliexpress, as well as the two voltage regulators on the board. I did initially try the system with 3.3V supply but with no success. I will definitely try the SPI loop test you suggested. Regarding your setup, which pin should I connect the SPI CS0 to, on my board? Thanks in advance! \$\endgroup\$
    – Malcommand
    Aug 20, 2020 at 7:34
  • \$\begingroup\$ Ah, thank you for your reply. Now 4 quick suggestions. (1) Read Part C of my answer and do the CLI SPI loopback test. It is important to first make sure the SPI wiring is OK, (2) Then again use CLI to test SimpleMFRC522. If you have difficulty using CLI commands, I can try to find old python to test in Thonny IDE. (3) I would suggest to power your RIFD moudle with 3V3, that is what I did last time. (4) I was playing with both RC522 and PN532, using UART, SPI, and I2C at the same time, and I forgot which module is using which, so I might have mixed up things. So compare my screen captures. \$\endgroup\$
    – tlfong01
    Aug 20, 2020 at 7:39
  • 1
    \$\begingroup\$ What do i connect the SPI CS0 pin to on my board? I dont seem to have any more SPI related pins (as shown on the second image) \$\endgroup\$
    – Malcommand
    Aug 20, 2020 at 7:53
  • 1
    \$\begingroup\$ Also, is the SPI loopback test conducted with the reader connected to the raspberry, or is it only connecting the MISO pin of the raspberry to the MOSI pin of the raspberry directly? \$\endgroup\$
    – Malcommand
    Aug 20, 2020 at 8:04
1
\$\begingroup\$

Following a long and rigorous troubleshooting process I have come to the conclusion that the device must have hardware issues. Possible design related integrity problems or issues within the microchip itself.

I was able to test the signals with a logic analyser and it can be clearly seen on the attachments that no response is received on the MISO line.enter image description here The image above shows a read-write-read sequence for register PSEL. It was not possible to obtain any MISO values.I have tried multiple clock frequencies but nothing made a difference (all of them were well within the maximum 2.5 MHz range).

enter image description here

Sadly I dont have a scope so I cant check signal integrity. But Im confident that the issue is with the hardware itself

\$\endgroup\$
3
  • \$\begingroup\$ #Malcommand, By chance I am answering another RFID question just now: raspberrypi.stackexchange.com/questions/118464/…, and so revisiting this Q&A. I am glad that your are making some progress. (1) I still have not received from you any updated version of the user guide, otherwise I might test it later. (2) I do have a scope to do the testing. \$\endgroup\$
    – tlfong01
    Nov 18, 2020 at 4:26
  • \$\begingroup\$ Chat still there, but no reply from you (sorry for the funny character spacing, it was a Win10 Chinese bug, to be fixed)chat.stackexchange.com/rooms/112007/…. Please reply with "@"before "tlfong01" Cheers. \$\endgroup\$
    – tlfong01
    Nov 18, 2020 at 4:39
  • \$\begingroup\$ Hi. Sorry for late reply. Im afraid i dont have an updated version of the user guide. Only the one thats been attached here \$\endgroup\$
    – Malcommand
    Nov 20, 2020 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.