You want to Login to your Desktop with your NFC Ring?
You have an Arduino Leonardo, an NFC Ring and an Elechouse PN532 reader (v3 recommended)?
Great, lets build a Log-In Station for your Laptop.
It works with nearly every password field (Debian Linux Login, Windows 8.1 Login, Keepass tested and worked - BIOS password doesn't work).
Connect the Elechouse reader to the Arduino Leonardo (see below) and connect the Arduino via USB to your computer.
PN532 Module <-> Arduino
GND <-> GND
VCC <-> 3v3
SDA <-> SDA (on Arduino Leonardo D2)
SCL <-> SCL (on Arduino Leonardo D3)
So here's the code:
#include <EEPROM.h>
/**************************************************************************/
/*!
Autor: Pascal König
Website: http://blog.koenig-pascal.de
Elechouse NFC Module v2.0
Library: https://github.com/elechouse/PN532
NFC Code Template: https://github.com/JohnMcLear/NFC_Ring_Arduino_Door_Lock/blob/master/NFC_Door_Lock.ino
*/
/**************************************************************************/
#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
PN532_I2C pn532i2c(Wire);
PN532 nfc(pn532i2c);
void setup(void) {
Keyboard.begin();
Serial.begin(115200);
Serial.println("Hello!");
nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
if (! versiondata) {
Serial.print(versiondata);
Serial.print("Didn't find PN53x board");
while (1); // halt
}
// Got ok data, print it out!
Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX);
Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC);
Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
// Set the max number of retry attempts to read from a card
// This prevents us from waiting forever for a card, which is
// the default behaviour of the PN532.
nfc.setPassiveActivationRetries(0xFF);
// configure board to read RFID tags
nfc.SAMConfig();
Serial.println("Waiting for an ISO14443A card");
}
void loop(void) {
String ringUid;
boolean success;
uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; // Buffer to store the returned UID
uint8_t uidLength; // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
// Wait for an ISO14443A type cards (Mifare, etc.). When one is found
// 'uid' will be populated with the UID, and uidLength will indicate
// if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)
success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);
if (success) {
// Display some basic information about the card
// Serial.println("Found an ISO14443A card");
// Serial.print(" UID Length: "); Serial.print(uidLength, DEC); Serial.println(" bytes");
Serial.print(" UID Value: ");
for (uint8_t i = 0; i < uidLength; i++)
{
//Serial.print("..");
//Serial.print(uid[i], HEX);
ringUid += String(uid[i], HEX);
}
//Serial.println(ringUid + "\n");
Serial.println(ringUid);
if(ringUid == "publicRingUID"){
Serial.println("public");
}
else if (ringUid == "privateRingUID"){
Serial.println("private");
Keyboard.println("password");
delay(5000);
}
}
}
Change your password at the end of the code (in the private Ring Area).
If you have questions: Feel free to ask.