USB Business Card

usbbusinesscard_1[1]

Usage Instructions

Plug into an USB port, making sure that the pads on the card will connect with the contacts inside the USB connector.

Your operating system may start install a driver automatically, if this happens, wait for it to finish installing.

usbbusinesscard_waitready[1]

Open a text editor such as “Notepad”.

Press CAPS-LOCK on your keyboard a few times.

Watch the magic happen as the card types out text into the text editor.


How Does It Work?

There is a ATtiny85 microcontroller on the business card that becomes an USB keyboard pre-programmed to type out text when it detects that CAPS-LOCK has been pressed a few times. It can store about 5K characters using an ATtiny85.

Instructions are also available on Instructables http://www.instructables.com/id/USB-PCB-Business-Card/

usbbusinesscard_2[1]
usbbusinesscard_board[1]

The circuit is very simple: 3 resistors, 1 capacitor, 2 Zener diodes, 1 ATtiny85. The PCB is partly personalized “art” and the USB portion.

There is a ATtiny85 microcontroller on the business card that becomes an USB keyboard pre-programmed to type out text when it detects that CAPS-LOCK has been pressed a few times.

V-USB is used so that the ATtiny85 microcontroller can become an USB keyboard.

The USB connector is designed right on the PCB, and is cut to shape by the PCB manufacture. The first batch of cards I made used 1.6 mm thick PCB (which is the default standard, and the maximum thickness available from the cheap manufacturing service I used), and I find it to be a bit too thin (the connector will be loose in the USB port and may not make contact). I added 5 layers of green electrical tape to increase the thickness of the connector portion to ensure a good connection. Measuring the final thickness, I think a 2.4mm (that’s the thickest you can get from Seeed Studio’s PCB service) board material will work if you apply some solder to the pads on the connector. The contact pads should always be tinned with solder manually because the thin layer of chemical tinning will wear out.

Designing the USB connector into the PCB file was done manually by measuring an ordinary USB connector’s dimensions. A custom component was made using the measurements I took, which involved 4 pads and the outline of the connector.

usbbusinesscard_circuit[1]

Programming the ATtiny85 is done with an AVR in-circuit programmer. I made an adapter that connected a standard 6-pin ISP header to a USB port and two additional wires. The card has two hidden pads which the additional wires plug into. Programming with this setup requires you to use a low SCK frequency due to the resistors in the circuit.

The code uses V-USB to allow the ATtiny85 to become an USB keyboard device. The USB HID report descriptor is the standard keyboard descriptor that supports boot-protocol. This allows the ATtiny to receive output-reports which sets the status of the CAPS-lock LEDs (as well as NUM-lock, and SCROLL-lock), the toggling of this LED is counted in order to trigger the business card. Once triggered, the business card will stream text stored in memory to a function that sends ASCII characters as keystrokes.

The clock source of the ATtiny is its internal RC oscillator combined with its PLL to bring the clock speed up to 16.5 MHz (one of the frequencies supported by V-USB). The low-fuse setting is 0xE1 for this setting (other fuse settings do not affect the clock source). This clock source is automatically calibrated at boot-up by measuring the time between USB bus polls, and the oscillator calibration value is found using a binary search until the measured time matches the expected value. The calibration results is stored in EEPROM so it can be used as the starting point of the search for the next boot-up.

All resistors are in 0603 form (all 1/10 watt, 5% tolerance), the capacitor is in 0805 form (ceramic, rated over 5V), the two Zener diodes (Vz = 3.6V, rated 500 mW minimum) can be in SOD123 or MiniMELF form (or similar dimensions). The ATtiny85 is in SOIC packaging. These surface mount components are soldered by hand. Making each one of these business cards is a labour of love. Do not attempt to do surface mount soldering unless you have a decent soldering iron, a good set of tweezers, a magnifier, good lighting, a clear workspace, desoldering equipment (desoldering pump and braid), chemicals like flux and rubbing alcohol, and really thin solder (this is what I didn’t have, hence why my solder joints are messy).

Note: the pictures are of the first revision of the card, which do not include the Zener diodes and used 1.6mm thick PCB material. These cards have “24885H2 07301A-24” written on them.

3 thoughts on “USB Business Card

    1. Admin Post author

      Probably, try it. It will work, but it might take extra effort to get it working. I don’t recommend it.

      Reply
  1. Karthick Soundararajan

    Hi,
    I found your project really interesting and i thought to try it. I had downloaded you code from instructables. I tried to program your code to attiny85 using arduino uno board. But i got bit confused about what to be added. If you dont mind can you mention the file names please. I tried to burn .c file and .h files only.. But these are not working. Thanks in advance

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *