jamesfitzsimons.com

Robotics, electronics and other hobbies

Lessons learned in PCB layout

My Programmable PSU rev 0.1 boards have been a great learning experience so far, which is exactly what I expected and hoped for. I’ve already accumulated a ton of lessons learned from the process and rev 0.2 will hopefully be a significant improvement and get me well down the path to the final product. Over the past couple of weeks I have watched a bunch of videos about PCB layout in general, and Kicad in particular and now feel much better informed and armed for tackling rev 0.2. Some of the key lessons learned so far are:

  1. Decoupling caps need to be right next to the IC
  2. Build logical groups of components (generally matching functional blocks in your schematic) and lay those out individually before bringing everything together as a whole.
  3. Use larger traces for power
  4. Use a copper fill if necessary to help with heat dissipation
  5. Get your crystal / oscillator as close to the micro-controller as possible.  I found a great resource at http://hoani.net/engineering/crystal-oscillator-design/  for crystal oscillator design including PCB layout
  6. Be careful USB – it requires differential pairs that need to be carefully handled.
  7. If you can fit component values on your silkscreen – do it. It makes assembly a lot easier than having to constantly refer to a schematic to check values

Item #4 above relates to the LM317 regulator I am using to convert down from the 12v input to a 3.3v supply for the STM32. I am using the SOIC-8 package version of this device, and it gets hot. It has 4 output pins and I have only connected one of them. One thing I will definitely do next time is connect all four pins together with as large a copper fill as possible between the pins underneath the chip. This should go someway to helping with the heat dissipation.

I learned one particularly hard lesson about Kicad and making sure you re-draw the copper fills before generating your gerber files.  You can read my debugging journey on this reddit thread. Once I had figured out what had gone wrong I tweeted about it  and got some great advice back. Apparently this has been fixed in Kicad 5 where you can select an option to check zone fills before plotting – clearly I wasn’t the first person to be bitten by this issue!

Unfortunately though it resulted in a couple dead shorts on the board where VDD was connected directly to GND e.g.:

This is what I saw in pcbnew.

This is what the generated gerber file looks like.

Some judicious cuts with a craft knife and the boards are salvageable which is fortunate. Ultimately they were just intended to prove the digital control portion of the design using the STM32F070CBT6 which I should still be able to achieve with the rev 0.1 design.

After spending more time than I care to admit on figuring out the previous problem, I then had to diagnose why my STM32 kept hanging every time it got to the SystickHandler. Long story short I had jumpered BOOT0 to VDD instead of GND – won’t be making that mistake again either!

So, after all that I finally had a booting board and here is a blinky video to prove it:

pcbway.com – can recommend!

So, a couple of weeks ago I placed my first order with www.pcbway.com. I have been super impressed with their service, right from the beginning of the ordering process to having the boards in my hands.

Even for a complete beginner, the pcbway website makes the ordering process simple and straight forward with sensible pre-selected defaults if you go for their small prototype offer. This is priced at an incredibly sharp $5 for 10 pieces for a 1 or 2 layer board as long as you can stay within the 100mm x 100mm size, which in fairness is plenty big enough for many hobby projects or even many commercial designs. They even give you a nice selection of solder mask colours to choose from, but beware Purple, Matte Black and Matte Green cost more – something I figured out after I was already part way through the process so had to upload my design again. To be fair there is a nifty pricing calculator displayed on the left hand side of the page that updates as you change options, so this was totally my fault for not paying attention.

Once you have selected your options and uploaded your gerber files they have an actual human engineer do a manual review! They turn this around within an hour, and will contact you if you have any problems. One of the foot prints on my board was for a barrel jack power connector, and it had drills over slots. The engineer emailed me to check if they should be drilled or slotted. Great service and incredible turn around time on the review.

Once through the review process, you pay for your boards and they enter manufacturing. This is one of my favourite parts of the website – they have a real-time progress indicator of your boards as they go through the various manufacturing stages! I loved seeing the update that my board was up to the next stage of manufacturing – it’s a little gimmicky I suppose, but it really appealed to me and I bet I’m not alone in that.

Progress indicator

The order process console on the pcbway website.

Time from placing the order to delivery in New Zealand was just 7 days (including a weekend) – amazingly quick turn around time. The boards arrived well packed in a nice pcbway box, with good bubble wrap and foam protection around them.

delivery box

Protective packaging

The actual boards themselves turned out really well. I chose the red solder mask which looks pretty sweet, although I’m keen to give the blue a try next time. I had used some reasonably small track sizes down to 6mil, and some pretty small package sizes like a tiny little SOT23-6 USBLC6-2SC6 part and everything has come out beautifully. The silk screen is sharp and easy to read – although next time I’ll include a bit more information such as the component values and maybe some graphics for kicks.

Summary

I can definitely recommend giving www.pcbway.com a try. Their prototype prices are pretty hard to beat and their service is excellent. They also have a neat feature where you can share your project and if other people order it you get 10% of the value of those orders. I look forward to using them again in the future and who knows – I might even enter their PCB Design Contest some time!

Orders away!

Well, tonight I sent of my orders to Digikey and pcbway.com. I really hope that I can:

    a) assemble this board without stuffing anything up, and
    b) that I haven’t screwed up the layout and the board works!

I guess only time will tell now. Oh well, if nothing else it’s already been a massive learning exercise which has been great.

Here’s the 3D render of the finished board design from Kicad:

Looking forward to getting those boards back now. I’ll post some photos once they arrive.

More PCB layout fun

I’ve been slowly chipping away at redoing the lay out of my PSU control board prototype. I managed to get it complete tonight, and it looks a lot more roomy – hopefully this board has enough spacing for me to be able to comfortably hand assemble it. I’ve got a few more checks to go through before I send the files of to pcbway.com.

PCB Layout lessons

One of the projects I’m currently working on is an adaption of a programmable power supply partially developed by Gerry Sweeney. I say partially developed because although Gerry did an amazing job documenting his fantastic project and creating some great youtube videos, it looks like life got in the way and he never quite finished it. I’m hoping that my attempt at a slightly updated and revised version will result in a completed project.

I’ve decided to start by trying to replicate the digital logic portion of the design as that is the area I am most comfortable with. I would describe myself as an analog novice, so I need to spend some more time digesting that aspect of the design before I attempt that. I’ve also decided to replace the PIC micro-controller with an STM32F070CBT6 as, although I played with PICs many years ago, the ARM architecture really seems like the way forward at the moment, or at least until RISC-V becomes mainstream 😉

I’ve drawn up the schematic in Kicad, another first for me as my limited PCB design experience in the past has all been with Eagle. I’ve found Kicad pretty easy to use once I worked my way through the tutorial and have found the answers to any roadblocks easily enough with a quick google. The real challenge though has been the layout phase. This is by far the most complicated design I’ve ever laid out from scratch. After spending more evenings than I’d like to admit on getting it laid out, I realised my component spacing is way too tight and there is no way I am going to be able to hand solder this board. So, back to the drawing board and I’m pretty much going to have to lay it out all over again. Lessons learned the hard way often stick with you though, so hopefully this will be the first and last time I make that mistake.

Here is the current schematic. As it’s my first Kicad schematic I haven’t bothered figuring out how to split it across multiple pages yet – hence the A3 size.  psu_schematic

« Older posts

© 2018 jamesfitzsimons.com

Theme by Anders NorenUp ↑