Introduction: DIY Windows Login Key

About: Long walks and deep talks, nature enthusiast who enjoys landscapes and hikes. Photography is my passion and capturing moments is my thrill. Been around circuits for too long that I ended up with a major in ele…

Are you fed up with windows asking you for
your password whenever you login?

Well you can set up a pin; it is easy to remember right?

However, a pin it’s not that secure, especially if you are using your laptop in public it is easier to catch than your 16 mixed digits upper and lower cases with symbols password.

So why don’t you use a USB stick to login?

Well probably, you had that idea already as authentication keys are available on the market but they are not cheap. In addition, a software solution to turn your regular thumb drive is not free as far as I know, and you are not going to be able to use it as storage anymore.

So what is the solution?

Well my friend it is the Attiny85 microcontroller. Precisely the USB model from Digispark.

So let us jump into the requirements to achieve this.

Supplies

Hardware:

Alongside with the computer that you want to login to you need:

1x Digispark attiny85 USB (type A)

Software:

Arduino IDE

Attiny85 Arduino board library

Digispark Drivers

Step 1: Installing Arduino IDE

(For those who already have it installed on their machine you should skip to the next step)

First, let us begin with installing Arduino IDE.

Download the latest version from here and continue the installation process.

Step 2: Setting Up Digistump AVR Boards

Now that you installed Arduino IDE, installing the board library is necessary.

That way you will be able to upload your code to the Attiny85 microcontroller.

Please note: if you have already a version of Arduino IDE installed do not make the mistake of replacing your existing URL or your existing extra boards will disappear although they still on your drive, you should append the list.

You need to update your board URLs adding the following URL:

http://digistump.com/package_digistump_index.json

then head to tools>boards manager> and search for esp and install it.

Step 3: Installing Digistump Drivers

Now that we set up Arduino IDE let us install the microcontroller driver:

Download and extract the driver files and simply run DPinst.exe or DPinst64.exe depending on your system as shown

Step 4: Programming

Therefore, now that everything is set we are ready to start programming.

The code is pretty much just a few lines in which we call the "keyboard" library. Then we set what is going to happen each time when we plug our Attiny85 USB into the computer

Step 5: Uploading and Testing

Now what is left to do is upload the code but for you folks that are used to Arduino IDE this probably is not your typical upload process.

Therefore, you just need to select your board and "AVR ISP mkrII" as your programmer:

Moreover, hit the upload button or (Ctrl+U).

Now you may finally connect your Attiny85 microcontroller to your favourite USB port.

Give it some time and you will get the upload done notification.

Now please eject your Attiny85 from the computer. Otherwise if you want to double check your password open any text editor as soon as you plug your Attiny85, give it some time and your password is printed.

Finally lock your computer, plug your Attiny85 USB, and see the magic!

Troubleshooting

Q: Why is it printing letters and symbols I did not wrote in the code?
A: Well the “keyboard.h” file use US standard 100 key keyboard so there is a probability that you are using a different language on your computer other than US English. Therefore, it is not a disaster as you can work around it to tell the keys for example on “azerty” keyboard “a” and “z” represent “q” and “w” on the “qwerty” keyboard
Q: I plugged my Attiny85 USB but it is unplugging on its own, why?
A: it is plain simple; out of the box, the Attiny85 USB is not programmed. Windows will not recognize it but you should be able to get it to work despite that annoying repeated unplugging and plugging sound.
Q: Why is windows not recognizing my Attiny85 USB?
A: it’s probably Windows driver related, sometimes Windows fail to locate the driver folder. Therefore, you should do it manually. Just open the "computer manager", select "device manager" and under view select "show hidden devices" and search for your device and then right click on it and choose "update driver" > "browse my computer for this driver" then search for the folder you extracted the driver in and select next.