Friday, August 28, 2009

Simple DIY PCB Etching

Want to fabricate printed circuit boards (PCB) at home, cheaply, quickly, and easily? So did I.

The tips on these sites worked for me but I have learned more. Read on....
Experimentation and perseverance help. It's ok if you goof up a few times; I did. Hang in there and you'll be a DIY pcb etching guru soon! Find out what works for you, and you're set.

Start with a small, simple circuit and stick to single sided traces! My first circuit was for a 12V/5V dual power supply circuit for another project. It uses only a handful of components.

The design layout fills a 2" square area, using up only a fraction of an already cheap (under $4) PCB blank from the local Radio Shack. In case the etching went poorly, I had enough PCB material to try it a few more times.

PCB Layout and Design
How did I do the printed circuit board layout in the first place? I like to use CadSsoft Eagle which does integrated schematic drawing and PCB layout. I can offer a some tips:
  • Use wirepads (search for wirepad in the Eagle libraries) or pin headers for external interfaces not appearing in the schematic, like the transformer secondary wires, in this case.
  • Use the DRC dialog and Restring tab to change the size of pads; bigger pads are better for manual drilling.
  • Put all traces on the bottom layer so when you print the transfer you can uncheck "mirror"
  • When you print the PCB transfer, hide all the layers you don't want to appear as copper traces, then print with the "black" checkbox option set (see picture to the right)
  • For off-board components like rotary switches, create a custom package in the Eagle library comprised only of wire pads but using the correct schematic symbol.
  • Include dimension lines in the transfer print but make them at least 16 mil.
  • Create fill areas (pour regions) with Eagle, particularly for GND, instead of leaving lots of blank spaces on the PCB.  Saves etchant and time etching. It also saves time laying out the board.
Example of using Eagle Fill Area (Polygon) for GND
    Single Sided Impossible?  Cheat!
    Can't figure out how to fit all the traces on one side?  Cheat!  Use jumper wires  as in the board above and below. Many of the consumer electronics I've taken apart use bus wire.  It's quick to install since there's no insulation to strip.

    Jumper a trace on the "top" of the board with pads.

    • Add two pads where you want your jumpers. 
    • Change their name to match the net you're trying to jumper (e.g., VCC).
    • Draw a trace between these pads on the "top" side of the board (red) to represent the wire
    • Draw traces on the bottom side (blue) to the pads.
    • When you print the PCB (see below) hide the top layer.
    • Drill the holes, and run wire between these two pads
    Magazine Paper Transfer
    Several websites give tips on laser printing on magazine paper and transferring to the printed circuit board. Laser printing (and photocopying) uses melted plastic instead of ink. By applying heat heat, the plastic melts itself to the PCB, then the magazine paper can be soaked in water and rubbed off, leaving the laser print behind as a mask for the etching solution.

    A few companies provide store bought solutions for transferring trace masks to the PCB but those are obviously more expensive than using scrap magazines. I haven't tried them yet.

    Ricci Bitti's website gave the best advice. Printing on magazine paper was no problem and you can easily see the matte laserprint on the material.

    Toner transfer, ready to iron onto the PCB

    Here are some additional tips:

    • Cut down the magazine paper and tape it to scrap laser paper to prevent jams
    • Use the "Wool" (1 below Cotton, 2 below Linen) setting on your iron
    • Use green ScotchBrite pads for cleaning, abrading the PCB
    • Clean the board with acetone (carb/choke cleaner)
    • Apply moderate pressure, and slow circular movement on the iron for about 60 seconds.



    Et voila, after six or more failed attempts, I finally got a good transfer!

    A few of the traces are a little blotchy, but none of the pads are. The fine detail turned out beautifully. Like you can see in the picture, the tiny printing and the crosshairs in the corner drill holes retained their detail.



    I've since found better results when using traces no wider than 32 mil with good results at 24 and 16 mil. Smaller traces are unlikely to work well. You can repair any flaws in the transfer with a fine tip or ultra fine tip Sharpie permanent marker which conveniently resists etchant.

    Etching
    The common chemical of choice for DIY PCB etching is ferric chloride and that's what i use. You can get it from Radio Shackicon. Use suitable disposable gloves to keep the FeCl off your hands. They stain everything yellow. You don't want to look like a Simpsons character. Work in a well ventilated area.

    To speed up pcb etching times, I now use a hot water bath. Put the FeCl in a small disposable tupperware tub. Put water in an electric skillet (I use my reflow skillet). Of course don't use it for food anymore! Put the tub in the water, and heat up the water to somewhat below the "warm" setting.

    Boards usually etch in about 15-30 minutes. Don't let it go too long or it'll etch through the toner. So check it after 15 minutes and ever 5 minutes after that. I no longer use the FeCl-soaked sponge method. Too messy!

    Once your pcb etching is complete, dip the board in water to rinse and neutralize the FeCl then wipe off the toner with acetone (spray carb cleaner) and a paper towel.

    On my first fabricated board (below) the etching worked really well and even the smallest printing came out perfectly. There were a couple of small spots of toner that separated leaving tiny spots on a couple traces that were a little etched.

     

    Pseudo Silk Screen
    You can do your own "silk screen" printing on the top layer, too. But without real silk screen.  Just use the toner transfer method to transfer printing onto the top of the board to show what components go where.
    • In Eagle, hide all layers except tplace, dimensions, tname, tvalue, and tdocu
    • Use the 'smash' function to enable moving and resizing the labels
    • Add any other text you want (name, copyright, copyleft, whatever)
    • When printing, select print in black and select the mirror image checkbox
    • It's best to drill holes before you silkscreen; it gives you something to align to.
    • Align the printed image to the board and holes.
    • Toner transfer the image onto the blank side of the board.
    Try to do a better job of aligning your "silkscreen" than I...
    Update
    After fabricating many printed circuit boards over the last few years since I first wrote this article, I've been etching more surface mount boards using 16 mil traces with 0805 and 0603 size SMD components, as well as SOIC, SSOP, SOT-223, SOT-23 and 0.6mm QFP packages! Not bad for DIY, eh?

    Here's a couple examples that turned out very nicely. The ability to transfer such fine detail opens up a world of possibilities in board design. I used a Reflow Skillet to populate both boards. I've since started using my Weller station with fine tip along with fine SMD tweezers for the small passives.

    16 mil traces with 0603 SMD components.
    Board populated with 0603, TSSOP-8, etc
    Conclusion
    With a little experimentation and perseverance in the face of multiple failures, I was able to reliably etch my own through hole and surface mount printed circuit boards. If you follow these tips, you'll soon be doing the same and a new world of hobby electronics will open itself up to you..

    But hey if you got this far and still don't feel comfortable trying it, then give oshpark.com a try. I highly recommend them and use them all the time. Affordable and outstanding quality.

    Next: Drilling

    Friday, August 21, 2009

    Oscilloscope Calibrator: Part 1

    Intro

    Heathkit IG-4505, photo from www.museudatecnologia.net.br
    The mini function generator project was a decent first step back into enclosure building and playing around with oscillators. I now have a reasonably compact device I can use to demo oscilloscopes that I find, fix, and resell. But...

    I really would like an oscilloscope calibrator, like the Heathkit IG-4505, to tune up my 'scopes. Sure, I could spend the $30-60 on a used, pre-assembled specimen, even find an unassembled kit. In the meanwhile, I want to play around with the circuitry and possibly build my own from scratch. But how?

    If you spend any time on Electro Tech Online, and if you're an old school digital logic kinda person like me, you quickly notice that the answer to all problems seems to be: "use a microcontroller." Ok, sure, a tiny little 8-pin DIP can easily solve a LOT of problems including this one and I may eventually build an MCU version of the calibrator.

    Doing so misses out on they joy and thrill to be found in assembling a bunch of giant, antiquated PDIP logic ICs into something useful that requires no software and no PC (I can think of one blogger who would probably approve). Plus, a bunch of TTL ICs look cool on a breadboard. So today it's time to flash back to decades past when TTL ruled the world.

    Rather than starting with a blank slate, an easier starting point is reverse engineering the Heathkit calibrator and emulating the circuit with similar ICs. I'll breadboard a prototype of the circuit to make sure this is going to work. The schematic can be found here. It comes in zip form, two pages.

    Functionality

    What does it do? The 4505 provides square wave output pulses at periods of 1uS, 10uS, .1mS, 1mS, 10mS, and 100mS. It also provides a feature to increase the periodicity of the signal by 2X and 5X. Lastly, output levels can be adjusted from 1mV to 100V in 10X steps. This functionality allows the technician to calibrate the scope's time base and vertical amplifier so it reads accurately. I put together a block diagram, below, which helps decompose the problem. We'll focus on the clock and frequency divider sections.
    Clock Circuit
    The clock circuit in the IG-4505 circuit starts with a 4MHz crystal oscillator (see picture below, lower left, labeled 4MHz). This signal is then divided down to lower frequencies by TTL counters. Instead of a crystal, I happened to find some 4MHz ceramic resonators on my favorite electronics surplus site so I ordered a couple. They have about a ±0.5% precision with ±0.3% temperature drift, so about 12-32kHz error at 4MHz. That'd be terrible for calibrating a high precision frequency counter but it'll be fine for an analog oscilloscope. The error on a typical screen would be on the order of hundreths of an inch!
    The suggested drive circuitry on the resonator's datasheet is a little different than what's used in the Heathkit for the crystal, and requires a pair of CMOS inverters; that is, two gates from a 74HC04 IC. Apparently the crystal doesn't output enough current to drive anything but CMOS, since I tried a 74LS04 to no avail.
    Upon wiring it up on the breadboard, this circuit produces a sort of ugly pseudo square wave, actually more like a capacitor charge/discharge waveform (or perhaps my oscilloscope isn't up to the task), but the signal is adequate to drive the counters. So that's the clock circuit.

    Frequency Divider

    About the counters. Starting with 4MHz, we need to divide by 2 and again by 2 to arrive at a 1MHz signal. Then divide that signal by 2 for 2X. Divide that same signal by 5 for 5X. The Heathkit circuit uses 1/2 of a 7474 dual flip flop to do the initial ÷ 2 (2MHz). The flip flop is wired to output a pulse for every other clock pulse it receives.
    A 7490 Decade Counter is used to output pulses for ÷ 2 (1MHz) and ÷ 5 (400kHz). A switch selects the 1X/2X/5X signal. Then the other 1/2 of the 7474 is used for a final ÷ 2 to get the 1MHz, 0.5MHz, or 0.2MHz signal selected by the switch. Five 7490's are used to divide this signal by 10, 100, 1K, 10K, and 100K.

    Since I couldn't easily find any 7474's or 7490's, I looked around for various counters and ran across the 74393 Dual Binary Counter and hte 74162 Decade Counter. The '393 has four output pins, one per bit of the 4-bit (nybble) count, call them Q0-Q3. The Q0 signal is 1/2 the frequency of the clock input and the Q1 signal is 1/4 the clock frequency.

    In case you're not up on binary counters used as frequency dividers... Counting in binary (000, 001, 010, 011, 100, 101, 110, 111) the Q0 bit goes high every other clock pulse, so if we feed our 4MHz signal into the '393's clock pin, Q0 oscillates at 2MHz. Likewise, the Q1 output it goes high every 3rd and 4th clock pulse, half as often as Q0, and 1/4 as often as the clock pulse, or 1MHz in our case. I didn't want to bother with a 5X option so for now my plans are for a switch to select 1X or 2X.
    On the breadboard, below left, I just hardwired the ÷ 4 (Q1) output. Initially I had problems getting the counter to work until I realized that the reset/clear/MR pin has to be wired low. Here's a scope trace showing the 1MHz pulsetrain on top and the original resonator/dual inverter output at the bottom.

    Finally, the 74LS162 I chose is a decade counter. You can configure it to do all sorts of things but what I wanted it to do was to count from 0 to 9, wrapping around to 0, and output a pulse every time the counter reaches 9 so as to generate a signal at 1/10th the clock frequency.

    The chip provides a terminal counter (TC) aka ripple counter (RC0) pin, and there are a few pins that have to be set high to get the desired behavior, as described in the datasheet. ENT is Enable Terminal Counter, ENP is Enable Parallel, and the datasheet says to tie CLR to high through a resistor. The 1MHz Q1 output from the '393 is fed into the clock input of the '162.
    Upon wiring this up on the breadboard (lower left), I was able to get pulses at a 100kHz frequency. The scope trace of the TC pin is shown at the top, the original 4MHz signal at the bottom. (By the way, I'm also finding my scope's timebase calibration is a little bit off).

    Since the 1MHz and ÷10 (100kHz) signals are covered, it's just a matter of sticking 4 more '162s into the circuit, just like the first, to add ÷100 (10kHz), ÷1K (1kHz), ÷10K (100Hz) and ÷100K (10Hz) signals. The circuit diagram for the complete set of '162s is below.

    The TC outputs of each '162 will feed to a rotary switch that'll select the period/frequency of the signal and pass it along to the amplitude amplifier, which I'll experiment with next.

    But for now, the proof of concept I wanted to put together for the clock and frequency divider is done. And it actually worked! How cool is that?

    Part 2: Amplitude
    Part 3: Power Supply
    Part 4: coming soon


    EDIT: two years later I've revisited this circuit again and am in the process of finishing the build.

    Thursday, August 20, 2009

    What I've been up to

    As time permits I've been tinkering on several projects, some of which I'll share in upcoming posts.
    • A new and small robot, Pyoony, made from repurposed electronics parts
    • An oscilloscope calibrator based on the Heathkit IG-4505 schematic
    • Experiments in home PCB fabrication
    • Infrared repeater (extender) circuit
    • A high efficiency voltage regulator for the IR circuit
    And some of which I won't...
    • Repairing a Harman Kardon 680i receiver that I blew up
    • Remote diagnosis of a broken Protek P3502 oscilloscope on an electronics forum
    • Repair of a BIC 940 turntable
    Of course I'm most busy with our little one, but I fit in a little time here and there for the above.

    Friday, August 14, 2009

    Edward Isaac Bot: Sketchbook 4

    Here's another artifact from the old EIB sketchbook. I was trying to figure out how I was going to build the mechanicals for the shoulder, arm, and elbow.

    The concept is a drive sprocket for the elbow that shares the same rotational axis as the shoulder and its drive sprocket. The elbow drive sprocket in turn drives a sprocket in the elbow with the chain running through two arm parallel arm tubes. The sketch needs a little work. The shoulder's axle would have to ride on bearings, while containing bearings that support the inner elbow axle. A sprocket would be attached to each axle.

    Why actuate the elbow this way rather than having a motor attached to the arm itself? So all the big arm motors could sit inside the chassis instead of adding weight and bulk to the arms. And center of gravity can be kept low. Is it workable, practical? I have no idea.
    Never did try to make this. The other concept in play here was that the shoulder would be somewhat easy to remove, by undoing a few lug nuts similar to removing a tire. Speaking of automotive analogies...

    This sketch got me to thinking about the many times in the intervening years that I've taken apart my Jeep's front hub and full floating axle assembly (see pic below). Maybe axle designs will be of interest to the robot designer...

    The way a 4x4 floating front axle works is this. The tire is bolted to the hub. The hub (67) spins on the spindle (62) by way of inner and outer wheel bearings (65, 66). These bearings bear the weight of the vehicle, which is transferred through the suspension to the axle housing, to which the spindle is attached.

    Meanwhile, the spindle is just a tube and through it runs the axle shaft (56). A bearing inside the spindle (61) supports the axle shaft. The end of the axle shaft has splines cut into it. The inner surface of the hub has splines, too. A drive flange is a puck of steel with a hole in the middle. The hole has splines and slides onto the axle shaft splines. The outer edge of the flange has splines too and those engage the hub splines. But most 4x4s use manual locking "hubs" (73-76) instead of a drive flange so that the axle shaft can be engaged with the hub & rotor assembly (67) when in 4wd and disengaged when in 2wd.

    Kind of an interesting concept that allows the axle tube, bearings, spindle to bear the weight of the vehicle, so that the only thing the axle shaft does is transfer torque. By contrast, in a semi-floating axle like you'd find on the rear of 1/2 ton trucks with "live" axles, the wheel bearings are pressed onto the axle shaft and ride on a race that is mounted in the axle tube.

    The axle shaft has a mounting flange to which the wheel is bolted. In other words, the weight is borne by both the axle tube and the axle shaft itself. This type of axle generally is able to carry less weight than a full floating axle of similar size because the axle takes on double duty.

    So, that's 4x4 axles in a nutshell...

    Saturday, August 8, 2009

    Organizing Electronics Parts


    The arrival of the TGIMBOEJ was a great kick in the pants to finally organize my electronics parts. I had to find some cool gizmos to go in the box so might as well organize while I'm at it.

    For capacitors and non-static sensitive semiconductors like BJTs, LEDs, and diodes, I used some cheap, divided containers from Home Depot.

    For the static-sensitive stuff, I found some nice conductive boxes at Stanley Supply Services. I ordered a multi-compartment container to store MOSFETs, voltage regulators, etc., and a box with conductive foam for DIP ICs.


    For the moment, cardboard CD mailers hold my stock of 1/4 watt resistors, sorted by order of magnitude. I may look into getting better organizers to make it easier to find resistors quickly.

    Meanwhile, ongoing projects are stored either in large used yogurt tubs (yes, they were run through the dishwasher first! yuck!) , 6"x4"x12" clear plastic containers with lids, pill containers or whatever else I can find.

    Small hardware like screws, nuts, bolts, casters, brackets, and so on will go in pill containers. Larger stuff, along with those pill containers, will go in a plastic tub.

    Wire and connectors are stored in one of the clear plastic tub containers.

    Readers, what do you use to organize your parts?

    Thursday, August 6, 2009

    TGIMBOEJ is on its way!


    The TGIMBOEJ I received a few weeks ago is finally packed and ready. I've taken a few things out, added some things in, and by evening, it'll be on its way to one Mr. J. Barrett of grinanbarret.com.

    He assures me he'll add some neato stuff to the box and I have no doubt he'll come up with some cool projects out of some of the contents, too!