3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.


Complete Circuit Board Lab & POV Business Card

Step 6Design the Board

Design the Board
«
  • Layer-1---PCB-etch-mask.png
  • Layer-2-solder-paste-stencil.png
  • Layer-3-ICSP-pin-pads.png
  • Layer-4-component-placement.png
  • Layer-5-completed-board.png
  • POV-card-schematic-1.1.png
  • S7302146.JPG
  • circuit sketch.png
  • POV-Card---PCB--prototype.png
  • Circular concept.png
  • IMG_3380.JPG
  • IMG_3384.JPG
  • last photo ←
»
This really was the most time consuming step; that is, designing and planning the entire device. The goal is to make a 5 LED microcontroller-based circuit with a small enough part count to fit on a 2" by 3.5" standard business card. It has to be a single sided board to reduce complexity, and it has to be built entirely with surface mount components to save on time drilling holes, keep the profile as thin as possible, and keep the end user from getting poked by leads sticking out of the bottom. Most importantly, it needs to be cheap and quick to make. Again, that means a reduced parts count and surface mount components.

The Microcontroller
_______________________________________________________________________


I ended up designing the whole thing around the Microchip PIC12F508 , the smallest, cheapest microcontroller I could find with the right number of pin outs. With no interrupts or PWM, the PIC12F508 is nothing fancy, but it definitely gets the job done. At the time of writing, they run around 46 cents apiece. Similar chips are available from ATMEL, under the AVR banner, and are more full featured, but cost about twice as much. And in the quantities I want, that matters.

The PICF508 runs nominally at 4MHz on its internal oscillator. It has only 750 bytes of program memory, and 25 bytes of RAM, but we don't need that much, anyway. It also does not have interrupts or PWM, but, again, we can get by without those. As far as I/O goes, it has exactly enough. There are 8 pins, two for power, and 6 I/O pins, one of which is input only. We already know what that means: It will have five LEDs and one sensor, and that's it. The most important feature is that it is programmable in-circuit (ICSP), meaning you  don't have to take it off the board to reprogram it; an important point when you are dealing with a soldered on SMD part.

When running a program, pins 2, 3, 5, 6, 7 of the PIC are configured as 3V LED ouputs, pin 4 as an input, and 1 and 8 are 3V dc power inputs.

In ICSP mode, the PIC is programmed over five pins:

Pin           Function

1              Vdd
2              (unused)
3              (unused)
4               Vpp
5              (unused)
6              ICSP CLOCK
7              ICSP DATA
8              Vss

The Circuit
_______________________________________________________________________


That decision made, the rest comes easy, up to a point. Aside from the five LEDs and their current limiting resistors, a tilt switch that pulls Pin 4 (GP3) low when the the board is tilted, a bypass capacitor across pin 1 and 8 (.1 uF C1) to prevent erratic CPU behavior, and a momentary power switch to prevent battery drain, there isn't much to it. It's simple, as promised. And with the right program, it can do anything! Anything at all. The only limit is yourself!

I spent a bit of time obsessing about the other components; I ordered about 20 different tactile switches from DigiKey to find the thinnest, nicest looking, softest feeling tactile switch possible. SInce the battery will overheat (and potentiall explode) if soldered to, I played around with conductive epoxy and conductive tape, with no luck. In the end I bit the bullet and paid the 26 cents apiece of nice, solid, SMD battery retaining clips. They ended up fitting into the design fairly well, too.

Now all there is to do is obsess about the artistry of the PCB layout, and we're done. Ironically, I put more time into proportion and layout than anything else on this project, and it gets three sentences of description.

Well, the thing does have be pretty, after all.


Improvements
_______________________________________________________________________


The final design does leave room for improvement. For one thing, it needs much brighter LEDs so it can be seen better in bright light. Also the tilt switch makes it seem kind of cheap, e.g. "What is that thing rattling around? Is it broken?" Other flaws, such as having to wave it to see anything, are intrinsic to the design and were accepted before I even began. Incidentally, it ends up being something of an intelligence test if you don't explain how it works, but there is a definite advantage of that; only the people who can figure it out will be giving me a call. :)

In order for ICSP to work there cannot be any interfering components on the pins it uses I had quite a bit of trouble with this. After modifying the original copper trace design, and rearranging the ICSP pads (but still matching the schematic exactly!), I found that I could not program boards anymore. The easy solution is to remove the capacitor connecting pin 1 and 8, and it works properly now. The component isn't integral to the design, anyway.


References
  1. PIC12F508/509/16F505 Datasheet
Parts
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
65
Followers
5
Author:sponges