
Lessons from Running a Small-Scale Electronics Factory in My Guest Bedroom - DominoTree
https://spun.io/2018/12/15/lessons-from-running-a-small-scale-electronics-factory-in-my-guest-bedroom-part-1-design/
======
jdietrich
If you're going to produce a reasonable-sized batch of anything electronic,
I'd strongly recommend:

a) doing some reading on design for manufacturing

b) getting some quotes for PCB assembly services and

c) considering factory-programmed microcontrollers

At quantity 200, you could have simple boards like these assembled for about a
buck a piece. Microchip will program 200 PIC or Atmel microcontrollers from
the factory for about 20 cents each with a $29 setup fee. Unless you're
willing to work for a very low hourly rate, you should probably take advantage
of someone else's economies of scale.

[https://pcbshopper.com/#assembly](https://pcbshopper.com/#assembly)

[https://www.microchipdirect.com/programming/Tutorial.aspx?mi...](https://www.microchipdirect.com/programming/Tutorial.aspx?mid=2)

~~~
DominoTree
I didn't realize assembly/programming services were that cheap and I'll
definitely consider them for final runs of things in the future if it's a
decent quantity like this. I'm just a hobbyist and I enjoy putting these
things together, and most of the time it's just a handful of boards at once
anyways so it's not a big deal.

The real issue was that I had ended up cutting a lot of corners to try and get
things done in time, particularly with regards to testing. Definitely a major
lesson learned.

The MCUs didn't take long to program with a ZIF socket, but once they were
baked onto boards and I was finding bugs that needed to be fixed, that's where
it really turned into a pain doing it over SPI.

After all of that, I still ended up having to bodge 2 connections on all of
the final boards after all was said and done (which was the 5th or 6th board
revision after I did small test runs to play with things and fix issues)

~~~
jdietrich
>The real issue was that I had ended up cutting a lot of corners to try and
get things done in time, particularly with regards to testing. Definitely a
major lesson learned.

Haste makes waste, measure twice and cut once. It's one of the hardest lessons
to properly internalise - bodges and firmware changes can be hugely time-
consuming, so it nearly always makes sense to absolutely nail your prototype
before moving to production.

Congrats on a cool project.

~~~
chaosite
i.e., waterfall really does make sense when you're dealing with hardware.

~~~
DivisionSol
I want to push back on this notion a little bit. I think non-waterfall is
plenty fine for hardware development. If you structure your product
development cycle as a series of (design, build, test, feedback) steps, you
get that valuable feedback much earlier than later.

One/one-hundred-off prototypes are expensive but nothing beats the information
gained from soldering a board, plugging in connectors, and programming chips
directly. You'll do these steps at the end of a waterfall process anyways, and
I'd say they're more expensive to alter then. When a problem is found,
deciding to bodge wire two pads is the high-cost, low-risk solution to
problems found late in the game. Discovering the problem early, fixing it in
the schematic, and testing during your next prototype cycle is cheaper during
production and risk is mitigated because you're still going to be testing
before you ship.

Of course, this is all very much propaganda, and not all shops would follow
this idealistic scenario, but I don't think hardware is any more waterfall
than anything else.

------
xt00
I highly recommend that people try to have a board made before they go about
trying to build the entire thing by hand in a home pcb factory. The cost has
come down a ton over the years on using actual Quick turn fabs.

Depending upon your turn time you can get boards made for say $20-50 for say a
4-6 layer board. For assembly —- that is really the expensive part. Basically
can be hundreds of dollars per board for complex boards. But there is zero way
you are going to build a complex board on your own at home. Toaster oven
style? I mean honestly unless the board is pretty simple it’s basically close
to just hitting the button on a slot machine. Burn some money and maybe you
win maybe you don’t. Best bet is to start small — like one micro plus some
passives and solder all the components onto the board yourself. Once you
determine your board is good then build up from that. Lots of SW folks are not
used to spending money to prototype something — they still click the “still
evaluating” button on winrar for like 10 years solid. So yea hw takes a bit of
guts to click the buy button and wait and hope for the best.. my advice just
do it! Definitely my personal phrase there..

~~~
RossBencina
> click the buy button and wait and hope for the best.. my advice just do it!

Speaking from experience as a sw guy, the "hit buy and pray" approach should
be preceded by as many desk-checks as are humanly possible. For example: Use
the design verification features in your CAD program. Print the PCB onto
paper, place all the components on it to check for component clearances and
orientations (no-one would lay out a connector upside down, would they?)

I think I got that last idea from one of Robert Feranec's DFM tips, lots of
good ideas there:
[https://www.youtube.com/playlist?list=PLXvLToQzgzddPKq_txEXN...](https://www.youtube.com/playlist?list=PLXvLToQzgzddPKq_txEXNe0pxaSHqPtMO)

------
Gibbon1
> The first step was to forcibly disable 1) the display, 2) the radio, and 3)
> the flash chip from using the SPI bus by adding three jumper wires to tie
> their CE pins to VCC.

A couple of things I found helpful.

Use a standard connector for in circuit programming. It just makes developing
and debugging so much easier. Being able to easily swap parts of a development
setup to see if the problem follows a piece of hardware will save your hair.

For AVR's where the programming interface is shared with the SPI Bus, always
put pull ups on the chip selects for SPI's bus parts. As you learned those
parts can fight the programmer if you reset the processor while they are
holding the bus.

Also for AVR's I've seen mis-programming set the fuses to a clock setting that
isn't supported by the hardware. Like programming an very low speed clock or
an external clock when there is none. On our test jigs we resorted to
injecting a 1MHZ clock on the xtal input pin when programming. Providing for
this will be it easy to recover bricked board.

Having a command line interface for running tests is really really helpful.
Use one of those USB to serial adaptors by FDDI. I found USB kind of sucks
because plugging and unplugging USB ports a lot seems to often confuse OS.
I've seen the US just give up on a USB port that it thinks is hosed. Either
that or the drive gets messed. And you need to reboot. Using serial solves
that problem.

And for small runs of boards try designing a simple loopback teststand. Just
loop IO back through the test stand and use the host uP to run the tests.

C#/.net gets a lot of hate, but works really well to drive a single device
under test. That allows you to slap together a simple GUI based test that you
can offload onto someone else. You don't need anything but the programmer and
a USB to serial adapter. You can shell out to run AVRDude.

Consider barcodes and barcode readers to keep track of boards. Failing that
invest in QC tags.

------
meta_AU
Making test points for all your testable functions and aligning them to a
stripboard really simplified making a testing jig. You can solder some pogo
pins to the strip board and just press each board to your jig to program/test
it.

Also, I've found renumbering passives to keep the same values in contiguous
groups to simplify hand prototyping. You end up having dozens of 0.1uF for
example and it's nice to knock them all out instead of switching between
different components

~~~
DominoTree
For hand assembly I usually break out all of the components into little iFixIt
project trays and print out labels that correspond to the board, but when
there are a bunch of components with the same value, I just put the value on
the label instead, and use highlighters on to point them out on printouts so I
don't spend forever hunting where to place them. Then, I just go one by one
down each spot in each tray until I've populated a board, then I throw it in
the oven and start on the next.

[https://pbs.twimg.com/media/DvIU0gSXQAE883Y.jpg:large](https://pbs.twimg.com/media/DvIU0gSXQAE883Y.jpg:large)

[https://pbs.twimg.com/media/Dv2KXBuW0AAQY5c.jpg:large](https://pbs.twimg.com/media/Dv2KXBuW0AAQY5c.jpg:large)

~~~
jacquesm
That is a nice idea, thank you!

------
sbierwagen
Just two weeks ago Bunnie also posted a good article on test jigs for
electronic equipment:
[https://www.bunniestudios.com/blog/?p=5450](https://www.bunniestudios.com/blog/?p=5450)

Echos many of the important lessons learned in this piece.

~~~
srcmap
I worked with foxconn on one of those type of test jig for a tablet type of
product before. They are custom make for the PCB, but very nice to have. You
can reprogram the PCB in about 1 minute, the PCB is is perfectly align to the
Jig and the test pins line up with the JTAG and you can program EEPROM, or
EMMC it from the JTAG software.

------
mcphage
This was actually a surprisingly actionable list of suggestions... thanks!

~~~
ngcc_hk
Also in this commentary are good pointers. Hope someone can come out to talk
about how to make their 100-200 boards and the mistakes or good things to
lean.

------
yobananaboy
Oh shit I got one of these! Awesome to see what work went into it, I've been
thinking of making my own badge next year!

------
ansible
As far as numbering components goes, we typically will number all the
components on page 1 in the 100 series, page 2 the 200 series, etc. So the
first resistor on page 1 will be R100, the 2nd R101, and so on. And it is good
to have the components numbered such that related ones are in the same range.

On a large design, this makes it much easier to find the right section.

~~~
qquark
When not too constrained by size and particularly for prototyping, I tend to
use short descriptive names that are not too hard to decode. For example you
could use Cby* for bypass capacitors, or maybe if you have a series of LEDs,
then you could have Dr _, Dg_ , Db* depending on their color, and similarly Rr
_, Rg_ , Rb* for their respective resistors, or Rpi* for I2C pull-up
resistors, etc.

Sure you could have a look a the traces to find those out, but it's not always
straightforward.

This makes a big difference when debugging boards IMO. For example now if you
see that your blue LED is too bright again (as is usually the case ;)), you
can just look for Rb* and fix it without the schematic.

------
fegu
In mature markets, such as the EU and US, there are extensive requirements
behind the FCC and CE marks. While no third party approvals are necessary, the
requirements are still there. Especially the radio noise requirements can be
difficult. How do you go about solving and documenting these?

~~~
pjc50
The three viable solutions are:

\- sell it as a "kit" or "component", something that doesn't stand on its own;
these don't need approval

\- stick the CE mark on there and rely on nobody checking it. This does leave
you open to future legal action, but it's quite rare.

\- stay out of the market entirely and abandon the field to Chinese postal
vendors who will never be held accountable

(same goes for WEEE registration in the EU)

------
projektfu
Lining up the 0.1in grid is a great lesson I wish had been learned by the
Arduino inventor. I'd like to name them but it's unclear to me who to credit
for an otherwise very useful board.

------
mch82
Has anyone had experience with Fritzing.org or something like BotFactory for
low rate production like this?

BotFactory: [https://www.botfactory.co](https://www.botfactory.co)

~~~
ThrowawayIP
Friends Don't Let Friends Use Fritzing.*

KiCAD offers a free open-source EDA package that won't limit you after you
learn how to draw your first electrical schematics or layout a PCB.

(Disclaimer: Fritzing is a perfectly fine project for someone's first
introduction to electronics. Eg. Blinking an LED with an arduino. It quickly
runs into limitations because of it's use of point to point wiring on
pictographic components)

------
danmg
The infamous rucas. ~~

------
agumonkey
Basically TDD

