Saturday, 7 April 2012

LM317 PCB Layout

Here we's PCB layout time!  Here is the schematic re-drawn and ready for PCB layout.  I have added a 5V fixed supply to the circuit because I would like to add a digital voltmeter to the circuit so we can monitor what the output voltage is set at.  After investigating panel meters on-line I found that they require a separate supply in order to work correctly.  Other than this the circuit is the same as in the previous post.

Now that we have designed the variable power supply it's time to make a printed circuit board to mount the components onto and route the connection tracks.  For PCB layout I use Eagle Cad from Cadstar because it's free up to a point, has great component libraries and support via forums from thousands of people.  

There are thousands of PCB layout tutorials for eagle available so I'm not going to go through the nuances of doing PCB layout unless requested.  I don't consider myself very good at this particular aspect of electronics.  I know the theory but I don't have much experience in the practical.  Professionally I sub-contract PCB layout out to someone else but because this is for me personally and anyone reading this the following guidelines are always good:
  • Lay out the components on a suitably sized PCB first.
  • Set the grid size to something sensible.  I used 1.27mm and 0.635mm for my grid size
  • One you have a general idea of the component location select a suitable track size.  Thicker for more current carrying capability.
  • Try not to cross tracks. 
  • Once you have all of the tracks routed perform an electrical rules check
  • Tear-drop the pads once you have completed all of the above tasks.
  • Finally resize the PCB if you can.  Less board = cheaper manufacturing costs
I shy away from auto-routing functions in PCB layout tools as they always seem to do a poor job!  I have heard of other people find these work well but I have had mixed results.  I have always found for more simple circuits it is much better to route the tracks by hand.  The PCB layout for this circuit is shown below:

I chose a thick track size on purpose as I wanted to be sure that there would be enough current carrying capacity in all of the tracks.  This might be a bit overkill but it at least it saves on copper.  I also didn't use a ground plane on this design as it isn't really necessary.

All that is left to do now is to actually make the PCB.  When I do this I use the toner transfer method of making a PCB.  That involves printing out the design in reverse (like in the above picture) on a laser printer.  I then get a piece of blank PCB.  I'm going to use a 160mm x 100mm blank PCB and cut it down to size.  I'm then going to clean the PCB thoroughly and then placing the print out of the layout ink-side down (actual size) onto the copper, and using a clothes iron, transfer the pattern.  The iron should be set to as high as possible - ENSURE there is no steam or water in the iron.  Firmly press and iron the paper for about 5 minutes.  Then switch off the iron and wait for the PCB to will be too hot to handle.  Once cooled run the PCB under water to 'soak off the paper'.  What should have occurred is that the design has transferred from the paper onto the copper of the PCB.  If it hasn't worked clean the PCB off and repeat the process.  Next etch the PCB in ferric chloride or Muriatic acid...whichever you prefer.  I use ferric chloride because I find it gives me a better etch and because Muriatic acid (Swimming Pool Cleaner) is hard to get hold of in the UK.

That's about it for now.  Next post will be the actual building and soldering of the supply with photographs!  For those that might be interested here is a good tutorial on PCB layout: - From the EEVBlog! Kudos to David L. Jones

Here are the eagle files for this project so that if people wish to make this power supply for themselves!

LM317 design files on Github

Update: I found having constructed the above circuit that there was a mistake in both the schematic and the PCB.  I have updated both to resolve the issue.  I missed out a connection on the schematic which prevented the supply from going low.  The variable resistor needs a link from the middle pin (wiper) to the top pin so that the voltage output of the LM317 can be reduced down to 1.25V

Here is the component placement in case someone needs it!