Get a Mothbox Pro PCB

The cool thing about a Mothbox Pro is that we have integrated most of the electronics into one, easy-to-assemble board (that’s also less expensive than buying all the separate parts). You should be able to order this with many international manufacturers and we will provide an example tutorial of how to do this below. Depending on your parts, order size, and location, you can get this board usually for around $24-$60 USD.

If you don’t want to manufacture one yourself, we are working with the Open Science Shop to make a network of people selling these PCBs. So if you want to try to just buy a pre-made pcb, just fill out this interest form and we will try to get back to you ASAP!

Manufacture Your Own PCB Example (via JLCPCB)

We aren’t being sponsored or anything by JLC (if they want to, that would be amazing!), but they are a manufacturing service we have worked with before and have had a lot of sucess with.

Here’s how to take our open-source designs from KiCAD to a fully manufactured board.

Open the Design Files

(If you don’t want to edit the file in KiCad you can skip ahead to the manufacturing part by just using these files we already produced! First clone the github repository of all our design files.

Open it up in Github and make sure you have the latest version image

Download and install KiCAD (We are using version 9).

Go to the latest version of the PCB. You will likely find them in this folder GitHub\Mothbox_Electronics\Mothbox_PCBs For this example we are using version 5.0.5

image

Open the Andy_PCB_5.0.5\MothBox folder

find the file that ends with “.kicad_pro” This is the “project file”

For instance, in this example it would be Mothbox_5.0.4.kicad_pro (why does it say 5.0.4 instead of 0.5? that’s because andy is new to kicad and was worried about changing the name and possible downstream consequences).

Double click the project file and it will open up this project interface. image

Install Plugins

Before we get started, we want to install some plugins that will make life a lot easier for us!

Click the “Plugin and Content Manager” button.

Search for KiCAD JLCPCB tools and JLC fabrication toolkit image

If you cannot find JLCPCB Tools (The main plugin we are using) you can install it easily with instructions here.

Open PCB Editor

In the KiCAD project viewer, double click the .kicad_pcb file

image

You will then see a new window open showing your PCB layout. Now click the JLC Tools button up in the top bar.

image

This opens another window that lets you look at all the parts that go into creating your PCB. It will even let you know what parts are available at the manufacturer and you can rotate parts around if needed.

**You don’t actualy have to do anything here except hit the big GENERATE button **in the top left.

image

This button creates a folder of all the files the manufacturer needs to make your board!

Mothbox_Electronics\Mothbox_PCBs\Andy_PCB_5.0.5\MothBox\jlcpcb

image

Load files to JLCPCB

Now we are going over to the manufacturer’s website to send them the files to have them start making this tool for you! This walkthrough will show you how to do it with JLC’s interface, but many other manufacturers have very similar interfaces!

First go to JLCPCB and sign in.

click the big “Get Instant Quote” button in the middle of the webpage (don’t worry about the settings, we will change them).

This gives you the big page we can set everything up!

image

Click the “add gerber file” button, and navigate to the production files folder we generated and find the GERBER-Mothbox file (should be a zip file)

image

It will process those files and show you a preview of your cool new board.

Now we will set up all the parameters.

Change the Quantity?

Most of these options we will leave as the default. It’s a 2 layer board, made with FR-4

The main thing you might want to change is the PCB Qty. It defaults to 5, but you can make thousands! image

Specifications: Get rid of lead! (yes!) Change the Color? (probably no)

Most of these options you will leave as the default. I will reccomend paying the extra dollar or so to make your board with lead free solder.

image

You can also change the color of the board from the default green, but unless you are really particular about the color of your board, leaving it as a default green will help it get manufactured quicker (and in some manufactueres the green color is MORE PRECISE!?).

High Spec options

You can leave everything as the default here if you want. image

The only thing I tend to change is adding an serial number as a 2D barcode.

image

We already included a 10mmx10mm spot on the back of the PCB that lets JLC know to put a barcode there. You just need to click the 2D barcode option and choose 10x10

PCB Assembly Options

The only thing I change is

  • make sure Assembly side is BOTH SIDES
  • Set the quantity you want created

  • (optional) you can pay a small fee to store the stencil and fixtures if you are going to make more of this exact thing in the future. otherwise don’t worry about it.

image

Advanced Options PCBA

I don’t change anything here: image

Hit the big NEXT Button

Do it! We are ready to get to the trickier parts! It’s still not that tricky, but this is where the friction can lie!

image

Configuring Parts

The next screen will show you a preview of your PCB without parts on it.

image

Just hit the big Next button.

Now it wants you to add two more files. Luckily those two files (BOM and CPL) are in that same production folder we generated earlier! Upload the BOM and then upload the CPL.

image

Then click “Process BOM and CPL”

Processing Bill of Materials

This can be the trickiest part of the entire operation. This is where you have to sometimes deal with real world items which may be unavailble or have fluctuating prices.

Luckily there shouldn’t be too many serious difficulties with the Mothbox BOM as we tried to design for common popular parts that are easy to find.

Nevertheless, (let’s say we did this for pedagogical reasons ;) ), we left a couple tricky parts to show you how to overcome common obstacles.

How to Handle BOM Errors

In the future we might streamline our PCB files even more so there are fewer errors that will pop up on this step. But we will show you how to deal with common errors regardless so that if you are doing a different type of PCB, you will now better how to deal with these errors.

First Check out your BOM

The Bill-of-Materials (BOM), lists all the parts that will get assembled to your board. Ideally all the items will have a nice blue check mark to the right of them. If that is the case you are all set to go to the next step!

But there will likely be a couple error marks that need your attention:

image

Common Problem 1: LCSC number is in wrong spot.

In our above example, the parts labeled like C2 or C13 have an error and we know that because there is no blue checkmark next to those items.

To fix this error, first click on the magnifying glass.

Then you will go to this new window where it tries to find parts for you. It does an automatic search for you to try to guess the part you want, but in this case we already know the part we want!

Every item in JLC’s sister company LCSC, has a special number called an LCSC number. Sometimes (because maybe the people making the PCB didn’t know EXACTLY what they were doing), this number gets put in a weird spot!

image

Luckily our LCSC number was included for this part, it was just in the wrong spot. You can just copy it and paste it into the search bar. Hooray the part showed right up. You can hit “Select”

image

Then hit “Replace all”

image

Now there is still a warning

It says ` Multiple lines in the BOM have been matched to the same part. Please check if the matching is correct.`

but that’s fine. Some of the parts just had slightly different labels, but they should be the same. Importantly we have that nice blue check mark and those lines are happy!

If you scroll down on the BOM, you will find the same kind of error for parts like U10 and U11

image

You can do the same thing, just copy that LCSC number and paste it after you hit the searching magnifying glass.

Common Problem 2: Part out of Stock.

The next common problem you can have is that a part might just be completely out of stock! This is what happens when you see a “shortfall” error. This step will require you to have a little bit of knowledge about what the electronic parts do.

image

Luckily there are often many brands making very similar parts!

With parts that are out of stock you have two options:

  1. Ignore it, and leave this part off
  2. Find a new part that will fit

For option 1, you can just hit next. In our example with the Mothbox board, this missing part is a green indicator LED that is just used for debugging purposes. You can actually just leave it off and it should not affect the device at all.

Finding replacement parts

For thoroughness though, we should figure out if we can find a suitable replacement.

First, let’s look at the missing part. We know its LCSC number is C72043.

We can go to jlcpcb.com/parts/ and paste this special number in.

This will bring us to the information page for this particular part. This page will look like this.

image

This shows us that, yes this part is out of stock. But importantly it shows us the other information about this part.

There’s two key things we are looking for in replacement parts, Package, and All-the-other-details (Description).

Package

There are a set of standard sizes that electronic parts are made, and these can sometimes be called the “Package” or “Footprint.” Importantly, any replacement part we want to swap in at this stage needs to have this same package. For this LED, package is “0603” (this is a common LED size which means it is 0.06 INCHES long by 0.03 INCHES wide)

image

All-the-other-details (Description) Next we need to make sure all the important details of the thing we swap. These details are often listed under the “description.” We can copy the details we think are important along with the package size and search for a new part. The important details we are looking at for this led are 1) its color (green) 2) its voltage (3.3v)

Search for a new part

Go up one category from the part you are looking at. (In this case go to the category “LED Indication - Discrete” )

image

Filter by the “Package” size. Note sometimes the package size may be written in multiple ways like “0603” or “LED0603”

Hit APPLY

image

Next, look at filters for the other details you want. for instance we will filter by color (anything green-ish should be fine for this part!) Hit APPLY

image

After this filtering, we can see the top result is LCSC number C497926 a green led that is 3.3V and has 19 THOUSAND parts in stock.

image

Replace the part

Copy its number and go back to your BOM page. After hitting the search bar on the part, past the LCSC number and go! image

Set Rotations

After all the parts have been chosen, the next step is just making sure all the parts are going to be put onto the board correctly!

You will be at a screen that looks like this: image

I like to click the “2D” button at the top because i find it easier to navigate.

I have included reference images so you know how all the parts should look like. This is the front of the board and this is the back. Just make the parts look like each other!

I have also included some handy notes from when I went through this process, and that notes file is available here: https://github.com/Digital-Naturalism-Laboratories/Mothbox_Electronics/blob/main/Mothbox_PCBs/Andy_PCB_5.0.5/MothBox/RottationsInJLCPCB.txt

it tell us that the only thing we need to rotate is U15/16 U9 which need to get rotated 180 degrees.

Click on U9, and it will zoom to the part, and we can see that, yes, indeed, U9 is flipped 180 degrees! (notice how the pink indicator dot isn’t lining up with the white dot on the silkscreen?)

image

Click the rotate button at the top to fix this one, and then make sure to fix U15 and U16 too!

Look at how nice this looks when it is in the fixed, correct orientation :)

image

Get ready to order the board!

When you have finished the part rotations, all the hard parts are over!

It will generate a quote for you. It will also make you give it a description. I usually choose “other” and write “light for insect camera.”

image

Then hit “Save to cart”

Pay for the board, and Wait for any comments from the Engineers

Finally, you are at the checkout page. Select the PCB and PCBA, pay for them. image

You will receive emails as they process the devices and give you updates or may need your feedback on things. But mostly you are done!