1

I have been working on an access control project which started out as scanning QR codes using a Pi camera and then triggering a relay using the Pi to open up electro-magnetic locks.

I would like to expand this feature now to allow scanning of RFID cards and have discovered that there is a myriad of options to consider.

For example, here are some of the questions / rabbit hole I have jumped into after digging through all the information online:

  1. Started with using an RC522 RFID module.

this led me down the path of further questions like..

  1. The module using SPI which restricts the cable length? Plus I would also like to have a buzzer and an LED indicator at the reader, which would be too much of a custom job to setup.

so I started looking at ready made RFID card readers in the market, and this came up with

  1. Wiegand wiring/protocol card readers or RS485 wiring and unknown protocol card readers? Do all RS485 readers communicate over something like Modbus or are they all custom and private protocols designed only to work with their own control panels?

  2. Even if I do manage to find something which is opensource, I'd then have to consider how do I connect the Wiegand/RS485 wiring to the Pi?

  3. I looked up RS485 to USB converters and then realised that is a whole other topic about serial data translation and libraries. This also means the encoding and decoding needs to match on the reader and the Pi library I assume?

I tried digging through the forums but haven't managed to find anyone else using an off the shelve RFID card reader (complete with buzzer and LED) with the Pi?

Would appreciate if anyone could share any similar posts they've come across or point me in the right direction with the questions above.

Thanks in advance!

EDIT: After digging deeper, if I were to go down the path of using the Wiegand wiring interface, is it possible to connect more than one Wiegand card reader to the Pi?

3
  • Well, buzzer and led is a 2 hour job, while the RFID might take you more than 100 hours.
    – tlfong01
    Aug 24, 2021 at 12:39
  • When you say the RFID is more than a 100 hours, is this with the context of using the RC522 and configuring it to read industry standard cards?
    – fabbbles
    Aug 24, 2021 at 15:16
  • Well, skim this chat for the RC522 RFID LightMyLifeUp SPI complexity - chat.stackexchange.com/rooms/123411/…. I have been spending more than 100 hours scrapping the surface, and the root problem is SPI.
    – tlfong01
    Aug 25, 2021 at 6:11

1 Answer 1

1

On the RFID modules I've used, the LED and buzzer are usually wired independently of the Wiegand RFID sensor, and as such are controlled just as you would if they were separate components (though the LED may already have an in-line resistor). Typical wiring connections look like this:

  1. DC12V
  2. GND
  3. WG data0(RS485+)
  4. WG data1(RS485-)
  5. BUZZER
  6. LED
  7. WG26 or WG34 output format select

You will have to make sure to account for voltage mismatches between the data lines of the RFID module you select and the RasPi GPIO pins (i.e. 12V vs 3.3V) by using a level shifter.

The PiGPIO library has a Wiegand decoder example that makes reading the card pretty straightforward.

7
  • Thanks John. Of the Wiegand ones you've used, are they off the shelve readers or did you integrate individual LED/buzzers with the RC522 or equivalent? If you used an off the shelve one, does it mean the protocol will be the same for all wiegand devices as long as wiring looks like what you described? (And set correctly to 26/34 bit)
    – fabbbles
    Aug 25, 2021 at 2:31
  • Yes they were off the shelf with integrated LED and buzzer. The ones I've used usually have the 7 wires. Wiegand is a standardized encoding so if it supports that you should be good.
    – John S
    Aug 26, 2021 at 3:14
  • Awesome, thanks very much again. Will fiddle with a reader I've got and see how it goes. Out of curiosity, which library did you use to decode the wiegand data? I've seen pigpio being one of the most mentioned ones on forums.
    – fabbbles
    Aug 26, 2021 at 16:37
  • Yes, it was from PiGPIO. I linked to the example code above.
    – John S
    Aug 26, 2021 at 21:07
  • 1
    Thanks John, appreciate the responses.
    – fabbbles
    Aug 30, 2021 at 3:47

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.