This is a business card that will type out some text when you plug it into a USB port.

It uses a ATtiny85 microcontroller with V-USB based code to emulate a keyboard. The typing is triggered by the CAPS LOCK status LEDs being toggled 3 times.

This instructable will focus on using CadSoft EAGLE to create your own USB PCB business card. I want you to be creative in the design, so some minor steps I've taken may have been omitted.

Code download is provided on step 8.

Step 1: Circuit

The circuit is based on V-USB's recommended circuitry. It's powered by the 5V from the USB port. There's two 68 ohm resistors, one on each of the USB data lines, these act as terminating resistors which suppress reflected signals. There is a 1.8 kilo ohm resistor on the D+ line, which allows the computer to detect when something connects to the USB port, and it identifies the device as a low speed device. Two Zener diodes with Vz of 3.6V are on the data lines to clamp the voltage on those lines. There is a 0.1 uF capacitor between the 5V and GND as a decoupling capacitor.

Since the business card should be a compact and thin design, 0604 surface mount packaging is selected for most of the components. The diodes are Mini MELF packaging (they look cool in my opinion).

The microcontroller is an ATtiny85, which is a 8 pin AVR microcontroller. The SOIC package version is chosen to keep the design compact and thin.

To program the microcontroller, in-circuit serial programming is used, which requires the signals: reset, SCK, MOSI, MISO, along with power and ground. The SCK and MOSI are exposed by the USB connector, while two pads are provided for the MISO and reset signals. This allows for a programming adapter to be made.

Step 2: USB Connector

For the business card, the USB connector is actually the PCB itself. This saves on cost, looks great, and it keeps the card thin.

This connector will be a USB male "A" connector, which plugs into a USB female "A" port (the kind found on computers). First, measurements are taken from the USB port. I create an Eagle component with the dimensions (you need to create a library file first), and also place the pads. It is important to use pads because Eagle will remove the soldermask from pad areas by default. We need the pads to be exposed (not covered by soldermask) in order to make a connection with the USB port.

The created connector component is placed onto the PCB layout. The dimension layer must be a continuous line that follows the outline of the business card and the connector. The dimension layer is what the manufacture will follow when milling your PCB outline.

Step 3: Layout

Layout the component as shown, or you can be creative, as long as your layout matches the circuit. For low speed USB, you don't have to worry too much about how the traces are layed out. For high speed designs, you should try to keep the differential D+ and D- signals together and away from noise, but our design is low speed.

Make it look nice! Personally, I like seeing symmetry, parallel or perpendicular angles, and even spacing, but that's my personal preference. You might like curves, abstractness, and chaos. This is all personal preference.

Step 4: Artwork

For my design, I placed my name and some instructions using the text tool in Eagle CAD.

The tStop and bStop layers in Eagle control the soldermask. Soldermask will not be present on the areas covered by tStop or bStop. The "t" and "b" mean "top" and "bottom. This fact can be used to your advantage.

Remember that areas with copper and soldermask will look light green, areas with no copper but with soldermask will look dark green, areas with no copper and with no soldermask will look sort of yellowish. Also remember that more light will go through if the bottom layer is uncovered.

Area with no soldermask but with copper will become tinned. This will be silver if you get your board tinned with regular tin or lead solder. If you want to spend more money, you can ask the PCB manufacture for gold plating instead.

On my own card, you can see that I've placed my own name in both the top copper layer and the tStop layer, thus creating the silver text effect by placing text under an area without any soldermask.

You can also ask the manufacture for other colours aside from green. Here is my friend's University of Waterloo PCB Ruler, created with black solder mask and gold plating (black and gold are my school's colours):

Here are some other possible PCB colour combinations:

Silk screen is the layer usually used for text, it goes over the soldermask. It is usually specified using the "tSilk" and "bSilk" layers in Eagle. It is important to remember that silk screen cannot exist without being on top of soldermask. You can usually ask the manufacture for a specific silk screen colour, the default is usually white silk screen with green soldermask.

Another neat trick is to import bitmap images as components so you can have bitmaps on your PCB, you can do this for any of the layers. Create a component in a library file, and then run the user script called "import-bmp". Save the library and add the component to your PCB.

Step 5: Manufacturing the PCB

You can achieve a really nice "DIY" feel if you etch the PCB yourself, but I choose to go for a "professional" look by sending my PCB design to a PCB manufacture.

Seeed Studio offers a service that can get me 10 pieces for $28 plus shipping, and it takes 5 days to manufacture, plus shipping time. I think this is an extremely good deal.

I have a CAM job (see attached) that you need to load into the CAM processor inside Eagle, running this CAM job will generate a collection of PCB Gerber files that you need to send to Seeed Studio (or another company) in order to get your PCB manufactured. Zip up the file, and email them to the company (after you pay).

Please be aware of the file that your bitmap layer goes into! If you select the bitmap layer in the copper gerber file, then the bitmap will become a part of the PCB's copper. If you select the bitmap layer in the silkscreen gerber file, then the bitmap will become a part of the PCB's silkscreen.

Please use a Gerber file previewing tool before sending it off to manufacturing. I personally use Gerbv http://gerbv.sourceforge.net/

For kicks, I also made some non-USB business cards/keychains, see picture above (I forgot why I blurred the picture). The smaller size made these dirt cheap.

Step 6: Fixing the Connector

It's a good idea to add some solder to the pads of the connector. This makes it more resistant to wear and tear.

Ideally you want 2.4mm thick PCB material, but apparently this costs extra, so the default 1.6mm was used. The USB connector needs to be thicker than 1.6mm so green electrical tape was applied to the back of the connector to add some thickness to it. See above diagram for my technique for applying the tape.

Step 7: Circuit Assembly

Solder all of the electrical components. 0604 sized components are very easy to solder if you have a pair of tweezers.

Put some solder on one pad, keep heating that pad and move the component into that pad, make sure it's aligned correctly, then remove the heat and let the first joint cool. Then you are able to solder the 2nd joint very easily.

Remember, flux can make the difference between a fun project and quitting the electronics hobby. I suggest you get a flux pen.

Step 8: Programming the AVR

You need to download the code provided here.

Open up the file "main.c" and find the place where the string is stored, look for the function "puts_P". You need to edit this string before compiling (or else it will print my text instead of yours). You'll notice that the string is stored in flash memory, and if you compile a longer string, the size of the flash compilation increases. Please be advised that you cannot exceed the memory capacity of the ATtiny85, which is 8KB of flash memory.

After editing the string, compile the code. The ".avrproj" file is a file format that can be opened by AVR Project IDE (a IDE I made for myself), which makes compiling the project very easy.

A hex file is generated and you can write the hex file into the AVR. You need an AVR programmer of some kind, and connected to the business card as shown in the schematic below. Remember to connect those hidden connections!

Also please note that the programmer must be set to use a low speed due to the 68 ohm resistors on the D+ and D- signals. This means the AVRDUDE option "-i <delay>" must be included, so the command looks something like: "avrdude -c programmer_name -p attny85 -i 100 -U flash:w:file_name.hex"

How do you connect the programmer? First take a look at the schematic:

I made a not-so-neat looking programming adapter using a USB port, a AVR ISP connector, and some wire:

Here it is, connected to my USBtinyISP:

This is what the card looks like while being programmed:

Step 9: Explaination of the Code

The code uses V-USB to create a USB keyboard. V-USB is a software package that allows you to make USB devices out of AVR microcontrollers.

Instead of explaining using text, I have a video tutorial about how to build a USB keyboard:


Please note that this two part video is over 15 minutes in total. I've put an incredible amount of effort into the video. Please watch it in 720p full screen so you can read all the text.

I also have another Instructable that will explain more USB and V-USB stuff to you: https://www.instructables.com/id/USB-Wii-Classic-Controller/

The differences between the RFID USB Keyboard and this USB PCB Business Card is that the ATtiny85 is used instead, and the text comes from internal flash memory instead of a serial port. One important aspect to note is the fact that the ATtiny85 uses an internal PLL to generate the clock speed that V-USB requires.

Also read my other USB instructable involving creating more USB devices, where I explain the USB bus, descriptors, and other aspects in more detail.

Step 10: Using the Card

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.

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.

What if it doesn't work

Did you try taking it out and plugging it back in?

Did you plug it in right-side-up? Follow this diagram:

If CAPS-lock doesn't trigger it, then try NUM-lock and scroll-lock (this seems to be a problem with Linux).

If it causes your computer to act weird after unplugging the card, just hit both of your shift keys a few times. This should only be a problem if you unplug the card before it finishes typing, because it may have "held down" the shift key.

<p>nice job, here is my card, if you need PCB,you can go to www.syspcb.com</p>
<p>can you make one of these for me??? i am interested as to having something like this for our entire staff as business cards and looking for the right person that can do it????</p>
<p>Finally i made it, also added led's in it......thanks a ton for guiding FRANK!!</p>
<p>Hello!</p><p>Have you used any compiler optimizations?</p>
can you just use a regular flash drive or sd card?<br>
Very nice Instructable and a very nice product - although I would never plug an USB device given to me by a stranger into my computer (neither private nor at work).<br><br>But at an interview, the idea and the quality of execution alone would mean something.
People are afraid that it'll do &quot;rm -f /&quot;<br><br>I could also (in theory) open up a web browser using a multimedia key and then visit any URL
<p>ah this was what I was looking for... would you be able to elaborate on this? I'm looking to build one so that it opens a browser.</p><p>Thanks</p>
Give them a regular card with a URL on it. If they say that they don't have internet or their internet's down, give them one of these.
<p>i really like the idea of using the chip to hide the two hidden pins from the front while also allowing that to make it more compact (as far as the actual circuit goes).</p>
<p>Thanks for this Instructable! Made it and will use it for my applications!</p>
<p>That is a great and impressive idea but I have a v1.1 idea.<br>You could cut a rectangle on the PCB to the place where the IC sits and solder the IC dead-bug style so that it doesn't stick out that much. Of course the rails would need to be adjusted a bit to match the new layout.</p>
<p>Hello There, this looks great and I want to make something similar but cant find the eagle pcb file. Am I missing something here?</p>
<p>Can I program the attiny with an arduino?</p>
<p>This link explains how:</p><p>https://www.instructables.com/id/Programming-an-Atmel-AtTiny85-using-Arduino-IDE-an/</p>
Very cool idea. Just one quick question please, is it possible to make a custom flash drive like this instead of using a microcontroller?
<p>Of course, it is possible, but iIt would be much harder, depending on your requirements. </p><p>In this project, the micro is acting as a HID keyboard, which is very simple once you have the right library (V-USB). But to make it act as a USB drive, you would of course need something much different. </p><p>The easiest way to achieve this would to find an open source schematic of a USB flash drive and redo the layout into the form of a business card. It would be much more complex.</p>
Can you please fix your schematic as it took me over 10 tries to finally realize that the pin #s are wrong. Other than that great project.
and what is the correct one? was the schematic fixed? thanks
<p>This is more then Awesome!!!</p>
Just a question. Could ou do the same with this but make it hold down a key for the time its plugged in? and how small could you make it?
I can make it hold down a key, but it will keep being held down even if you unplug it, or at least in Windows it will do that, I'm not sure about Mac or Linux.<br><br>Size has nothing to do with this.
Your circuit and you description of the circuit are different. Could you please add a corrected version of the circuit to your instructable. I like the idea and want to try it but I can't get it to work.
I'm amazed that nobody has asked, but can you please elaborate on the use of the vibrator on the soldering iron? Being a teenage lad, it isn't really the kind of thing I just have lying around in a cupboard or whatever!
it's a joke, the joke is that SMD soldering is so easy, you can even do it while holding a vibrator
Ahhh! Right, that makes sense now! I was thinking it was something about making the iron bounce off of the board for a split second so not to over heat anything! Great instructable though! I might have to try it!! <br>
Frank,<br> <br> frankly, this is an awesome project. The ideas to (1) use an HID profile, and to (2) use capslock to &quot;talk&quot; to the card are just terrific.<br> <br> I'm sure you impressed your card recipients.<br> <br> You totally deserved your 1st prize in the <a href="https://www.instructables.com/contest/usb2011/?show=WINNERS">USB contest</a>. Did you get your HP TouchPad? What will you do with it? hack it?<br> <br> &nbsp; Pascal<br>
Hi Pascal<br><br>Thanks for the kind words.<br><br>I didn't get the HP Touchpad because it was being discontinued, I received a prize of equivalent value instead.<br><br>On a somewhat related subject (since now people are hacking the HP Touchpad with Android), I did recently get my first ever smartphone, a Samsung Galaxy Infuse 4G, running Android 2.3. I also got a Micropendous. So I am completely ready to start hacking with Android ADK.
Did you end up hacking the ADK??
I really appreciate your effort to show how easy it is to solder 0603 SMT ... honestly I do. Great job! However... it's still wrong on so many levels ;-) Great Instructable!
Hey there! Pardon me if i missed it, but what is the cost of these per (1) assembled at home. And what would it cost to have these manufactured?
Very cool !! thank's a lot for sharing
Very awesome! ... .. Vibrator... #$*%ing PRO!
What happened to the picture of the USB connector? It was cool to see the details on the pcb layout. Perhaps I am missing something. It looks like you can download the files to do the project yourself but I cannot find the file for the pcb.
Thanks for bring this to my attention, I've formatted my Instructables in HTML and they seem to have disappeared, causing most of my pictures to be missing.<br><br>see:<br><br>https://www.instructables.com/community/All-my-HTML-disappeared/<br><br>I'll add the PCB file soon.
im not that good with computers.. is there a way i can do that with a flash drive??
Nobody answered my question so i went searching.. the answer is yes you can do it with a flash drive. its actually pretty neat and u don't have to be a genius to do it.
how does one get his hands on one of these? its awesome!!
Wow, thats pretty slick but people might shy away and think that you are controlling their computer... Ive done things like this and some of the more computer illiterate freak out and shout &quot;VIRUS&quot; great design though
I can't help but do a double post here...Using this for handing out a resume is an instant job offer in my opinion.
WOW!!! Never thought of that... but I just found this so it's too late for me.
That is godly bro, +1000 internets to you.
Felicitaciones un excelente proyecto, Congratulations, one excelent project
Nice job, I like it a lot!!
I sincerely hope this wins first prize. You deserve it!
Can you please supply the full specifications on the diodes (Forward voltage, etc) or a product code.<br>Kthxbye
look for 1N5227B
I'm disappointed that my second entry into the contest did not become a finalist (or even get featured...)<br><br>https://www.instructables.com/id/USB-Wii-Classic-Controller/<br><br>I actually think it is far more educational about USB than this Instructable, which focused on &quot;art&quot; more<br><br>Anyways, check it out if you are interested in how USB mouse/keyboard/gamepad works

About This Instructable




Bio: I am an electrical engineer. I graduated from U of Waterloo. I used to work for Adafruit Industries as an EE. Now I work for ... More »
More by frank26080115:LED Pocket Watch Easy Cord Wrapping Around Power Bricks Using SMD Components on Breadboards 
Add instructable to: