step 1About The Design
This is the sort of card that would suit a high-tech business, or those who were involved in high-value contracts, where an innovative image is all important. I would never suggest that it would replace a conventional business card, but to impress that all-important prospective client, there would be more than a few companies who would be happy to spend just an extra few dollars. Like the flashlight card, the aim is to design a business card that people just can't throw away!
The design is really quite simple for what it does - a matrix of 5x15 LEDs, connected to a single-chip "PIC"microcontroller. A handful of resistors and switches complete the design (Schematic available below). By keeping the microcontroller in sleep mode unless the buttons are pressed, the battery can last several years, and still allow a couple of thousand displays of your messages.
The design is really quite simple for what it does - a matrix of 5x15 LEDs, connected to a single-chip "PIC"microcontroller. A handful of resistors and switches complete the design (Schematic available below). By keeping the microcontroller in sleep mode unless the buttons are pressed, the battery can last several years, and still allow a couple of thousand displays of your messages.
step 2What you need
- One CR2032 battery (I got them for about 16 cents on ebay when I bought 100)
- One CR2032 battery holder (I used part 18-3780 from www.rapidonline.com. This costs around 14 cents in quantities of 100 - these are a common type of holder that you should be able to find at places like www.mouser.com if you are on the other side of the Atlantic to me!)
- One PIC16F57 (Order code 1556188 from www.farnell.com - These cost 66 cents each in 100+ quantities - again, you can find them at www.mouser.com)
- Four surface mount switches (Part 78-1130 from www.rapidonline.com at 20 cents each)
- Some miscellaneous resistors and capacitors in an "0805" surface-mount package - you will need 5x100 ohm resistors, 2x10k resistors, 1x47k resistor, 1x47p capacitor, and 1x100n capacitor - any of the suppliers mentioned above do these, and they cost almost nothing!
- 75x "0603" LEDS - as bright as possible, and as cheap as possible! I used item 72-8742 at 6 cents each from Rapid, but again, you should be able to get them at other suppliers. In quantity, you can get these down to about 3 cents each.
- Some double-sided foam adhesive tape that is slightly thicker than the battery you are using - mine was 4.5mm thick)
- A printed circuit board (PCB) for the project - instructions for producing your own are beyond the scope of this article, but you may have some success with the iron-on or photographic technique (my preferred technique). You can find instructions for making your own printed circuit boards elsewhere on instructables and other sites. The PCB layout is reproduced below in a PDF file if you want to try yourself.
step 3Soldering Starts!
Solder the components onto the board, starting with the smallest first (Refer to photos). A pair of tweezers is useful here - by putting a blob of solder on a pad, and then re-melting it whilst positioning the resistors or capacitors with the tweezers, you can neatly add these small components. It doesn't matter which way around these components go, but it does for the PIC (which should read with the writing the correct way up as shown in these photos), and also the LEDs must be put around the right way. It is harder to tell with the LEDs which way around they should go - the top connection should be the positive (or "anode"). You can tell by consulting the datasheet for the LED - one of the two leads will usually be marked in some way. An easier way is sometimes to test one of them by attaching a couple of wires to a small 1.5V battery, and then touching the leads on the ends of the LEDs - if it is the right way around, you should see a glow, but if using a single 1.5V battery, it will be extremely faint, so you will have to observe carefully. Again, a tutorial on soldering is not within the scope of this article - I did warn you that this isn't a beginner's project, so don't make this one your first venture into surface mount soldering! Note that the LEDs are only initially soldered on their bottom lead - we will use some wires later to connect their top leads.
step 4An ad-hoc double sided board
Lay some fine strips of 'invisible tape' down along the vertical PCB traces next to each column of LEDs - this will stop the wires we are about to solder touching them.
Next, solder some fine tinned copper wire along the top of each row of LEDs, to reach all the way to the resistor as in the photo. Note that you will need only four wires - the top one will not be needed if you use the PCB layout given in this article, as it uses a PCB trace to connect the components.
Next, solder some fine tinned copper wire along the top of each row of LEDs, to reach all the way to the resistor as in the photo. Note that you will need only four wires - the top one will not be needed if you use the PCB layout given in this article, as it uses a PCB trace to connect the components.
step 5Programming
The next step is to put the dialling program into the chip. If you have bought the PIC Kit 2 programmer, it has everything you need with it. Download the MatrixCode.zip file from this page, unzip it and put it in a directory somewhere on your computer - then from within the MPLAB IDE, go to the "Project" menu, select "Open", and navigate to the "main.asm" file. Change the stored messages (around line 115 in the code) to your contact details rather than mine(!) - the messages are spelt out with a series of '1's and '0's - a '1' means the LED is on. If you look closely, you will see my name spelt out with '1's. (You might need to turn your head 90 degrees to see this!) You have complete freedom to make your own characters or symbols, so you could have, for example, a simple animation of a car moving to the left if you wanted. Note that there are four messages - one for each button - you will need to specify the length of each message by stating the number of columns it takes up in the 'MSG1LEN,MSG2LEN...' definitions.
Go to the "Project" menu again, and select "Quickbuild" - check there are no errors, and you are then ready to program. I use a simple technique of inserting a broken-off strip of 5 pins from a strip of 0.1" header pins into the programmer, and then just touching the 5 pins whilst programming. This is a little fiddly, but as the erase or program cycle only takes a second or so, it is quite manageable. The arrow on the end pin of the programmer should align with the top pin of the PCB (NOT AS SHOWN IN THIS PHOTO - WHOOPS!) If you are experimenting, it is well worth soldering the strip of 5 pins onto the board until you have finished your changes. When you are ready to program, you will have to use the separate 'PICKIT2' utility supplied with the programmer, as for some reason, the MPLAB IDE doesn't support programming of the PIC16F57 directly. To do this, you need to specifify the family of PICs ("baseline"), and the particular part (16F57), before loading the Hex file created in the previous step, and then finally programming the chip. If all is successful, you should be able to insert the battery (positive side down), and press one of the buttons to see your message scroll along!
Go to the "Project" menu again, and select "Quickbuild" - check there are no errors, and you are then ready to program. I use a simple technique of inserting a broken-off strip of 5 pins from a strip of 0.1" header pins into the programmer, and then just touching the 5 pins whilst programming. This is a little fiddly, but as the erase or program cycle only takes a second or so, it is quite manageable. The arrow on the end pin of the programmer should align with the top pin of the PCB (NOT AS SHOWN IN THIS PHOTO - WHOOPS!) If you are experimenting, it is well worth soldering the strip of 5 pins onto the board until you have finished your changes. When you are ready to program, you will have to use the separate 'PICKIT2' utility supplied with the programmer, as for some reason, the MPLAB IDE doesn't support programming of the PIC16F57 directly. To do this, you need to specifify the family of PICs ("baseline"), and the particular part (16F57), before loading the Hex file created in the previous step, and then finally programming the chip. If all is successful, you should be able to insert the battery (positive side down), and press one of the buttons to see your message scroll along!
step 6Finishing Off
To encapsulate the prototype, I applied some double sided foam tape to the board, turned it upside down, and then cut the excess off. I then reverse-printed the graphic overlay on an OHP transparency sheet. By turning the sheet over, and attaching a white printer label, you can get the clear icons on the transparency to show up white. I also attached a sheet of thick polypropylene (made as a cover for binding documents) to the overlay using some adhesive spray before attaching to the front of the card and trimming off the excess. If you wanted to use the same graphic as mine, it is also available on this page as a PDF.
step 7The Finished Product
The finished product is shown below. You can now relax, content that you have the world's most advanced business card (at least until I make my next one which will have a colour OLED screen!)
Balloona Privat
ReplyDeleteBalloona's Blog
謝謝您囉~~很好的經驗分享! .................................................................
ReplyDelete