Programming Arduino and RFID reader:

Hi all,

I’m fairly new to electronics, so this might be a basic question.

I recently bought a Sparkfun RFID USB reader and RFID Reader ID-20LA. I have an Arduino Uno microcontroller as well.

My project is to have the Arduino output a current (which will be used to drive another circuit) when a 125kHz RFID tag is in proximity to the RFID reader, and stop the current when the tag is not in proximity to the reader.

Any help would be much appreciated. The more detailed, the better.

Thanks in advance guys.

Hello Salty.

There’s a pin labeled CP on the RFID reader module that will go high whenever a tag is in range, but it only does that when the module is setup for “magnetic emulation.” The data sheet lists the function of this pin as “future” so I can’t verify it actually works, or if the pin is essentially dead.

Unfortunately for your application, the USB RFID Reader board we carry sets the module up for ASCII rather than magnetic emulation, but if you were to use a [breakout board, you could set the module up for magnetic. Check page 6 on the [data sheet for the format selector pin (7) and where it needs to be connected to to change modes.

Again, I don’t know for certain if the CP pin functions, but you’d need to change the mode to test it.](https://cdn.sparkfun.com/datasheets/Sensors/ID/ID-2LA,%20ID-12LA,%20ID-20LA2013-4-10.pdf)](SparkFun RFID Reader Breakout - SEN-13030 - SparkFun Electronics)

Hi Chris,

Thanks for your reply! You really got me on the right track and I’ve been learning more about Arduino IDE and circuits over the last month.

I have another question that you might be able to help me with. I am wondering if I can somehow output the voltage through the Arduino as opposed to the RFID reader. This way, I’ll have the flexibility to add code for other scenarios.

The simplest idea I can think of is having the “Tag in Range” pin (6) of the RFID reader connect to a digital input pin on the Arduino. I would write an if-else statement in Arduino IDE: if digital input pin gets voltage, output a voltage to another pin (which will drive the circuit), if input pin gets no voltage, do not output a voltage to another pin.

Would this work? How can I program this in Arduino? Do you have any better suggestions? Again, the basic idea is that the Arduino outputs a voltage when an RFID tag is in range to the reader, and stops outputting voltage when it is out of range.

Thanks in advance,

Salty

You could connect pin 7 to a Arduino pin and then drive the pin high or low to select ASCII or Wiegand26 mode, but the only way to select Magnet Emulation is to connect pin 7 to pin 10. To do that with an Arduino would take some external circuitry and more than one Arduino pin.