Board Assembly Using JLCPCB

2020-10-29
test run

test run

This is a brief blog post about using JLCPCB to do board assembly. Though the board design was done with MeowCAD, the focus will be on the process of board assembly through JLCPCB.

Note that I'm not affiliated with JLCPCB (or PCBWay) in any way. This was my first time ordering boards for manufacture and the experience was very satisfying, so I'm chronicling it in this blog post in the hopes others get something useful out of it.

Motivation and Design

I wanted to make a large sixteen segment display using RGB LEDs. There was a project called Klais-16 which provides 16 segment displays for $10. While the Klais-16 project is awesome, the boards were just a little smaller than I wanted and were single color.

The price, $10-$15, was also on the high side. For small quantities, the $10-$15 prices is phenomenal but I wanted to see how cheap it would be for larger quantities.

So I designed my own using WS2812b 5050 RGB LEDs:

seg16 schematic

seg16 schematic

seg16 board

seg16 board

The "5050" in the LED name refers to their size (5mmx5mm) and the b variant refers to the LED having four leads.

The WS2812b has a tiny microcontroller embedded in it and uses it's own one wire protocol for communication. This makes it easy to chain as only power, ground and data need be wired.

After downloading the project from MeowCAD and verifying the Gerbers, I started the process of submitting to JLCPCB. Downloading the boards


One design consideration was what parts JLCPCB had on hand. After some investigation on JLCPCB's parts library, I found the WS2812b. One reason for choosing that particular part was that it had only 4 leads and was one of the only parts I could easily find and import into MeowCAD.

Parts chosen from the JLCPCB parts library, the WS2812b and the 100nF capacitor, were used to create the BOM file.

Prepping for Manufacture

After the Gerber files were put into a ZIP archive and uploaded, I filled options relating to size. For some reason the board dimensions don't autofill so I used my best guess, which was 105mm x 135mm, erring on the size of slightly larger.

upload gerber

upload gerber

Further down the page is an 'SMT Assembly' button. I guess JLCPCB only allows a green soldermask and SMT assembly for quantity less than 30. Assuming both of those conditions are met, you can hit the toggle button and choose the appropriate side to place parts on.

smt assembly choice

smt assembly choice

Once saved, there will be a screen to upload the BOM and CPL files. I generated the CPL file by filtering JSON board file and taking the center of appropriate parts.

Here's the bash incantation (a combination of grep and jq) to generate the CPL for this project:

echo 'Designator,Mid X,Mid Y,Layer,Rotation'

jq -c '.element[]' ../../export/json/board.json  | \
  grep -v -P '"track"|"drawsegment"' | \
  grep '"SMD"' | \
  jq -r '. | [.text[0].text, 25.4*.x/10000, 25.4*.y/10000, "Top",((( (.orientation | tonumber)/10 ) + 360) % 360) ] | @csv'

Note that this would need to change depending on your project, as the SMD grep line is pretty hacky.

Regardless, once the BOM and CPL files are uploaded, you can review the selected parts:

review selected parts

review selected parts

And then review the SMT part placement:

review part placement

review part placement

Once I was satisfied with the placement, I continued with the order:

order confirm

order confirm

This was for an order of 10 boards, fully assembled.

I find it astounding that the price is only $47.44 for 10 boards. That's about $4.75 for a fully assembled board.

When they arrived, I soldered a header on one and put it through it's paces to test:

test run

test run

Closing Remarks

Though this post is basically a "how to navigate JLCPCB's web site", I hope it demystifies the process. I know I was intimidated as this was the first board I ordered, fully assembled, from a manufacturer. The whole process was straight forward and cheap. Even if I had a problem with my layout, $50 was an acceptable amount of money I was willing to risk on the experiment.

To re-emphasize, a fully assembled 105mm x 135mm board cost $4.75 in quantity 10. For quantity 30, I calculate about $3.75. I'm blown away by how cheap it is.

I believe this is why the Klais-16 folks can get away with charging the low rate of $10-$15 for their boards.

For comparison, I asked a domestic fabrication house and they quoted $27 for the Klais-16, or $0.20 per placed part. Doing a brief spot-check on OSH Park, the 105mm x 135mm board would run about $125 for 3, or about $40 per board.

The shipping time for the sixteen segment displays ordered from JLCPCB was about 2-4 weeks.

I think there's probably good reason to go through a domestic board fabrication, either for assembly or for PCB manufacture, but going through a Chinese service like JLCPCB or PCBWay is upwards of 10x cheaper for a 1x-2x decrease in shipping time, at least for this project.

This project was very simple, it amounted to nothing more than two unique components, the WS2812b and a capacitor, so surely boards with higher complexity have other more subtle problems to deal with.

I decided to use JLCPCB because their interface allowed me to easily choose the 'assembly' option. I tried PCBWay but ran into problems. In the future, I'll probably use PCBWay for larger orders as JLCPCB looks like they max out at 30 boards for assembly.

If you'd like to see the boards in their current form, check them out over at MeowCAD. The boards are open source hardware, so feel free to download and manufacture, clone, alter, use or sell to your hearts content.

Feedback? Thoughts? Be sure to drop us a line in our feedback section

Happy hacking!

submitted by [abetusk]

An Update on MeowCAD

2020-10-29

MeowCAD

This is a brief blog entry talking about the current state of MeowCAD, five years after initial release. The project has been sitting mostly untouched for these past five years and now that I have some distance from the initial release, I'd like to come back and talk about some of the lessons learned and other thoughts I have on the state of MeowCAD and online electronic design in general.

The Good

To start off, here are some things I'm still proud of in MeowCAD:

It mostly works

There are major limitations on it's use, it slows down for large boards, etc. etc. but it still works. One can quickly design a board, download it and have the Gerbers ready to use.

Though I haven't checked KiCAD compatibility in a while, the KiCAD files are still exported and if they don't work straight away, I would assume they would only take a minor amount of work to be made functional.

It suits a PCB first workflow

One of the design decisions I made was to not prefer a "schematic first" workflow. Instead, you can design in the PCB layout and then retroactively add elements in the schematic editor.

When the schematic and board editor are both open, you can easily see which nets correspond to each pin, as there is cross browser highlighting.

It makes board design accessible

To start designing a board, all you need do is dive right in.

You don't need to go through a complicated interface, choose a board, go through confusing dialogues, etc. It provides a design tool that you can get started with immediately with minimal hassle.

It makes sharing easy

Though this is a feature that is not used as MeowCAD mostly has a community of one (me), there are features for quickly taking snapshots of your board and of sharing a schematic and other board that people can look at immediately.

Separating of code and data

One of the things I believe I got right is that data is a first class object. The code is really meant to be there to manipulate the underlying data and so swapping out code is, in theory, doable.

All the projects and other data are represented by JSON, so it amounts to manipulating a well understood and simple data format.

The UI also has different "tools" that are mostly independent of each other, allowing for extensions. In practice the tools need a lot of knowledge about the UI state, so developing new tools would require a lot of context of the MeowCAD code base and might be intimidating.

The Bad

This list will be a lot longer.

Not getting community buy-in

This was MeowCADs cardinal sin.

By implementing MeowCAD in isolation, without any real feedback from real users, it suffered from weird engineering tangents, esoteric features and missing core features. By not getting at least one other person using the system, I was lost in what to prioritize and lost motivation to work on the project.

Not providing an easy way to import parts

Though this is technically possible (as in there is a feature that I've implemented to do this), practically this is still very clunky. Though relying on third party part creation tools, like the one provided with KiCAD, could be considered a feature (instead of re-implementing another on specifically for MeowCAD), in practice it's nearly impossible to get parts into the system.

This is, as I found out while using MeowCAD, critical. We all have a library of custom parts that are used and without our own special sauce of components, or an easy way to import components that are usable in the projects you want, it's nearly impossible to use.

I've got around this personally by hacking together a library that I've hand crafted and added components too, but obviously this is a horrible solution.

Not providing an easy way to copy "modules"

Here, by "modules", I mean a complete board, like an Arduino Nano or some other module provided by Adafruit or Sparkfun.

I've seen boards "in the wild" that basically do this, put a whole Nano next to a motor controller module just on the same board. As of this writing, Sparkfun just announced a service that will allow you to use their modules in this way, but at a hefty cost of around $1000 for a design fee and, as far as I know, without providing a FOSS piece of software that implements this feature. It looks like there might have been a previous attempt with HackEDA.

In retrospect, I should have made this more of a first class feature as this clearly captures some of the core spirit of open source hardware by being able to reuse and remix previous work. There are many designs that are open source hardware, with Adafruit leading the charge in the sheer number of modules that are implemented, tested and sold, all completely open source hardware, but using them is a pain as any module that you would want to use would need to be painstakingly copy over, using their diagrams as reference.

Lack of nice UI features

  • Push and shove routing doesn't exist
  • Trace "grab and move" features (individual traces segments are treated as independent line elements)
  • GUI niceties like bigger icons, custom fonts, etc.

There are no doubt many more but without a user base, it's hard to know what's important and what to prioritize.

Technical embarrassments

I made many technical mistakes that I'm profoundly embarrassed by now:

  • Using Redis as a backend server

In retrospect, this was so mind numbingly stupid as to be laughable but that's what I did. I would have been better served by either using a SQL backend or even text files on disk rather than the database I chose.

  • Not committing to a project single file

I took the tactic from KiCAD which was to split the schematic and board into their own files, making references to modules are parts. In hindsight, I should have committed to making the project file completely self contained.

I think I made the right decision to have all data in JSON but the idea that we need to save a couple Mb of space by referencing modules or splitting the board and schematic into separate files maybe made sense half a century ago but not so much today.

  • Not using WebPack

I didn't know about it when I started development.

Providing node + front end JavaScript is a solved problem, I just didn't use it and rolled my own weird tooling to get the JavaScript to run both on the backend and front end.

  • Not merging bleepsix and MeowCAD

bleepsix is the graphics engine, of sorts, for MeowCAD. Essentially, all the JavaScript resides in bleepsix with all of the other server infrastructure in the www.meowcad.com codebase.

There was no reason to separate them out. I should have merged them to reduce confusion and allow for better maintainability.

  • Not providing a simpler hosting environment

MeowCAD currently needs a lot of infrastructure to get an instance running. I tried to make this as painless as possible by providing a Docker container but even with the Docker container, it's clunky to use and probably even clunkier to access the underlying projects and other data that users might want.

  • Not providing more transparent data

Projects, users, etc. should all have been at least mirrored on disk in some way, with easily accessible human readable(ish) files.

JSON goes a long way towards making the boards and schematics accessible in this way but I should have committed to other aspects of the data storage.

Going Forward

A lot has changed in the five years since I initially released MeowCAD. For one, electronics has only gotten cheaper, CNC routers that can do PCB isolation routing are available for under $200 and, in some cases, assembly services are getting cheaper than having bare PCBs fabricated domestically in the USA.

Eagle has also recently announced more restrictions on their EDA tools. Sparkfun, while leaders in open source hardware, aren't providing the design tools to the community in any real free/libre way, creating more opportunities for silos, walled gardens and vendor lock-in.

To me, this means board design tools, especially ones that can integrate different rapid prototyping technology, will become more critical. FOSS tools often lag behind professional tools, especially for small niche markets, but eventually catch up once a community has rallied behind them.

Providing an accessible EDA tool was a core motivation for MeowCAD, one that has pretty much failed. I'm hopeful that some tool will come around to fill this void, be it MeowCAD, a more mature KiCAD or some other tool.

While I love that KiCAD exists, that there's a community around it and that there are active projects using it, my heart sinks when I think I need to use it. If a project demands it, I'll probably make the plunge to KiCAD, at least in a more active sense than I am now, but every time I've used it in the past, I'm left with a nagging feeling that electronic board design could be so much better.

From lurking on KiCAD forums, I believe they'd be hesitant to take suggestions on updating their user interface, underlying data representation or other features. I completely understand their perspective and reticence, as they get many "drive-by" suggestions from people that do little more than provide negative feedback.

I don't think the community is so small that there isn't room for more than one FOSS EDA. I also think that alternative EDAs could provide complementary features that KiCAD doesn't focus on.

I think there are many ways to bridge the gap to KiCAD, like providing tools to pragmatically create modules, merge projects and do other automated and non-automated project manipulation. Some of the pykicad programs were created with this in mind (as well as providing the basis for the data of MeowCAD).

All this really means is that I'll be quietly working in my own little corner of the internet, making a tool that's designed for a community of one.

I intend to use MeowCAD more for my personal projects but my focus will be on providing features that match my workflow rather than try to convince others to use MeowCAD or to add features to a hypothetical user that doesn't exist.

Feedback? Thoughts? Be sure to drop us a line in our feedback section!

Happy hacking!


Submitting Boards For Fabrication

2015-06-17

At some point, after you design your schematics and boards, you want to submit them to be fabricated. Whether you use MeowCAD or some other tool, the workflow is pretty similar. We live in a pretty amazing time where this can be done for reasonable cost with only a few weeks delay. Not even 5 years ago, this was a costly ordeal. Sometimes small electronics would order 500 boards at once and hope for the best since the cost of ordering so many more was negligible compared to the overhead cost of ordering a single prototype.

We'll be focusing on submitting the 8 Bit Heart Gerber files to OSH Park for fabrication. We've heard Dirt Cheap Dirty Boards is a decent service that is very affordably priced but we haven't had a chance to use them. We're hoping to make sure our Gerber file generation is robust so we'll be submitting to some different board manufacturer houses but so far we've only gone through OSH Park.

Very roughly, one workflow is as follows:

  • Design your PCB. We'll skip this step and use the 8 Bit Heart project ready in MeowCAD.
  • Collect the Gerbers. The export from MeowCAD includes them but we'll need to collect them for later submission.
  • Submit to the board Manufacterer. We'll be using OSH Park.
  • Assemble. We won't go into too much detail but briefly outline a "DIY" way to do this.

As a quick aside, a snippet of an example Gerber file that we'll be submitting looks something like this:


...
G04 Gerber Fmt 3.4, Leading zero omitted, Abs format*
MOIN*
FSLAX34Y34*
G01*
G70*
G90*
G04 APERTURE LIST*
ADD12C,0.0000*
ADD13C,0.0032*
ADD10C,0.0640*
...
ADD19R,0.0177X0.0787*
G04 APERTURE END LIST*
G54D12*
D10*
G01X22700Y-03900D02*
G01X22700Y-03900D01*
...

For those familiar with G-code, the files might look similar. It's a textual representation how to draw geometric primitives. The APERTURE LIST section holds the primitives (C for circle, R for rectangle, etc.) after which the draw commands are issued with move commands (e.g. G01), specifying which of the apertures to use. For example, in the snippet above, %ADD10C,0.0640*% creates an aperture named D10, a circle of radius 0.064. Later, the aperture is specified with a D10* line and the draw commands are issued via G01X22700Y-03900D02* and G01X22700Y-03900D01* move the pen to x 2.2700 y -0.3900 and then 'streak across' the circle to x 2.2700 y -0.3900. The %MOIN*% directive specifies the units in inches and the %FSLAX34Y34*% specifies that the X and Y co-ordinates are given as 3 digits for the integral part and 4 digits for the fractional part. For more details feel free to check out the Gerber specification document.

Probably way more detail then you wanted to know but it's sometimes nice to know that there's nothing magical going on underneath. It's just a textual representation of the geometry that we want to produce.

Let's download the 8 Bit Heart project. If you hit the Download button, this should download the project with all the relevant files (be patient, sometimes it takes a while).

Once we have the project downloaded we'll take out the Gerber files. It's a good idea to load it in a Gerber preview to make sure everything looks good. Some standard ones are gerbv and GerbView, which ships with KiCAD. There are some online ones as well. Using gerbv and selecting the appropriate files in the gerber directory of the 8 Bit Heart project should give you something that looks like this:


$ unzip bit_heart.zip
$ cd project
~/project$ gerbv gerber/*

We now need to collect the gerbers into a zip file for submission to OSH Park. Load these into their own zip file. For example, here's one way:


~/project$ ls
gcode gerber json KiCAD
~/project$ zip -r my-gerbers.zip gerber
~/project$ ls my-gerbers.zip
my-gerbers.zip
~/project$

Now go to OSH Park and go through the submission process. In the end, you should be deposited to a page that looks something like this:

$11.40 for three boards is very reasonable. OSH Park makes quality boards and they've been very nice about helping us through our process of creating Gerbers from MeowCAD. We've found the boards usually arrive two weeks after submission.

Once the boards arrive it's finally time to solder the everything on the board. We used a re-purposed convection oven and an IR non-contact thermometer we got off of eBay to solder the parts on. This whole process probably deserves a blog post of it's own. The short version is:

Afterwards you should have a functioning board.

This process is long and complicated. Collecting all the parts to just create a small circuit is pretty involved. The barrier to electronics design is getting lower but the threshold is still high. We've got a long way to go before we can do complex board design with ease. Hopefully MeowCAD is a step in the right direction!

Feedback? Thoughts? Be sure to drop us a line in our feedback section!

Happy hacking!


Introducing MeowCAD

2015-06-16

Hi there! This is MeowCAD!

MeowCAD is an online, in-browser electronics design tool that's completely free and open source. Use it to create schematics, printed circuit boards, share with your friends or just play around.

Though MeowCAD has been live for almost 2 years it's only recently that MeowCAD has reached a minimum level of functionality to be considered usable. There are rough corners to be sure but it's in a state where we can use it ourselves to create a schematic, create a printed circuit board, export Gerbers, send it off to be fabbed and get back a functioning PCB.

The board above was fabbed through OSH Park. You can check out both the schematic and the board right here on MeowCAD.

In another post we'll go more in depth about the process of submitting to a board manufacturer but in this post we wanted to start things off with a little description of ourselves.

Here's a screencast (it's about 17m) of some functionality:

Feedback is always welcome, either through the feedback form or through the issue tracker. We'd love to hear from you, positive, negative, rant, rave, whatever.

Have fun and happy hacking!