We start by activating the reader (ENABLE pin is pulled
low) and then simply waiting for a specific tag string. Let
me correct something I left out: The tag ID string is preceded by a linefeed character ($0A) and followed by a carriage
return ($0D). We’ll see why this is useful a bit later.
In this program, SERIN does all the work. We construct the SERIN line to wait for the linefeed character,
then the specific characters in the valid RFID tag string.
Once that shows up, the program drops to the point called
Access_Granted, where we activate an output that will do
what we need it to do. We could, for example, disable an
electric door lock that gives us — and just us — access to
something special. After a brief delay, the lock-control out-put is enabled and we go back to the top.
The logical question is, “Where did you get the tag ID
string?” We got it from the tag, of course. I just mentioned
that the (ASCII) tag string is preceded by a linefeed and followed by a carriage return. We can put this to use by connecting the reader to a terminal program. Note that we
need to go through an RS-232 line driver (e.g., MAX232,
DS275, etc.) as the serial output is at TTL levels. Figure 3
shows the connections and Figure 4 shows the output
when using a manually opened terminal from the BASIC
Stamp IDE (note that the baud rate is set to 2400). In most
cases, we’ll use a BASIC Stamp to work with the reader,
but be aware that you can also connect directly to a custom PC application using a simple interface as shown.
By the way, if you happen to have the new Parallax Serial
LCD module, you can use it as a terminal and you don’t need
a level shifter. Simply set the LCD Mode switches for 2400
baud (1 = Up, 2 = Down) and connect the RFID reader’s SOUT
pin to the LCD’s RX pin. Don’t worry if it’s not convenient for
you to connect the RFID reader to a terminal or LCD, as we
can always use a BASIC Stamp module to read and display an
unknown tag string.
Figure 2. Connections to the RFID reader.
Most security systems will have more than one legal
user, so let’s update the program to work with multiple
tags. To be honest, I had to go back to the BS1 manual on
several occasions for this program because the BS1 —
while very cool — is not quite as convenient as its big broth-
Circle #106 on the Reader Service Card.