geoffwilliams@home:~$

Designing a PCB for assembly

Why?

I have a Raspberry Pi Zero W project where I wanted to put a bunch of components inside a small 3D printed enclosure to be left running 24/7. I didn’t want to leave components hanging out of a breadboard where they could fall out and this wouldn’t fit either.

I tried building something with perfboard but ended up just destroying it due to complex wiring, mistakes and poor soldering technique.

It turns out to be simpler to just learn PCB design with KiCad and have my boards made professionally. For my project, I ended up designing a simple through-hole Raspberry Pi HAT that made the wiring dead simple.

Since this was my first time ever using a PCB manufacturer, I added a couple of other projects to my order to see how far I could push my learning:

  1. A simple THT red LED
  2. A fully assembled SMT Buck Converter

There’s a tenuous relationship between PCB assembly and modern software development that I wanted to explore as part of this exercise as well: In the software world, we hear the term SBOM all the time in enterprise IT. I got to experience this for myself recently too. The BOM concept itself is rooted in physical manufacturing and a good practical example is PCB assembly. If you are trying to use a PCB assembly service, you will need to produce a BOM as well as some other files.

Let’s try out JLCPCB assembly service and see if we can get something working.

The project

I picked a 5V USB-C to 3.3V buck converter. It’s a great first project since:

  • Any electrical engineer understands what I’m trying to build
  • Cheap and readily available components
  • Complex enough to present a challenge, but high likelihood of success
  • Results in a genuinely useful circuit board. I’m planning on using mine next Christmas to replace battery packs on my LED lights

The Process

Step 1 - Learn KiCad

The KiCad software itself is outstanding and also Free Software (GPLv3). It’s not as hard to use as Fusion 360 but it does have its own learning curve. For a simple project like this one you could just use “normal” CAD but a specialist tool like KiCad is 100% worth learning as an investment in your own skills and understanding.

There is a lot more to it than this but rough steps needed in KiCad are:

  1. Schematic design
  2. PCB design
  3. Design Rules Check
  4. Export

Step 2 - Research, design and component selection

I spent a lot of time up-front researching how buck converters work and came up with an initial design:

initial design

To pick components, I used the JLCPCB parts catalog and leaned on ChatGPT a lot for validation.

To do the PCB design, I needed accurate footprints so I signed up for EasyEDA (click through while browsing parts) to download the files for the parts I needed. This is much more convenient and less error prone than designing your own footprints.

I ended up with a directory of parts I like to use in my $HOME set as an external library via the Footprint Editor and was then able to use my exact components for board design.

Step 3 - Design validation

At this point, I could have had the board manufactured, but I wanted to increase my odds of getting it right first time so I posted a message on EEVblog asking for help. If you haven’t come across EEVblog before, it’s THE place to talk to passionate electrical engineers.

A couple of days later, I had some really helpful responses and adjusted my design a bit. Reassuringly (and somewhat surprisingly), no one said it was broken at the design level. At this point this project got put on hold for a couple of years.

Step 4 - Export, upload, order

The files needed for manufacturing follow exact formats and are largely based around CSV. They are used for etching, drilling, pick-and-place, etc and they drive the entire manufacturing process. Designers normally produce a zip file containing Gerber files, BOM, and Pick-and-Place files.

Following these links leads to a maze of different file formats, export procedures and gotchas. Any of which are capable of blocking manufacturing or worse.

Automating export in the right format for your chosen manufacturer reduces the opportunity for mistakes and speeds up the process too. After some research I settled on using Fabrication Toolkit. This KiCad plugin basically produces all of the above files in the correct format in just a few clicks. They can then be uploaded directly for manufacture as a .zip.

After a final Design Rules Check, I uploaded the files, got a quote and did a couple of “fixes” which bit me a few hours later:

  1. I had to change a couple of parts due to stock availability
  2. Holes must be listed in the BOM. Pretty sure I cheated and just added directly to the CSV file:
H1,MountingHole_3mm,1,Mechanical hole,N/A
H2,MountingHole_3mm,1,Mechanical hole,N/A
H3,MountingHole_3mm,1,Mechanical hole,N/A
H4,MountingHole_3mm,1,Mechanical hole,N/A

Then I hit the Order button.

Questions from the factory

A little while after ordering I received some questions from the factory in a very polite email:

Dear customer,

Well got your order with many thanks.

Sorry to bother you, but there is one thing that we want to confirm with you about your PCBA order [REMOVED] before proceeding.

1. As shown below, seems the packages of the parts ( C2) cannot match the corresponding footprint on the PCB board.

We have activated the “Replace Part” button for you. Please change the part on your order history. If you want to leave the designator unpopulated, just unclick the “Select” for this part.

Please kindly note that we cannot replace the file directly for PCBA order. If you want to change the gerber file, we need to cancel the order, then you place new order with new file.

2. As shown below, seems the packages of the parts ( J2) cannot match the corresponding footprint on the PCB board. There’s risk of weak connection, bad soldering, tombstoning. We have 4 suggestions for you. Please make a choice.

A: Open the access of “replace parts” for you to change part on order history.

B: Leave the mismatched part unpopulated and refund and cost of part. We cannot ship the unpopulated part to customer due to customs clearance issue.

C: Cancel the order for you to redesign the footprint on PCB. Because we cannot replace the file directly for PCBA order. If you want us to refund the payment to JLC balance(not available if customer pay in EUR €). Please set the JLC balance in your account. https://jlcpcb.com/help/article/how-to-set-up-refunds-to-jlc-balance

D: Take the risk to solder the current component and will not complaint.

Your early reply will be highly appreciated, thank you so much!

Best regards, JLCPCB Team

Capacitor footprint:

bad footprint #1

Jumper footprint:

bad footprint #2

It turns out I selected a replacement capacitor that looked the same to my novice eye but had a different footprint. The header pins were also completely different.

Finding in-stock replacements matching the submitted design files was actually the hardest part of this entire project. Matching the KiCad generic footprint Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical_SMD_Pin1Left to an exact JLCPCB part was not (for me at least) a quick and easy process. After an intense help session with ChatGPT, I settled on C5160785 as a replacement.

The next day, I got another very polite email:

Dear customer,

Sorry to bother you.

For C9939, we are currently short of 5 pieces for the assembly of this order.

Sorry for the inconvenience. May I ask if you need to replace it with other components? If so, could you check if there is some replacement available in our parts lib? https://jlcpcb.com/parts/

Looking forward to hearing from you.

Best regards,

JLCPCB Team

I settled on C72428 2.6A 4.5A 47uH 86mΩ Unshielded Inductor ±20% SMD,18.5x15.2mm Power Inductors ROHS as a replacement part.

Interestingly, the replacement selection at this stage was just done via email instead of the replacement part flow. Presumably this means if I click the re-order button this final change would likely not have been captured. This is probably “fine” for small projects when parts come back into stock but results in a materially different board. This is a problem if you are trying to test, scale or certify a product.

In the software world, we call this Reproducible Builds - eg, do I get the exact same board with the same components if I click Reorder. I highly doubt that in this case, so due diligence means updating the KiCad files with the replacement choices that were made. A more robust approach would have been to cancel the order at the first email, fix the design and resubmit. This proves that all changes have been captured accurately.

Thankfully, the next and final email I received from JLCPCB was a shipping notification.

Did it work?

  • FIRE DANGER, especially with loads > 1A

    Also D1 looks a bit small, I think it may get too hot. Definitely not going to get 3A output with a 3A diode. I’d go with 6A and in a larger package, like SMC. But ok to test with a 3A diode if the output current is kept at like 1A or so

  • I don’t suggest that anyone attempts to manufacture this board from my KiCad files
  • Note intended application: Power small LED string normally driven by 2x AA batteries

Simple LED PCB

First I assembled the through-hole LED. Hooking up 2x AA batteries made the light come on:

Simple LED

“Checkinator”

The through-hole “checkinator” Raspberry Pi hat also looked great, although I goofed the silkscreening and missed some vital labels. More on this project board another day:

checkinator

Buck Converter

The buck converter board also looked great. All parts were securely attached and everything was neat and tidy.

buck converter pcba

The final part of this saga was to crimp dupont connectors onto my old LED battery pack lights and hook-up a laptop USB-C power supply. To my surprise it worked:

it works!

I left it plugged in for hours, nothing got hot and it didn’t burn my house down. All 3 designs worked. I call this a success!

After cranking out a 3D printed case in Fusion 360 and spending an afternoon assembling cases, I’m now all set for Christmas 2026. I have five of these circuit boards since that’s the minimum order quantity. All boards were tested and worked.

all done

How much did it cost?

The total order came to about $100 USD and about 30% of this cost was DHL shipping to Australia:

invoice extract

The PCB assembly service is a lot more expensive than just producing a bare PCB. In my case the extra cost is worth it vs doing a fiddly job on the kitchen bench. I’m positive that putting effort into choosing cheaper parts would have brought down the cost considerably too.

The caveat is that with an MOQ of 5, if you just want a single assembled board, you need to pay 5x the cost vs what you actually want. For a bare PCB this waste can be under $1 per board but an assembled PCB is orders of magnitude more expensive and becomes cost-prohibitive once you’re beyond the realm of “toy” projects.

How long did it take?

  • Fabrication, including all correspondence, took under 6 days. Production was blocked waiting for response from me for around 4 hours total
  • DHL Shipping to NSW, Australia took 3 days: Posted Saturday night, arrived first thing Tuesday morning
  • Less than 9 days to go from design upload to boards in-hand. Order was made on a Sunday afternoon

What did I learn?

This is a learning exercise, not a useful product

The discussion on EEVblog continued while I got caught up in a ton of side quests for a couple of years, highlighting some changes that would make a better board.

At least one forum reply talked about excessive heat and therefore FIRE DANGER, although this seems to be more in connection with higher loads vs intended use of small string of LEDs. RF noise was also mentioned, so it’s likely this little board could cause a nuisance or worse.

In my own testing, nothing measured more than 5C above ambient temperature after an hour or so, but I’m still loath to leave these Christmas Lights unattended in case of returning to a nasty surprise (fire), although everything “seems fine”.

One of the main things I learned in this process was just how nice the assembly service is.

My soldering technique has caused me big problems in the last couple of years. It’s hard for me to do since I don’t have a dedicated workspace, microscope, etc and if I’m honest, I don’t even particularly enjoy doing it either.

Next time I have a requirement for something beyond a mess of dupont connectors and I2C, I would consider an assembly service without hesitation.

Additional lessons:

  • Read and re-read any relevant datasheets
  • Check footprints carefully
  • Don’t trust AI-recommended replacement parts. Its very hard even for humans to download an accurate footprint, so ChatGPT and Claude have no chance
  • For projects you care about its best to cancel and resubmit designs so footprints can be more easily checked in KiCad and all changes captured

How does real manufacturing relate back to SBOM?

For the nerds reading this: There are some subtle but important differences.

The design files that get uploaded to a manufacturer are used to literally drive the production process. The CSV BOM files are used to select individual components for pick-and-place, etc. Our SBOM actually does the opposite - it’s the libraries our build tool identified during the build process.

At least in the world of Java development, Maven uses pom.xml to drive the build process. Resolving Dependencies between libraries (eg library A requires libraries B, C and D) is a key Maven feature and this concept simply doesn’t exist when using the PCB assembly service: You don’t include an IC in a BOM and automatically get a bunch of resistors and diodes included - you have to specify exactly what parts you want to use up-front.

On the manufacturing side, the inverse is true: We can produce boards with parts not in the BOM, with replacement parts discussed on an email thread. It’s really up to the designer to handle this process diligently if it’s important for a project.

With that said, SBOM is a sound security and business continuity practice as part of producing secure software. Most programmers don’t know or care about such subtleties, but taking the time to manufacture something from scratch has been a fascinating glimpse into how real-world terms get appropriated by the software industry.

Where are the design files?

Thanks and Acknowledgements

My sincerest thanks to everyone who responded to my forum post, especially mareks, and to Mia and Angel at JLCPCB for the help with my order.

This post is not sponsored. I paid for my circuit boards with my own money.

EEVblog forum post

For posterity, my original post:

Hi,

I’ve been trying to teach myself basic PCB design so that I can make myself a little Raspberry Pi hat to flash some lights. After spending the weekend burning protoboard I decided it would be easier and better to just dive in to PCB design. I don’t have an electronics or maths background but I’ve watched a lot of youtube and have learnt the basics of Kicad after work this week.

So far I made a little LED through-hole board which has a good chance of working on first attempt but I wanted something a little more challenging before returning to my original problem. I have some LED Christmas lights that take 2x AA batteries and I had already looked at buying a USB buck convertor to step down 5v to 3.3v for these off Aliexpress but I decided to build my own for practice instead.

I was hoping someone on this forum could tell me if my learning/design process is on the right lines and ideally have a quick look at the PCB I designed and tear it to shreds - that’s how you learn right.

What I’ve tried so far:

  1. Random youtube videos on Kicad
  2. Stay up late tooling round and building that Raspberry Pi hat. I created a PCB that I’m 99% sure would not work at all as some pins marked 3.3V on the schematic were somehow all 5V in PCB designer. Pretty sure I shorted something. Give up and go back to basics
  3. Design a little LED circuit. Looks good, I’m going to make this
  4. Spend focussed time learning about Kicad on youtube. The best vids I found were from “PCB Cupid”
  5. Get a good explanation of what a buck converter is so I know what I’m building https://www.youtube.com/watch?v=B5eWpRFC9Aw
  6. Lots of googling for buck converter circuits. Found one that looked easy but also nothing like what Louis explained. That’s because it was just a voltage regulator and I would have built the wrong circuit if I hadn’t done some research
  7. Found the TI LM2596 SIMPLE SWITCHER referenced in a few places and decided to use this. Read the datasheet and tried to build the circuit listed under “Typical Application”. This is for 5v though, not 3.3v. According to Chat GPT I can just change the IC to the 3.3v version and leave the inductor and capacitors at the same value. Find missing components on snapeda and import into Kicad
  8. Design a schematic and add USB-C power connector with the CC pins grounded through 5.1K resistors. Electrical Rules Check passing
  9. I want to have this board fully assembled with SMD components by JLCPCB but the diode and coil parts from datasheet are not in stock on https://jlcpcb.com/parts/all-electronic-components so I spent more time looking at specs that I barely understand and then asking Chat GPT if my substitution is OK
  10. Build PCB from schematic, not fully happy with it
  11. Do some research on PCB design, Read Dave’s book: https://www.scs.stanford.edu/~zyedidia/docs/pcb/pcb_tutorial.pdf, watch some EEVBLOG vids
  12. Delete PCB and start again. Try to layout components like the datasheet says, add big traces and copper fill areas. Design Rules Check passing

I’ve learnt a lot in this process. My overall goal is just to be able to make simple PCBs for Raspberry Pi or other simple circuits for fun, in the future. I’m not planning on changing careers or building really complicated things.

So on to my questions:

Components OK?

  • 33uH inductor AIAP-02-330K
  • Input capacitor 680uF EEE-FK1J681AM
  • Output capacitor 220uF TPSE227M016R0100
  • Diode 30V 3A SS33 (THT - could not find an in-stock SMD one)
  • Apart from the USB connector, I only built what was in the datasheet. Is anything else required?
    • All good for intended application?: Connect to old phone charger and hook up a small LED string and possibly any other random low power 3.3V DC needs in the future
    • What are the chances of my PCB design working?

I haven’t had anything made yet so just asking for any suggestions before I see if this blows up. :-DD

Thanks for reading all this!

Cheers, Geoff

Post comment

Markdown is allowed, HTML is not. All comments are moderated.