RFID ID12 and Interrupts

Hello there,

I am using the RFID Tag Reader ID12 bought at Sparkfun plugged in a Arduino Due.

According to the specs (https://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf), pin 10 is a LED/Buzzer output.

Is it ok to connect pin 10 directly to an arduino due pin and attach an interrupt to it ?

I would like to know exactly when a card is waved by the sensor so I can treat the event.

Any help or pointers are greatly appreaciated!

Thanks!

How are you connecting the other pins to the Arduino? What code is running on the Arduino? Why isn't polling the RFID reader good enough?

An interrupt is like a phone ringing. The sound alerts you to the fact that someone (probably a telemarketer) wants to talk to you. You can either jump up and answer the phone (respond to the interrupt) or let the answering machine get it, and check the message later (polling).

If you poll often enough, the difference in response times is minimal. Why aren't you polling often enough?

Those RFID reader modules have a TTL output that you can connect directly to the RX pin on the Arduino. (Well, a 100R resistor for safety wouldn't hurt..) You can then use the serial interrupt to inform you when data is arriving.

You can then use the serial interrupt to inform you when data is arriving.

I’m pretty sure that you mean that you can re-write the existing serial interrupt function to do more stuff. But, why? OP hasn’t explained why polling isn’t adequate.

Ah right, yeah... the sketch would have to intercept that since Arduino core implements a RX ring buffer. That's a good point.

As to why use an interrupt over polling -- well, it's just an option. I'm working on a project using the ID12 and had intended on using the serial interrupt to capture the ID sequence into a buffer. The main loop would be unaware of the individual bytes arriving, just polling for a flag that would get set once the final byte arrived and the ID string passed a simple validity check. So a combination of interrupts and polling I guess. But in my case the code is AVR C, so there's no conflict with snagging the serial interrupt....

Hi,

Pooling isn't enough because I am using a Due and running several "main loops", with different tasks. Some of the other tasks are intensive and might hold the Due busy for a brief period of time. I want the interrupts to remedy this "delay": I want to inform the user immediately when he waves the card near the sensor (either with a buzzer or a LED).

Thanks!

PaulS: How are you connecting the other pins to the Arduino? What code is running on the Arduino? Why isn't polling the RFID reader good enough?

An interrupt is like a phone ringing. The sound alerts you to the fact that someone (probably a telemarketer) wants to talk to you. You can either jump up and answer the phone (respond to the interrupt) or let the answering machine get it, and check the message later (polling).

If you poll often enough, the difference in response times is minimal. Why aren't you polling often enough?