# My first completed PCB design, High End LM317 regulator! Ready to do the first PCB!



## Spacehead

Hi!
   
  I have been playing with ExpressPCB. It seems to be quite easy to use but it is pretty basic still. It is very addicting to design PCBs with it.
   
  I have been working on TPA6120 amplifier but I need to first try to etch something simpler with wider traces.
   
  I have not yet tried to do the toner transfer but I think this LM317 reg is very good candidate for first try.
   
  Check it out:
   

   
  ExpressPCB layout file:
http://dl.dropbox.com/u/7337908/LM317powersupply.pcb
   
  I decided to set the output voltage with two 12V zener diodes. I found that info from here: http://tech.juaneda.com/en/articles/lm317.html
   
  Any tips are appreciated! I have magazine paper , laser printer, press and peel blue and iron , and single sided copper pcb and other basic pcb manufacturing items. I will be using ferric chloride as etchant.


----------



## Avro_Arrow

It looks like you have most of your traces on the top side with
  all of your through hole components. This will make for very
  poor physical mounting for these components. In a commercial
  board with plated through holes it might not be so bad, but on
  a do it yourself board it will rip the traces off.
   
  The traces look a bit out of alignment in places but over all
  not a bad first try.


----------



## Spacehead

Quote: 





avro_arrow said:


> It looks like you have most of your traces on the top side with
> all of your through hole components. This will make for very
> poor physical mounting for these components. In a commercial
> board with plated through holes it might not be so bad, but on
> ...


 

 Thanks, that was valuable information! I didn't think about that at all!
   
  I therefore removed the smd components and tried to make the traces a little bit shorter. And marked them to the bottom side.
   

   
   
  ExpressPCB file:
http://dl.dropbox.com/u/7337908/LM317powersupply1.pcb
   
  Now I realized that the bottom copper won't cool the regulator at all, or would it if the mounting screw and nut transferred the heat to the bottom side?


----------



## cobaltmute

Is that big red trace really going to be there?  It is connecting a lot of stuff together that it shouldn't.


----------



## Spacehead

Quote: 





cobaltmute said:


> Is that big red trace really going to be there?  It is connecting a lot of stuff together that it shouldn't.


 


  Oh, you're right, when I print it I must remove that trace. It is supposed to illustrate where I should put a jumper wire.


----------



## cobaltmute

With a little bit of work, you should be able to do the board with no jumpers and on a single layer.


----------



## Avro_Arrow

Here is my version...


----------



## Avro_Arrow

Here are some links to help you with your etching...
   
Easy Toner Transfer
   
Photo Etching Method
   
Rate my Etching Job
   
  Good luck with your project!


----------



## 00940

Nice layout Avro_Arrow.
   
  A little tip to improve it even further: try to tie the ground side of the components going to the adj. pin directly at the output gnd pad, even if it means a jumper, so that charging current of the output caps don't interfere with regulation.
   
  edit: ALW on diyaudio made it clear with that picture:


----------



## Avro_Arrow

Thanks 00940 for the compliment.
   
  I know what you mean about the ground.
  If I re-draw this I will see if I can sneak it down the middle
  between the filter caps.


----------



## Avro_Arrow

How is this one?


----------



## akgfan

Quote: 





spacehead said:


> Oh, you're right, when I print it I must remove that trace. It is supposed to illustrate where I should put a jumper wire.


 

 No. Just make that trace around LED or between resistor's legs. There is no need for double sided pcb or jumper.


----------



## Spacehead

Quote: 





akgfan said:


> No. Just make that trace around LED or between resistor's legs. There is no need for double sided pcb or jumper.


 


  I tried:

   
http://dl.dropbox.com/u/7337908/LM317powersupply2.pcb
   
  I don't dare to begin the pcb making process yet because I am unsure about my layout still.


----------



## Avro_Arrow

I would scrap the idea of using the board as any kind of heat sink.
  Your traces are way to long and convoluted. Play around with the
  layout to make the traces shorter and more direct.


----------



## cobaltmute

Maybe this will give you an idea.  My schematic is not exactly the same, but it should be close enough.


----------



## Spacehead

OK!
   
  How do you find such nice looking layouts? What is the technique?


----------



## BobSaysHi

I love these threads. Subscribed.
   
  I can't wait till I have more free time for this stuff.


----------



## akgfan

That trace is now so long and complicated. You could use that "heatsink" part of pcb for example. And use heatsink instead it.
   
  When you start doing pcbs it takes some time to learn how to imagine parts placement. Don't stop when you complete a pcb, but try different versions with different parts placement. First version can be good starting point for better imaging.
   
  I hardly use autorouter in Eagle. I do it manualy instead. But when I do use autorouter, I modify it manualy then.


----------



## cobaltmute

Lay down the parts and traces, evaluate where things can be improved, Rip-up, place parts and traces, evaluate where things can be improved, Rip-up, place parts and traces, ...
   
  And by evaluate, I mean look at if you have any overly long traces that could be shortened and try and fix those by moving parts around.
   
  In this case, I saw what I would do from your layout and started from there.


----------



## Avro_Arrow

We didn't "find" them, we drew them...
   
  One of the first "rules"; for double sided boards,
  the traces on one side should mostly go "up and down"
  and the traces on the other side should mostly go "side to side".
   
  The next "rule"; it looks neater if your traces do not go at odd
  angles to one another.
  You should radius corners rather than have sharp corners.
  Instead of lines meeting at right angles, try a 45 degree
  or an arc.
   
  There are many more "rules" based on what frequency
  the board will operate at but thats for much later...
   
  If I get a chance later I will try and draw some examples for you. 
  
  Quote: 





spacehead said:


> OK!
> 
> How do you find such nice looking layouts? What is the technique?


----------



## 00940

Just for fun... here's a layout that should be easy to produce. I added a 1N4148 at the bottom of the zeners, for some temperature compensation.


----------



## cobaltmute

Excellent layout 00940.  Now you just need a LED to make it perfect


----------



## akgfan

Quote: 





cobaltmute said:


> Excellent layout 00940.  Now you just need a LED to make it perfect


 

  
  No way! 
	

	
	
		
		

		
		
	


	



   
  BTW Some mounting points would be nice.


----------



## 00940

As you wish...
   

   
  Edit: replaced by a slightly more compact version with led


----------



## Avro_Arrow

Excellent 00940!
   
  Try flipping your heat sink around...the arrow points
  to the mating surface. Then it will sit flush against
  your regulator.


----------



## 00940

Quote: 





avro_arrow said:


> Excellent 00940!
> 
> Try flipping your heat sink around...the arrow points
> to the mating surface. Then it will sit flush against
> your regulator.


 

  
  You know, I always wondered what the arrow was for... now, I know 
	

	
	
		
		

		
		
	


	



   
  Anyhow, I don't plan on building it as it's the kind of thing I'd rather build on perfboard. It's more of an example the OP can use as a basis for his own layout in PCB express.
   
  Some other PCB layout tips for beginners:
   
  - before starting any routing, gather in small groups the parts that belong to a sub-section and lay the parts neatly. Lay next to one another any part that might be in parallel. Example : on my pcb, all the parts going from the adjust pin to ground. Before starting to route tracks, you should see as little of those lines linking unrouted parts as possible on the screen.
  - Then put on the pcb the parts that won't move a lot. Example here: the lm317+ heatsink.
  - Then try to place around those unmovable elements the small subsections, in the most logical fashion.
  - Don't layout the ground track last. At the contrary, this is maybe the most critical track. Don't ground a part linked to a sensitive part of your circuit in between the grounded lead of a power supply capacitor and the incoming power supply ground.
  - Dont' hesitate to make your pcb bigger than necessary at first. It's easier to see what's going on. You'll make it smaller later on.
  - When working with through holes parts, set your grid at 0.1 inch and always put the parts' pads on the grid. Smaller is useful for smd works but not here.


----------



## MaxW

With a simple regulator design it might be easier and cheaper to just get one off eBay?
   
http://cgi.ebay.co.uk/LM317-DC-5-24V-Out-2-5-12V-Volt-Regulator-Converter-/230586703745?pt=UK_BOI_Electrical_Test_Measurement_Equipment_ET&hash=item35b009df81#ht_6415wt_957
   
    
http://cgi.ebay.co.uk/Voltage-Regulator-Kit-AC-DC-in-DC-out-Based-LM317-/150446018070?pt=UK_ConsumerElectronics_SpecialistRadioEquipment_SM&hash=item2307480e16#ht_3883wt_982
   
    
http://cgi.ebay.co.uk/MINIATURE-DC-POWER-SUPPLY-KIT-BASED-LM317H-LM337H-/380309269674?pt=LH_DefaultDomain_0&hash=item588c32ecaa#ht_500wt_669
   
    
http://cgi.ebay.co.uk/PREAMPLIFIER-DAC-POWER-SUPPLY-KIT-BASED-LM317-LM337-/350287232184?pt=LH_DefaultDomain_0&hash=item518ebefcb8#ht_500wt_669
   
   
http://cgi.ebay.co.uk/Power-Supply-Board-Kit-PCB-Based-LM317-LM337-IC-/160438926628?pt=UK_ConsumerElectronics_SpecialistRadioEquipment_SM&hash=item255ae7bd24#ht_7183wt_982
   
  Just a thought


----------



## cobaltmute

And what would you learn for buying a pre-made kit?


----------



## Spacehead

Thanks to 00940 I made this:
   

   
  ExpressPCB:
http://dl.dropbox.com/u/7337908/highendLM317.pcb
   
  Could anybody help me and do a very good SIP8 to DIP8 adapter that would be ready to print, for a single sided board?
  I need to remove some sip8 op amps from a amplifier and use the adapter for installing dip8 socket so that I can roll op amps.
   
  Next I will try to do a dual power supply using this single supply layout as a basis. That would be installed to the same amplifier I would like have the op amps replaced.


----------



## Avro_Arrow

We will be looking forward to seeing the etched board.


----------



## Spacehead

OK. I browsed the Internet and found many helpful advices and instructions.
  I was pretty sure my layout was correct so I decided to proceed. I used Press n Peel blue for toner transfer.
  Here is the printed layout and prepared copper clad.

   
  I filed the edges and used kitchen scrubber.
   
  Then I let the board sit in etching solution for a minute as per Fred's advice.

   
  I used iron on full heat and transferred the toner on my working table.

   
  Pretty good for first try!! I fixed the output trace with a pen. Next time I must use more pressure, I think.
   
  Here is the board after cleaning and drilling with 1 mm drill bit. Ready for parts placement.

   
  After soldering

   


 And it works right away. It outputs 26 volts for some reason. I used R1 120 ohm and 12V + 11V zeners. I also have the 1N4007 after the zeners. I don't understand what it does though.
   
  I am very happy with the result. I use it now on my Pimeta v2. It replaced the breadboard version of the regulator. The previous version didn't have zener reference so that is new.
   
  Thanks for the advices!
   
  Next I would love to do a SMD board, because I found out that manual drilling is quite difficult to do accurately. It seemed to rip of traces very easily.
   
  PS. I did a little mistake. My wall wart outputs 29V after rectification so that input electrolytic capacitors voltage rating has been exceeded. It hasn't exploded yet and isn't warm, but maybe Panasonic actually can be used a little over spec.


----------



## 00940

Your output voltage is 12+11+0.7 (the 1N4007)+ 1,25 (the voltage across R1) = 25 but zeners aren't always very accurate so 26 doesn't surprise me much.  You could replace the 12V zener by a 10V one to get nearer to 24V.
   
  For caps, I would use 35V rated at the input and at the output of the reg, unless you replace the zener; in which case, you could use 25V ones.


----------



## MaxW

Wow excellent results for your first PCB!
  I've had the drilling problem before too. You can make the pads larger so that there is less chance of lifting the trace but if you want to make an SMD version, look for the SOT-223 packaged LM317:
   

   
  The schematic would be the same, just different layout. Also 1206 size SMD resistors are a good size to start with, very easy to solder


----------

