Post date: Oct 31, 2016 3:26:51 PM
This weekend, I decided to build myself a new USB dongle to use for 2-factor authentication. The idea for my project is based on this one. At the core, is a tiny 8-pin DIP AVR, the attiny85. Only a few components are needed to get the AVR connected to USB, mostly for 5v to 3v signal level reduction needed for the AVR 3v inputs. USB functionality is made possible by this AVR USB library. I added a couple of features, the ability to select from multiple strings in flash memory based on number of key presses and the ability to update the firmware over USB without opening the case. The USB bootloader I used is micronucleus.
Here is the schematic, just 3 resistors and two zenor diodes connected to the AVR.
I started with a good quality empty perf board.
Then I used a rotary tool to shave some metal off of a USB plug so the anchor would fit through the holes of the perf board.
Next, I soldered the USB plug onto the board.
Here, I am flashing the micronucleus bootloader to the attiny85. I'm using an Arduino pro mini, running the Arduino ISP sketch and using avrdude program to write the bootloader to flash.
I built the circuit onto a breadboard, but I forgot to set the AVR fuse bits after flashing the bootloader. Here, I am troubleshooting the digital signals with a pocket oscilloscope.
I then soldered the circuit to the perf board. But, I had accidentally soldered the wrong attiny85 into the board. This one still needed fuse bits set, so it couldn't be used as-is. I didn't want to throw it out and start from scratch, and then the idea came to me... Arduino ISP can be used to program the chip in-circuit! Here, I have a clip on the attinty85 so I can set the forgotten fuse bit without having to pull the AVR from the board.
After properly setting the fuse bits, and uploading my code to the AVR, it is time to test it. Here, I am testing it with not-so-random junk strings in flash.
Then I chose an old USB thumb drive and gutted it out to put my circuit into it.
The case needed some plastic removed from the inside, and a hole drilled for the LED.
Here it is, finished, snapped together, and plugged in.