ID-12 RFID Reader

So thanks to the excellent code on the playground (arduino.cc/playground/Code/ID12), I have a working ID-12 reader with my arduino and a few tags. However, I'd like to have the antenna reset periodically to poll for a tag that is left on top of the reader.

I have the RST pin on the id-12 module wired to +5v via an NPN transistor that will write LOW if a tag is detected and then HIGH again until another tag comes along. It works just as I expected with the reader resetting if a tag is present.

My question is this: why do I need a resistor on the base of the transistor (using NPN)? I've read and reread about amplification and am now thoroughly confused. I'm just using the USB connection on a Duemilanove, with the usual +5v for collector (and a separate jumper to the ID-12 power pin), digitalWrite() via 300ohm resistor to base, and the emitter is connected to the ID-12 RST pin.

Everything works, I just don't want to burn anything out. Thoughts?

First, I suspect you have described your wiring incorrectly (at least I hope so).

Your connections for a NPN transistor should be:
Base: Arduino control pin (through a resistor!)
Emitter: Connected to ground
Collector: Connected to the reset pin on the ID-12 with a pull-up resistor to 5V.

Lastly yes, you need a resistor on the base to limit the base-emitter current. If you don’t, the Arduino pin would try to push all the current it can through the base-emitter circuit (about 30-40 ma). So not only would you be overloading the ATmega 168, you’ll likely burn out your transistor.

Just stick a 4.7k (or anything close) resistor in there and you’ll be fine. Then you’ll only be running 1ma through the base-emitter.

If you want to get away without using a resistor you need to switch from a bipolar to field effect transistor (FET).

i'm also doing a project with an arduino and id-12 how did you get the tag data for you tags. did you use one of the i/o pins as a serial input from the id12 or did you read the id12 store the tag and then in later transmit it to the computer?

Since the ID-12 is a read-only device, you can connect it to the RX pin (0) on the Arduino and receive data with Serial.read (at 9600 baud). If you have your Arduino connected to your computer via USB, you can do a Serial.print and that data will go throught the FTDI chip to your computer.

The only downside is you need to disconnect the ID-12 from pin 0 to program the Arduino as it will interfere with the upload. Putting a 10K resistor on the line from the the ID-12 may work around this.

Another option would be to use other digital pins with SoftwareSerial or the newer variant by mikalhart, NewSoftSerial.

thanks etracer

Just a follow up on this, turns out I had my terminology (collector, emitter) backward, but I also had the pins backward, which is why everything was working.. glad I didn't fry anything.

Anyways, after all that, I realized that simply writing HIGH to the RST pin via an arduino output would accomplish the same thing as using a transistor, so I've removed that component and left the resistor between the arduino and id12 reset pin. Everything is working exactly like I'd hoped, thanks for the help!