Individuals, small businesses and grade schools often can't afford expensive enterprise security systems. Most 3rd-party login solutions for that lower-end, consumer market are also finicky, unreliable or insecure; or they require significant technical know-how to utilize. I wanted a simple, intuitive and responsive system that not only is secure, but is also easy to use. This is what Login Leonardo strives to be.

What it does

It uses RFID technology in combination with a PIN number for secure two-factor authentification before logging you into your Windows 10 user account. When both the correct RFID tag is scanned and the correct PIN is entered, it automatically logs you in to your desktop. Additionally, it has a RGB led configured to give you intuitive visual feedback during the login process. Login Leonardo also provides a level of abstraction from the Windows security that could be useful to system administrators, parents, etc., as the user doesn't actually have to know their Windows password or PIN number; they only need their RFID tag and their (hopefully different) Login Leonardo PIN number. This means, for example, it is possible to easily suspend someone's access to a system, without having to go through any Windows account management, by simply confiscating their tag.

How I built it

I connected a MFRC522 RFID module to my Arduino Leonardo, along with a 4x4 mebrane keypad and an RGB LED. I used the Arduino Leonardo specifically because, unlike the traditional Uno or Mega, it has native USB connectivity integrated into it, allowing it to act as a USB device, such as a keyboard and/or mouse, for instance. I used several different Arduino Libraries to make all my parts work together. Firstly, I used the SPI.h and Keyboard.h standard Arduino libraries, the first because the MFRC522 is designed as an SPI device, and the latter allows the Leonardo to act as a USB keyboard to send keystrokes to the computer it's connected to. Then I used two other libraries, the MFRC522.h library by Miguel Balboa which makes it easy to control the MFRC522 in order to read the RFID tags, and the Keypad.h library by Mark Stanley and Alexander Brevig which makes setting up and getting inputs from the 4x4 button matrix keypad simple. The RGB LED is really 3 LEDS (one red, one green, one blue) in one unified package with a common cathode, and I used it that way. It allowed me to give intuitive visual feedback to the user for each step of the login process. A 3 second solid green light indicates that the RFID tag was identified or that the PIN was correct (depends on which step one is one), a solid 3 second red light means that either the RFID tag was not recognized or that the PIN number was wrong, while a blinking red led means that the RFID tag was not successful read and should be scanned again.

Challenges I ran into

I had a very rough time connecting the Leonardo to the MFRC522. Virtually all of the documentation for the MFRC522 is for connecting it to an Arduino Uno, and the Leonardo uses different pins for SPI, so there was a lot of trial and error in getting them connected properly. Ultimately, I connected the MFRC522 to an Uno and ran some sample sketches on it to test it, and then I went back to the Leonardo to, using trial and error until I got the same sample sketches running correctly. After this, it was relatively easy to get the rest of the hardware connected.

Somewhat similarly, it was also a pain it the rear to configure the keypad, because I had to do a lot of trial and error in figuring out which pins were which rows and columns of the keypad.

I also had to fix a bug that stopped the Leonardo from doing anything unless I was running the Serial Monitor. I finally isolated the problem to a few lines of, as it turns out, unnecessary code I just commented out.

Accomplishments that I'm proud of

I tend to be a very visual-oriented person, so I really wanted to provide good, intuitive feedback from the device so that I could know what's happening as I go. It's always bugged me when I'm typing in a password, and sometimes I feel like I missed or hit the key but am not really sure until I either get logged in or seen an error. I solved this problem to my satisfaction with my RGB LED. In addition to the feedback listed in the "How I built it" section above, I also made the LED very briefly flash blue when a button is pressed while entering the PIN number, visually demonstrating that the keypress was registered. I also chose blue for security, because I didn't want to give any indication (accurate or inaccurate) of whether or not the PIN was good until all four digits are entered.

I'm also proud of it's two-factor authentication; this way if someone were to steal you keys or just the RFID tag, they still can't break into your PC.

Overall, I'm rather proud of this little device; it's simple and easy to use, and I learned a lot doing it.

What I learned

I learned how to use an Arduino Leonardo as a USB input device for a PC, allowing me to take my Arduino projects to the next level. I also learned how to integrate RFID technology into my projects, as well as button-matrix keypads. Additionally, I learned how to use the Arduino Serial Monitor for debugging.

What's next for Login Leonardo

I plan on making it detect multiple, different RFID tags and automatically select from multiple user accounts the correct user to log in. (Each user would have a unique PIN as well.) I also want to make a version that works with common Linux OSes, like Ubuntu and Raspbian.

Another potential feature would be for the device to log all access attempts, and whether or not they were successful.

Built With

  • arduino-leonardo
  • 4x4-membrane-keypad
  • rgb-led
  • mfrc522-rfid-reader/writer
Share this project: