about | k107 | downloads | diskshoppe | PRC | Freeduino | PICAXE | MSP430 | SX48 | FT817 | LaserTag | BS2 | Clearance | feedback

FREEDUINO Applications Note

about | ADABOOT | BootBurner | resources | tutorials

[Pictures below may be clicked to enlarge]


Innovations ID-12 RFID Sensor from Sparkfun
on Freeduino board powered and programmed
by FTDI USB cable.


Innovations ID-12 RFID Sensor basic schematic
The Innovations ID-12 Datasheet is here


Screenshot from Arduio IDE Serial Monitor
showing output of simple demo program
(download the associated sourcecode here)


ID-12 RFID on a BBB, this time with a piezo sounder
in parallel with the LED and the display is to a Wulfden
K107 Serial LCD display controller. (download the
associated sourcecode here)



Innovations ID-12 RFID Reader
Pin Name Pin Number Attached to
Ground 1 Ground
Reset 2 +5v pullup or
to digital pin 2 on BBB
n/a 3 no connection
n/a 4 no connection
n/a 5 no connection
n/a 6 no connection
Data Format 7 Ground for 9600bd serial
n/a 8 no connection
Data Out 9 TTL TRUe serial data out
to digital pin 0 (RX) on BBB
Valid Card 10 LED with series resistor
3.1 KHz TTL signal
Power (+Vcc) 11 +5 VDC


/* * RFID Loop * by Alexander Reeder, Nov 16, 2007 * Modified by Brian Riley January 2008 */ #define RESETLEDPin 13 #define RESETPIN 2 char val = 0; void setup() { Serial.begin(9600); // connect to the serial port pinMode(RESETPIN, OUTPUT); // sets the digital pin as output pinMode(RESETLEDPin, OUTPUT); // sets the digital pin as output } void loop () { char IDstring[13]; int i; digitalWrite(RESETLEDPin, LOW); // Shut off LED digitalWrite(RESETPIN, HIGH); // pull up Reset line if (Serial.available() > 0 ) { if ( (val = Serial.read()) == 02 ) { // look for Start Of Text marker Serial.print("[SOT] "); // reda until you get End Of Text for ( i = 0; (val = Serial.read()) != 03 ; i++) { Serial.print(val, HEX); Serial.print(" "); IDstring[i] = val; } Serial.println("[EOT]"); Serial.println(); Serial.print(" IDString["); IDstring[10] = 0x00; // tie off IDstring at the CR-LF Serial.print(IDstring); Serial.println("] "); Serial.println(); resetID12(); // reset after a valid read } } } void resetID12() { digitalWrite(RESETLEDPin, HIGH); // show reset by lighting LED digitalWrite(RESETPIN, LOW); // pull reset down delay(100); }

 

#include <SWSerialLCDPHA.h> /* * RFID Loop w/LCD Display and Piezo Sounder * by Alexander Reeder, Nov 16, 2007 * Modified by Brian Riley January 27, 2008 * Modified for Display and audible * Brian Riley January 28, 2008 */ #define LCDpin 14 #define RESETLEDPin 13 #define RESETPIN 2 #define MISSES 5000 SWSerialLCDPHA mySerial = SWSerialLCDPHA(LCDpin); char val = 0; int misscount = MISSES; void setup() { pinMode(LCDpin, OUTPUT); // define pin modes for tx pin Serial.begin(9600); // initialize UART mySerial.begin(19200); // set the data rate for the SoftwareSerial port mySerial.clearscr(); // gets the SW Serial pump flowing mySerial.clearscr(); // cleans screen after whatever goop comes from startup mySerial.setgeo(216); // set chip geometry for a 2x16 display mySerial.setintensity(0x80); // set backlight at mx intensity pinMode(RESETPIN, OUTPUT); // sets the digital pin as output pinMode(RESETLEDPin, OUTPUT); // sets the digital pin as output misscount = 0; } void loop () { char IDstring[13]; int i; digitalWrite(RESETLEDPin, LOW); // Shut off LED digitalWrite(RESETPIN, HIGH); // pull up Reset line if (Serial.available() > 0 ) { if ( (val = Serial.read()) == 02 ) { // look for Start Of Text marker // read until you get End Of Text for ( i = 0; (val = Serial.read()) != 03 ; i++) { IDstring[i] = val; Serial.print(val, HEX); Serial.print(" "); } Serial.println(); IDstring[10] = 0x00; // tie off IDstring at the CR-LF mySerial.print("?f ID=["); mySerial.print(IDstring); mySerial.print("]"); resetID12(); // reset after a valid read misscount = MISSES; } } else { // basically this code lets you see the ID for about 5 seconds then // replaces ID display with "waiting," 5000 1 ms loops, so if a new // ID card is presented it chnages immediately to new ID display. if (misscount-- == 0) { mySerial.print("?f ... waiting ..."); } delay(1); } } void resetID12() { digitalWrite(RESETLEDPin, HIGH); // show reset by lighting LED digitalWrite(RESETPIN, LOW); // pull reset down delay(100); // hold reset for 100 ms }