Make:Projects build plans for this. You can find a link to this completed project here: Operating Railroad Grade Crossing Signal over on the Make Magazine site. Or you can generate your own PDF version by clicking here.
I used Make:Projects because I found the interface very easy to use, especially since it allowed bulk import of steps.
As before you can find the entire design package zipped (here) for download.
Note: You can find the project files on GoogleDrive located here. Please feel free to download what you find interesting. I will be adding to the documentations over the coming weeks, moths as I find time.
Shown here is a video of an updated build of my earlier Railroad Crossing Signal built sometime back in 2007. At that time I didn't have any idea what exactly I was going to end up with or even how I was going to go about it. Needless to say; without a plan it was a pretty painful process. Lots of mistakes were made, lots of creative problem solving was required and lots of expense trying to work things out. But my motivation was to make something fun for my son, so to that end it was all just fine.
Click above for a short video showing operation.
Recently I have had some interest in what I have done. Mainly people have been interested in making one themself for their own outdoor railroads, train shows, clubs and/or railroad demonstrations. So for the re-build I decided to try to find more efficient ways of doing things by using mostly things I could find off the shelf in typical home improvement and hardware stores. My efforts were focused on making minimal changes to these parts and using them pretty much as is (at least as much as possible). My hope is that by making this a bit simpler to build, similar signals might be made more easily by others.
electronic controller was also very complicated. In fact I can honestly say I had no idea what I was thinking. Transformers? power transistors? A 555 timer? Very difficult to build and get working the first time, let alone tring to make another just like it. So for that I also redesigned the controller as well. This time I built a PCB and used a microcontroller. Probably overkill, but the flexibility a microcontroller offers is unparalleled by discrete hardware. In addition, I also designed in a 5 VDC switching power supply for the controller and used MOSFETs for the lights and bell output control. The electronic controller project is detailed separately here. All project files for the controller are available and maintained on that site. Please feel free to use and improve on my design as you see fit.
wall thimble' used to route exhaust lines in a home. Paint these flat black and you have a couple of nice sun blockers. For the bell I used the same Ace Hardware doorbell which seems to work well and sounds great in this application. Crossbucks are made from tempered hardboard and vinyl-cut lettering (also in the earlier design). Since I started this redesign a few months back I have been made aware of a site which offers aluminum crossbuck signs which I think overall is a much better and cheaper alternative than making them yourself as I did. Please check them out. Finally the base itself was greatly improved by using the ideas a friend named "Doc" discovered. The new "H-base" I now realize is a much better way to go about mounting this thing. Much easier than a plywood box. Lighter as well! Which makes the whole thing very transportable. Just unscrew the main mast parts and away it goes.
Google (now Trimble) Sketchup. What a great tool. The tool is free and helps you visual what you are building before you start cutting and glueing up pieces. You can find my model of this signal online here in the 3D Warehouse.
Check the link below for a package download (.zip) of all the design files I have; parts list, cut templates, sketch-up model, stencils and diagrams. Alternatively check the Google Drive site where I have all the project files stored. I plan on writing a detailed step-by-step project build on the Make:Projects site. I will post an update when that happens. Hopefully for now these photos and the link to downloads below will suffice. As always please feel free to contact me if you require any specific details. I am happy to help where I can.
Thanks for looking!
Note: All design, source and PCB files are located on GitHub. Please see that site for all design details.Railroad Grade Crossing Signal Controller (GCSC) I built sometime back in 2009. The original circuit was quite a mess. In fact I can honestly say I had no idea what I was thinking. Transformers? Power Transistors? A 555 timer? Very difficult to build and get working the first time and consistently, let alone make another.
So like most projects having a chance to rethink it is always very enlightening. This time I built a PCB and used a Microchip PIC12 microcontroller. Probably overkill, but the flexibility a microcontroller offers is unparalleled to discrete hardware with resistors and capacitors. Although the controller only has 25 bytes of RAM and 768-bytes of ROM it is still way over powered; but at the low end of the product line, it is perfect for this application. In addition the new MCU based controller, I also built in a small switching power supply. The lamps and bell are now both driven by MOSFETs. No bulky transformers and no moving parts. The controller does pretty much what the old one did. In response to a button press it turns on the lights (alternating) and strikes the bell about every 2/3 second for about 30 seconds or until cancelled with another button press. A long press keeps the signal on till pressed again.
Another thing about this board is you will notice is that there are plenty of breakout pins available for the microcontroller and output MOSFETs and input trigger. The addition of an ICSP header also allows this board to be directly programmed with a Microchip PicKit3. This along with the on-board power supply makes this board a nice development system for future projects as well. The board will accomodate any 8-pin Microchip PIC MCU.
I also am trying to give GitHub a try. GitHub provides a free collaborative development environment for open source projects. I have posted to the repository a complete set of design files. This includes my design documents, source code and hardware files to build the controller. A link to the project site can be found here. All project files for the controller are available and maintained on that site. All further updates will also be on that site. Please feel free to use and improve on my design.
One of the tools I found very helpful in creating the new design is Google (now Trimble) Sketchup. What a great tool. The tool is free and you can view the board in 3D, allowing you to spin and rotate the board in any direction. You can find my model online here.
I plan on writing a detailed project build on the Make:Projects site on how to build this controller as a kit. I will post an update when that happens. Hopefully for now these photos and the link to downloads below will suffice. As always please feel free to contact me if you require any specific details. I am happy to help where I can.
You can order the blank PCB from the folks at BatchPCB by clicking here. Cost of the board is about $11 plus $5 shipping and $10 handling. A bit steep for just one board. You might try others board houses such as iTeadStudio which tends to be a little cheaper as they will send you 10 boards for around the same price. Delivery times are usually on the order of 2-3 weeks in my experience.
Feel free to contact me with any questions or help you might need.
Thanks for looking!
A recent project I have been working on required a single input from a pushbutton. Simple enough I thought, as this is a very common thing in most electronic projects. Especially those with microcontrollers. My initial thought was to carelessly place one leg of the pushbutton to ground and the other to the microcontroller input (the MCU has internal pull-ups). Easy enough, a low signal means pressed, a high signal means not pressed. Done! Debouncing would be done in software (that's another subject entirely).
Well I thought about this a little more. The pushbutton may actually be located away from the PCB (out side any project case I might put it in). It might even not be a switch at all, but perhaps two contacts which come together. I began to think more about this. What if the switch fails? What if someone applies power to one of the switch terminals? What if the switch picks up ESD, over voltage, under voltage? The concerns for the input of the MCU mounted. Am I using the right input protection?
So this made me think a little more about the seemingly simple addition of a pushbutton directly into the microcontroller. What kind of input protection method should I be using? I figured this might be a good time to survey the well know input protection options there are.
Keep in mind for the discussion below, I am considering inputs which are relatively slow (pushbuttons, contacts, etc) and not high-speed inputs which would require other considerations beyond the scope of this post. Also the example MCU input equivalent circuit is just a representation of what an MCU pin might look like for the sake of discussion, your mileage may vary. In general we assume an MCU can drive an output (high or low, both not both!) and an input is buffered through some high impedance device. I didn't want to go into too much depth of the internal pin constructions since every MCU manufacturer is a bit different. Please consult your specific MCU data sheet for those details. However I think you will find them all very similar.
Input protection can be classified into two broad categories. Ones which protect against software or configuration bugs, or misuse; while another protects against exposure to the outside world. We will discuss protection from software configuration bugs and misuse first.
Current Limiting Series Resistor
The first thing anyone who has been around the block a few times will tell you, is that it is always a good idea to throw a series resistor (Rs) in the path of any MCU input. This limits the current from the outside world into (or out of) your MCU. Why does this matter?
Your MCU can only source or sink so much current through the input/output pins. Exactly how much can be found in your MCU's data sheet. For this discussion let's assume this is 10ma maximum. Typically part of the initial MCU configuration is the setup of each pin and its function. We are discussing general purpose inputs here, so we intend to configure the pin as an input. However take a look at the simplified equivalent circuit for an MCU input I have shown above.
Notice the output stage is formed using two FETs in series and the input is buffered back into the MCU. When configured as an output, the MCU will tie the output pin to either Vcc or GND depending on your pin output configuration. When configured as an input, the pin is buffered back to the MCU indicating it's state. This is what we expect from the MCU pin equivalent circuit.
However consider what would happen if the output state were to be accidentally configured as an output and set to high. This turns the upper FET on and when the pushbutton is pressed, forms a short circuit direct to ground and the pin blows.
Click here to see an example of what happens when you do not have a series resistor in place to limit current in this case. Press the pushbutton switch and see how you create a short circuit from supply to ground which will most likely cause your MCU pin to blow immediately.
Now many MCUs will use some combinational logic to lockout the output stage when the pin is configured as an input, so it isn't likely we could set the output to high if the pin is configured as input. This may not always be the case though, so to be sure you should consult the data sheet. The point here is you may not know precisely how your MCU will behave at the first few microseconds of initialization, so its good to be cautious.
Consider another perhaps more likely case that someone (or you) decides to (or mistakenly) reconfigures that input pin as an output. If the output state through either default or explicit configuration sets this pin high, disaster is certain. When the pushbutton is pressed, the high output on the input pin is tied directly to ground creating the short. This is not what you intended, but accidents can happen.
To avoid this situation altogether a series resistor (Rs) can be inserted between the external input (the pushbutton) and the MCU pin. This limits the current which is sourced or sunk by the MCU. You'll need to look at the maximum current capability of your pin to determine the right value for Rs. Consider the maximum current for a 5V MCU pin is 10mA. Ohm's law says to limit 5V to 10mA you need a 500-ohm resistor (pick nominal 470-ohm).
Click here to see how the current is limited when a series resistor of 500-ohms is added. Now if this inadvertent software bug or misconfiguration happens the maximum, current your MCU will see is about 10mA.
Some designs may use lower resistor values such as 300 or 220-ohms. Again, check your MCU's data sheet and it will guide your selection. Clearly if you can be absolutely certain the code is correct and will not be inadvertently used in away you did not intend, the series resistor could be overlooked. But if your doing any sort of open source, experimental or other otherwise modifiable design which could have others changing (or more likely misunderstanding) your original intent it's best to take steps to protect against it.
External Pull-Up Resistor
On some MCUs, an external pull-up resistor (Rpu) is required when a pin is used as an input or output. In that case you need to add one and the data sheet will help you decide the correct value. Others more commonly have them already built in. You have the option to either turn them on or off. The question is when should you? Can you really save yourself the extra resistor by using only the internal one? Is it wise to rely on it in all cases? Should you ever?
Like most things, it depends. Consider if someone(or you) decides to modify the software which configures the pin to something other than what was intended?
Consider the case where your original design intended the pin to be an input, with the internal pull-up enabled. Somewhere along the way the code is modified in such a way that the pull-up is no longer enabled. In the example circuit, your input will certainly read a low when the pushbutton is pressed, but what does it read when the pushbutton isn't pressed? The input is floating in this case and the state is usually indeterminate. A floating input (or output) will produce random and strange results which might not be easy to debug.
Now consider someone actually thought about that and without much further thought tried to avoid the problem by tyeing the input high. Initially this seems like a good idea, at least when the button isn't pressed the input level is stable. But watch out! When the pushbutton is pressed, a direct short to ground will be made. Smoke happens.
If that isn't bad enough, consider someone realizes that pushing the button would be a bad thing and cause a short. But they rationalize to themselves that the pushbutton (for whatever reason) isn't going to be pressed. However, what if the pin which is configured as an input, is set (or by default is set) to a logical 0. Boom! Out go the lights. Software just created a direct path from Vcc to ground.
The right solution in this case is to add an appropriately sized pull-up resistor (perhaps 10k-ohms). This prevents either case from being a problem. In all cases the input is either a stable high or low (not floating) and misconfiguration in the MCU won't cause a short.
Granted if the input pin is driving a logic low, the circuit won't work as intended, but at least nothing blows up. Also notice if the MCU drives the pin high (instead of low) the pull-up wont save you from that either. For that you need a series resistor (see above). So to be safe, in all cases having both the pull-up resistor AND a series resistor saves the day. Go ahead, click there and just try to break it.
Finally, with the pin configured properly and not being driven, this is how's its done. In all cases the input if referenced (not floating) and doesn't cause any shorts.
Now, if your design is not intended to be modified, probed, hacked or otherwise mucked with, maybe it's fine to forgo the external pull-up or series resistors. It really depends on being able to adequately consider the risk. In most hobby projects saving a resistor isn't going to make or break a project. Cost in this case usually isn't an issue. However, what what if this is going to be a kit, or an assembled product you want to sell or mass produce? It might make a difference, especially if there are lots of inputs, these costs could quickly add up. This is why you often see "ruggedized" boards for sale with these extra components at a significantly higher cost. Designs with these additional input protections are more difficult to design, layout and produce, but protect you from just about anything.
Even if cost is not an issue, real-estate on a PCB might be. So it might be worth considering to use the built in pull-ups or forgo the series resistor when this is the case. Again, as with most things you need to weigh the options and make trade offs.
In my case, it's usually not worth quibbling about. Just add them and don't rely on the internal ones. It's only a few cents and some space on the PCB. Usually I don't mind spending a little more of either one for a more robust design.
The above techniques described will help protect your MCU inputs from bugs in your software, misuse and and other perils. The techniques below will help protect them from the harsh realities of the outside world which are not always under your control.
Two reverse biased diodes connected between the input and each supply rail is a good way to prevent input voltages which are over or under the supply by the diode voltage drop (Vf) of the diode selected. This limits the input signal seen my the MCU pin to typically Vcc + 0.6V and Vss – 0.6V. Many MCUs already have them included so check your data sheet. Again the series resistor (Rs) described earlier is used to limit current through each diode when the out of range input voltage is applied needed since this is when either one of the diodes will begin to conduct. For example if Rs selected is 500-ohms and 10V is applied and the diode Vf=0.6V, then 18.8mA will flow through the resistor. Just how much current these diodes can handle is based on which diode is selected. For example a 1N4148 can handle peaks of 1A and steady current of 300mA, while a 1N4001 can handle peaks of 30A and a steady current of 1A.
Click here for an example of how this works. Notice how the 10 VAC input signal is clipped by the diode clamp and current limited by Rs.
Zener Diode Clamp
Adding a zener diode instead of the two reverse biased diodes above yields similar clamping behavior. Selecting a Zener diode with a breakdown voltage slightly higher than the expected input voltage will help prevent excessive voltage from reaching the MCU. Again as shown in the diode clamp circuit above, the Zener will prevent voltage exceeding the breakdown voltage by beginning to conduct it away from the input. Again, a series resistor (Rs) is required. As an example, a 5.6V Zener diode such as the 1N4734A can handle 1W of power dissipation with peaks of 810mA.
Click here for an example of how this works. Notice how the 10 VAC input signal is clipped by the zener diode and current limited by Rs.
Probably the holy grail of input protection. It will add more cost and complexity (parts) but is nearly invincible to most input conditions. The idea here is to place an electrically isolated component (an optoisolator) between the outside world and your MCU pin. This makes the connection optically coupled rather than electrically coupled. The optical couple requires that the input be translated between the optical world and the electronic world. This is done via a photo-emitter(LED) and photo-detector (transistor) pair.
Not all inputs can be coupled this way. Optoisolators are generally slow acting devices (4N25) and are only suitable for relatively slow changing inputs (switches). However faster devices are available (6N137). Furthermore, analog signals (those which vary between 0 and 5V) need special analog signal optoisolators (HCNR200) which meet the bandwidth requirements of the input signal.
Another thing to consider is the ability of your input signal to drive enough current through the LED to turn it on sufficiently. The data sheet of the optoisolator will tell you how much current the LED needs to signal the output photo-detector reliably (usually a few milliamps). The LED's forward resistor (Rf) in series with the supply and LED photo-emitter control the amount of current from the signal used. The pull-up resistor (Rpu) references the input signal to the MCU's supply voltage Vcc. This is needed for open-collector outputs such as the optoisolator shown.
Lastly, to achieve full optical isolation from the source signal and the destination MCU, the power supplies used should be different. In the diagram above, you will notice that the MCU's supply voltage is Vcc, while the signal side is V+. They can be the same, but they need not be (but they wont be completely electrically isolated if they are not, although the input will still be protected). In fact another benefit of optical isolation is that you can easily provide a different input voltage (say +12V signal) from the source, into an MCU's 3.3V-level input as well as virtually any other voltage combination. In this case the optoisolator also provides signal level translation.
A PPTC is a Polymeric Positive Temperature Coefficient device, used to protect circuits from excessive current. That's a big long description, but it is more commonly known as a self-resettable fuse. We all know how regular filament fuses work. Too much current and the filament breaks protecting the circuit from excess current. Later someone replaces the fuse.
With PPTC devices, as the current through the device increases, the temperate increases until it reaches its switching temperature resulting in a dramatic non-linear increase in the resistance of the device into the mega-ohm region. Once the power is removed the device will return to its normal operating state. If the over-current conditions continues to exist, the process starts again. PPTC devices exist which can exhibit this behavior in many seconds (very slow) or milliseconds (faster devices). This technology is based on the thermal induced changes in the device material, so they are also sensitive to changes in ambient temperature.
The PRG18BB221MB1RB is a common PPTC device. In normal conditions it acts like a 220-ohm resistor, limiting current to an input to about 30mA at which point the device trips. The hold current is typically around 10mA at +60degC. This device can handle as much as 24V input. Other devices with higher or lower normal condition resistance also exist.
The MOV is a Metal-Oxide Varistor, used to protect circuits from excessive or transient voltage spikes. Its a voltage dependent, nonlinear device that provides very good transient voltage suppression. When exposed to high transient voltage, the metal oxide varistor clamps voltage to a safe level. A metal oxide varistor absorbs potentially destructive energy and dissipates it as heat, thus protecting vulnerable circuit components and preventing system damage.
The Littlefuse V8ZA2P is a 5.5 VDC device used to protect low voltage circuits. It clamps voltages of up to 20V at a current of 5 amps with peak currents of 250A.
MOVs have been typically used on inputs from household AC line voltage into a circuit to be protected as a surge protector, but can be used for low voltage digital inputs as well. The MOV device is connect in between the input signal and ground.
When selecting a MOV, you will need to consider the maximum surge voltage you are trying to protect. MOVs specify the energy rating, in joules, that must not be exceeded. The transient energy rating may be calculated by W = ½ LI2, where L is the inductance of the component or the system inductance responsible for the transient. I is the current flowing in the inductance during the interruption. The peak current interrupted will determine the clamping voltage.
The TVS is a Transient Suppression Diode, used to also protect circuits from excessive or transient voltage spikes caused from ESD, inductive load switching and other transient sources. Similar to MOVs you need to consider the maximum amount of energy the device may need to absorb and the power handing capabilities of the device while conducting. When a transient voltage occurs, the TVS clamps instantly to limit the voltage to a safe level and conducts current away from the circuit being protected. This is called the clamping voltage (Vc). The operation is similar to a Zener diode, but TVS diodes are faster acting and are designed to react more quickly to transients. Zener diodes are designed for slow voltage changes and are more commonly used in voltage regulators.
If needed, there are also bi-directional TVS diodes, which will handle transients on the inputs in both directions.
While this certainly isn't an exhaustive survey, it should provide some background and thought before your next design. Next time you have any external device connected to some circuit input you will want to consider one or more of these techniques.
BatchPCB (a part of the folks at SparkFun) for all my hobby prototype PCBs. They have always provided good quality, at reasonable speed and I consider them an overall great service. Recently however, I have heard a lot of talk about iTead Studio and wanted to try out their PCB prototyping service.
I designed a very simple 4A-Bridge Rectifier (something that can be handy in the lab) and figured I would give them a shot with that board design. It's super simple (just a few components) through-hole design and pretty small as well (1.5" x 1.5"). iTead Studio was running a special and I figured their 10 pcs, 10cm x 10cm board special for $9.90 (+$4 shipping) was a great deal and I would give them a try. I didn't need 10 pieces, but at what comes out to be $1.39 ea it hardly seemed like an issue. Overall I was very happy with the speed and quality of the PCBs. Granted I am not working on very complex stuff, so my requirements are not very demanding. I really just want something cheap and something that works in a reasonable amount of time. The service iTead Studio is running seemed perfect.
In mid-January I finished the design and sent it off right away to iTead Studios on Friday the 13th. I should have figured something would be up with submitting a board on Friday the 13th! But I'll get to that later. Anyway, I was hoping to just beat the shutdown starting on January 15th for the Chinese New Year celebration. I got it off in what I thought was enough time, but they informed me on January 14th it wouldn't be fabricated until after January 30th due to the Chinese Holiday. Oh well, at least i tried. No big deal, I am not in a rush so I waited.
The next I heard from iTead Studios was on January 17th, when they informed me via email that it had been shipped via Registered Air Mail from China. So perhaps due to its size, they squeezed it in. The boards themselves finally showed up in my mailbox on February 4th. So even with the 15 day shutdown the boards arrived 22 days after I submitted the design. Not bad! I think somebody in China was still working over the holidays :)
But what about that submission on Friday the 13th? Well, in my haste to ship off the design before the deadline, I didn't run my usual FreeDFM check using their online DRC checker. If you haven't ever used this before, you should. It's a great way to double-check your work as it will spot all kinds of potential manufacturing problems. I like using it, but it can be sometimes a bit too aggressive I think in spotting problems. However, I think it is always better to be informed and ignore a problem rather than to have not known about it at all.
That being said, without running the check, sure enough I had a fabrication problem. The ground pour I placed on the board had too shallow clearance between it and one of the fuse clip pads. Interestingly I did later submit this board to BatchPCB (to run their DRC bot). BatchPCB caught the problem right away sending me an email alerting me of the issue.
you for submitting your design to BatchPCB!
Very nice, yea BatchPCB! This would have been nice to
know, had I actually slowed down and run this before I submitted the
design. The lesson here is that BatchPCB refused to fabricate my
board due to the problem. iTead Studio was happy to go ahead and
build it regardless of the issue. Again, I don't necessarily expect
anything to actually check my work for me, but it was a nice bonus to
see from the folks at BatchPCB.
As you can see the iTead Studio folks fabricated the board exactly to my specifications, problems and all. Oh well at least it is not a huge issue. Nothing a Dremel tool can't fix by grinding away at the extra ground pour to create a larger clearance between it and the pad.
Just for comparison's sake, the same board would have cost me about $21.25 for a single board from BatchPCB. Now to be completely fair there are some costs baked into that price. First off their shipping is $5.50. Add to that their one time per order $10 handling charge. I would normally batch up my own PCBs in a single order to help amortize the $10 cost over several designs. But even taking the $10 fee out of the picture that is still $11.25 for a single board. Now I really like BatchPCB, and I think their service is great, but you really can't beat the iTead Studio cost. I didn't need 10 boards either, but it's almost like I got 9 free for using the iTead Studio service. Using BatchPCB that same order of 10 pieces would have been $73. Again, this doesn't mean I'll never use BatchPCB again. But if iTead Studio can be this cheap for at least my trial and error prototype boards, it really seems worth it. Later if I want perhaps something with better quality or more quickly I can consider BatchPCB (or others) for fabrication of the finalized design. Well something to consider anyway.
In the mean time, while I was waiting for my first order above to arrive, I decided to submit another design as well. This design is aagain another through-hole design 1.75" x 2.5". This fits into iTead Studio's 10 piece 5cm x 10cm service. With their "holiday" discount coupon the total was $24.58 which includes $5 shipping. That makes this $2.46 per board. Not bad. The timeline went like so;
Day -5 - January 23rd - Placed order with iTead Studio
Day -3 - January 25th - Submitted design to iTead Studio
Day 0 - January 27th - e-mail received to indicate I submitted to the wrong email address (oops)
Day 0 - January 27th - Resubmitted design to correct email address.
Day +3 - January 30th - Received email to confirm design was submitted to fabrication.
Day +10 - February 6th - Received email to confirm the boards have shipped.
Day +15 - February 11th - Received information that boards have entered Hong Kong.
Day +17 - February 13th - Received information that the boards are in New York City.
Day +22 - February 18th - Received boards. Yea!
Yep! 22 days again and the boards arrived. They look pretty good.
As anyone who was made their own PCBs before knows, there is a lot of work that goes into making even the simplest of boards. We painstakingly go through the part shuffling process placing components onto a bare board as if we are clairvoyant or have some insight into the eventual placement of these parts once the PCB design is done. The reality is the parts invariably never end up anywhere near where you initially thought they should be at the time you started. It's a long process of jockeying around ICs, resistors, LEDs and all kinds of components to find what you hope to be the optimal placement. If that weren't enough, you then begin with trying to resolve that rats nest of wires and begin the process of routing dozens, possibly hundreds of traces.
Starring at the board until we are nearly blind, tilting our heads seeking out new routes, we seek optimal pathways for the electron journey while slowly realizing our long thought out design. Placing a trace here, ripping another there. Finding clever routes which are short, direct and wont get you get locked into a corner is the goal. Finding a successful route is a kin to an ancient navigator succeeding to find the shortest trade route amongst hundreds available, basking in the glory of a clever and insightful path. The DRC rule check is run early and often, checking our way through our long journey. Then as an absolute last resort, we create a PCB equivalent of a "get out of jail free card", known as the via. You avoid them at all costs, but sometimes they just need to exist; there is no other way. Begrudgedly (and perhaps regretting) we add them when needed.
Finally the routing is done, but it's not over yet! We now carefully and methodically layout the silkscreen, placing all of the details we hope we will need to assemble the boards when they finally return from the board house. With all our work behind us, we run a final DRC check This after running it more times than one can count, finally arrive at aboard with no DRC errors. Well at least only DRC errors you are willing to live with. Finally, we are done! It's been a long process, but now its over. We sigh in relief.
Well almost. We now need to package up our design and have it fabricated. This part is probably the easiest part for us all. As long as we follow our board houses rules; everything goes smooth. We zip up the Gerber, perhaps checking it just once more and them email them off. There, it's done, off to China it goes. Into the electronic abyss where the PCB fairy works to produce our very own PCB. Like it or not, it is done. There is no turning back.
The problem with this part of the process is it takes weeks (at least if your a budget conscious hobbyist like my self) to get the boards back. So we wait. It's torture! The weeks you wait for those precious PCBs is one riddled with excitement and anticipation not unlike the kid on "A Christmas Story" waiting in the mail for his "Little Orphan Annie Secret Decoder Ring". Are they here today? Did they have a manufacturing problem? Did I remember to connect that one pin? Did I have enough clearance in my traces? Doubt riddles our mind. We pull up the design file and check, perhaps double check, and check again. All of this doesn't matter much however, because our PCB is submitted, off being produced in a far away land.
Then at last that day comes. An unusually heavy, but small blister pack of shiny new PCBs shows up in the mailbox. You rip them open like a child at Christmas. We do a quick inspection. Traces look good. No cut traces, no cracks, nothing looks shorted, silk screen looks legible. Great! Ready to build.
You rush to our workbench to begin populating the first few parts. Like a blacksmith stoking the coals in a furnace you fire up the soldering iron. Should we start with the power supply, to see if it smokes? Or maybe the section which was the most difficult to design? No, we start with the smallest parts first, yeah that'll do it. And then it happens...uhg! The same kind of feeling you get when you get a new toy and someone forgot to buy the batteries. One of the parts doesn't fit!
One of the most disappointing things to happen, after all this work is complete, when finally the waiting is over, we find out we made a mistake. A part wont fit, or interferes with another. Maybe we laid out the footprint backwards? Whatever the reason, either the Dremel tool comes out or the PCBs go into the trash. Bummer!
This happened to me once with one of my first designs. I figured there has to be a better way. That's when I thought, "Why don't I just print out a scale drawing of the PCB layout when I am finished?".
I can paste it onto a piece of Styrofoam and place all my components, BEFORE I have the PCB fabricated. That is exactly what I did. It has been an incredibly helpful step in the process ever since. Granted it's more useful on through-hole parts (although super glue works well for SMTs) and it's not guaranteed to find all the problems. But, at least any mechanical and placement issues can be easily seen before you commit to the design and wait weeks for the results.
To the right is another example of a design I tried out on paper first. This one actually worked out OK.
I highly recommend trying this technique out.It has really saved me a few times wasting time and money making boards which would have been otherwise thrown out.
One note of caution. Some ESD sensitive parts might not like so well being inserted into a Styrofoam block. So be careful. You can also sometimes use dead chips or similar package parts which are throw aways just to get the physical layout of the PCB. After all it's not like this Styrofoam board is actually going to work!