CBA Circuit Best Practices
Notes for beginners and reference for experts on the nuts and bolts of circuit design and manufacturing. This repo also includes libraries of some common components from the Fab Lab inventory for Eagle and KiCAD.
Design
Schematics and Boards
No matter what software you're using, it's important to understand the two representations we use to describe circuits.
To jump in, I've included this example eagle project that you can clone (it will probably even work!) to see what-all is going on when you're designing circuits.
The schematic
is a nonphysical space where we can describe which outputs or inputs from our various components are connected to one another. In a schematic, we find part symbols
that pave pins
, these are connected to one another on nets
.
Critically, we can connect nets to one another by simply assigning them the same name. This is a useful trick that you will probably encounter many times in the wild. Also important to note are supply
components, like the gnd and v+ or +3v3 etc symbols, which are simply symbolic representations of similarely named nets.
It's not-not useful to recall that schematics are also nice visual diagrams of what we want our circuits to do. There's no harm in making them look medium-nice. :bowtie:
The board
representation is where our design meets the physical world. Here we find footprints
that have pads
that are connected to one another via traces, vias, and pours
i.e. copper.
In Eagle, boards
and schematics
should be automatically associated with one another. This is referred to as 'forward/back annotation' - but typically goes one way: from the schematic to the board. It's best, while we're starting, to treat this relationship as a directional one. I.E. when you're deleting a component, do so in the schematic, otherwise you will introduce inconsistencies and Eagle might abandon you.
KiCAD uses a different system, where we save a netlist
from our schematic, and open that in a board editor. This is partially an opinion about the division between the two practices, and partially a historic artefact of KiCAD's development as a collection of not-unrelated softwares.
Symbols and Footprints
Our circuit assemblies are made of schematics
that are diagrams of our boards
, and so the components we use to put them together have a similar split; we call them symbols
and footprints
.
A symbol
is a diagram of a part, and the footprint
is the 'landing' that we need in order for the part to be successfully included in our circuit. The matching copper for us to hook the IC to.
Symbols can have multiple footprints: the same or similar silicon divices can be packaged in varying sizes for circuit integration.
To make your own symbols or footprints, I can recommend Autodesk's Tutorial, starting here and for KiCAD, the symbol, footprint, and the association.
Libraries
To organize collections of parts, we use libraries
of devices: paired symbols and footprints. For eagle, I've included our CBA libraries in the eagle/parts directory of this repo. I've also included the sparkfun libraries as I commonly use their connectors library for pin-headers. Parts in the fablab
library should all be available in fab labs, but it's best to check with actual inventory before designing a circuit. It's also likely that parts in the inventory are not yet in the library: if you find this to be the case, and you make a footprint for a part you would like to use (or find one online) please push a merge request, or raise an issue in this repo!
The fablab inventory includes all of the circuit components that should be available in the lab.
Manufacturing
Different methods of circuit manufacture have different constraints. We commonly call these design rules
- they define a variety of things, the most important being the trace/space
dimension: how thin can we make a trace, and how much gap must we leave between each different signal? The next important question is about how small our minimum drill size is: this sets the diameter of our vias.
For 'most' fabricators, a lenient (easy to fab) trace/space is 8/8mil
(mil: 1/1000 of an inch: 8mil: 0.2032mm), with a 0.35mm minimum sized hole (that's 13.8mil). For some reason, we commonly refer to 'mil' for traces and mm for holes. The world is full of idiosyncrasies. Fabricators who can't do this are really, really not worth the time.
For the circuit milling we do in the lab, we set our space by the width of our end-mills: the 1/64th endmills are 15.625mil in diameter, so for some error band I use a 16mil space, and to avoid accidentally milling traces away, I typically set a 12mil trace. 12/16 means it is occasionally difficult to mill footprints for newer component packages like a QFN. Drilling holes under 1/32" is also a pain, so I'll normally set my minimum drill to 32mil.
In any case, if you'd rather not think about any of this, I've included some Eagle design rules files in this repo in the eagle/design-rules folder. You can load these into eagle in the board-design window through edit >> design rules
, or the drc
command. Once you've done this, you can run the 'drc' command to check if your design violates any of the rules.
TODO: want to keep a list of manufacturer design-rules files or board templates (grid etc) for two- and four- layer fab at factory.
Automating the generation of trace.png and cutout.png files
Matt Keeter wrote a Python script that opens up Eagle and exports a number of pngs using ImageMagick. Last I know, this is tested for Eagle 7- or 8.
To get this script to run, use the following steps:
- Save eagle/scripts/eagle_png.py into the folder where you keep your Eagle project folders containing .brd and .sch files
- Install ImageMagick
- Create a polygon over your .brd design on the Milling layer (number 46)
- Set the isolate value for the polygon to a number greater than 16, this will ensure there's enough black space for mods to generate toolpaths in (see image below)
- Save your .brd file and close Eagle
- Run eagle_png using the following command
python eagle_png.py board_folder/board_name.brd
- The script should have saved several .png files into the folder where the .brd file is
Note: With later versions of Eagle (9.0.1+), by default it is configured to show text similar to "1-16" ontop of each via. This comes through even when exporting your final image. To remove this artifact, type the following in the commandline:
SET Option.ViaLength 0
SMT Manufacture
TODO: doc here for more advanced manufacture; particularly the simple step to stencil and reflowing boards!
Adafruit already has some great notes on SMT manufacturing.
L1: boardfab, solder by hand
Export
Making Gerbers
L2: paste, stencils, and tweezers
L3: diy pnp
L4: circuit assembly
For assembly, some miters tips are
- circuithub
- lightspeed manufacturing (in MA)
- tempo automation
- maybe worth trying jlc/easyeda - just have to constrain boards to parts they have (probably)
Component Notes
Half the struggle of EE (in practice) is finding the right components to assemble your circuits with. Below are my own very rough notes on parts-that-I-have-once-used-or-thought-about, that I will be maintaining here to help in the search.
LEDs
LED | PN | VDrop | mA | R for 3v3 LVL |
---|---|---|---|---|
White 0805 | 1516-1085-1-ND | 3.1 | 20 | 10R |
Red 0805 | 516-1427-1-ND | 1.8 | 20 | 75R - * mark is backwards (?) |
Green 0805 | 516-1434-1-ND | 2.2 | 20 | 55R |
Blue 0805 | 516-1445-1-ND | 3.4 | 20 | -5R (haha) |
Yellow 0805 | 516-1433-1-ND | 2.1 | 20 | 60R |
LED 0402 Green | 516-3066-1-ND | |||
LED 0402 Yellow | 516-3060-1-ND | |||
Warm White 5630 | 1510-1412-1-ND | |||
Cool White 5630 | 1510-1519-1-ND |
Connectors, Signal
Positions | Series | Current | PN | Notes |
---|---|---|---|---|
6 | JST-SH Jack | 0.2 | 455-1792-1-ND | Vertical |
6 | JST-SH Jack | - | 455-1806-1-ND | Horizontal |
8 | JST-SH Jack | - | 455-1808-1-ND | Horizontal |
8 | JST-SH Cable | - | 455-3000-ND | Reversed 2" |
8 | JST-SH Cable | - | 455-3004-ND | Reversed 6" |
8 | JST-SH Cable | - | 455-3008-ND | Reversed 12" |
6 | JST-SH Cable | - | 455-3015-ND | Normal 6" |
6 | JST-SH Cable | - | 455-3003-ND | Reversed 6" |
- | RJx Tool | x | K582-ND | crimper! |
4 | RJ10 Jack | - | 609-4469-1-ND | |
6 | RJ12 Jack | - | WM5567CT-ND | |
6 | RJ12 Plug | - | AE10315-ND | |
8 | RJ45 Jack | - | 732-3164-1-ND | tab up, smd |
8 | RJ45 Plug | - | AE10316-ND | |
4 (usb) | USB Micro | - | 609-4613-1-ND | smd, used in module, router (2019-10-06) |
1 (pogo) | Pogo! | - | ED90385-ND | smd, not pnp |
Connectors, Small Polarized IDC
Description | PN |
---|---|
picoflex 20 plug-board | WM3966CT-ND |
picoflex 20 cable-plug | 23-0903270320-ND |
20 line idc cable | 3M157973-25-ND |
picoflex 6 plug-board | WM14387CT-ND |
picoflex 6 cable-plug | WM19231-ND |
6 line idc cable | 3M156095-25-ND |
picoflex 4 plug-board | WM19275-ND |
picoflex 4 cable-plug | WM19230-ND |
4 line idc cable | 3M156838-25-ND |
Connectors, Power
Description | PN |
---|---|
poke-in power | WM17990DKR-ND |
2 | |
Power Spade 18-20 AWG | 277-11144-ND |
Power Spade 14-18 AWG | 277-11150-ND |
Power Spade Molex Small | WM9606-ND |
Power Spade Molex Large | WM9610-ND |
Power Pin M3x3mm tall | 732-5270-1-ND |
Power Pin M3x4mm tall | 732-5271-1-ND |
Power Spacer M3x3mm tall | 732-7087-1-ND |
Power Pin M3x6mm tall | 732-5273-1-ND |
Power Pin M2.5x6mm tall | 732-7102-1-ND |
SAMTEK-10-Debug SAM8796-ND
CHEAP-10-Debug 1175-1629-ND
CRIMP M3s 16-20AWG 277-11117-ND
Mezzanine ATK Female (Tops [Mother Boards]) H1215-ND
Mezzanine ATK Male (Bottoms, 3mm Stack) H10686-ND
Mezzanine ATK Male (Bottoms, 4mm Stack) H10691-ND
miniPCIE A123340CT-ND
Nice Power Terminals conn free WM10425CT-ND
'power series' power conn
https://www.digikey.com/catalog/en/partgroup/power-series/26832?mpart=1744042-1&vendor=17
A112198-ND
A102007-ND
1744042-1-ND
2x10 952-2359-ND -> gray and fancy 609-4473-1-ND
2x10 SAM14005CT-ND (lower profile)
8mm spacers, 732-7113-1-ND
10mm spacers, 732-7119-1-ND
2x10 0.1" 15.75mm x 2.8mm SAM1066-10-ND
2x10 0.1" 15.75mm x 5.84mm S2061E-10-ND
USB Micro AB 609-4613-1-ND
Molex Edge Crimp-in Connectors EDGEMATE 172159
Cables, Wiring
100ft 16AWG Silicone Red CN665R-100-ND
100ft 16AWG Silicone Black CN662B-100-ND
Sensors
10 bit Absolute AEAT-6600 516-2636-ND
10 bit Absolute AEAT-6600 Diametric Magnet 469-1076-ND
Hall Effect DRV5053 296-41083-1-ND
HALL Discrete S5712
Hall Discrete Mag 469-1020-ND
RTD 1k oHm - 223-1563-1-ND
Distance Time of Flight 4m 497-18884-1-ND VL53L1
Distance TOF 2m 497-16538-1-ND pin-compat w/ VL53L1 (is VL53L0)
Magnets
6x2.5mm Diametric 469-1070-ND (ok for as5047)
8x2.5mm Diametric 469-1076-ND (good for as5047)
0.25" x 0.25" (for pnp feet) 469-1003-ND
uC
ATSAMD51 ATSAMD51J18A-MUTCT-ND
ATSAMD51J19 (ada type) ATSAMD51J19A-MU-ND
ATXMEGA - ATXMEGA256A3U-MH-ND
PMIC
| 16-ch LED driver tlc5940pwp | 296-35975-1-ND | | 5vreg module | 945-3042-ND |
3.3V ldo 600mA AP2112 - AP2112K-3.3TRG1DIDKR-ND
3.3V buck 2A TS30012-M033QFNRCT-ND
5v buck 2A 24V TS30012-M050QFNRCT-ND
5v buck 2A 40V TS30042-M050QFNRCT-ND
Integrated Buck ... 1.2A, fancy 1589-1756-1-ND
5v LDO Buck Drop-In Switching Module 2A 945-3042-ND
5v Module 12W 1866-4374-ND
5v Mean Well Module 2A 1866-3625-ND
5v Mean Well Module 3A 1866-3633-ND
5v Module Switching 2A 811-2657-ND
DRV8323xx -
UCC27212: 4A, 120V gate driver
1460-1069-6-ND - TMC262 Step Gate Driver
620-1769-1-ND - A4955 H-Bridge Gate Driver
TPW4R008NHL1QCT-ND - bldc fet candidate
497-15314-1-ND - N23 pnpair
TSM6502CRRLGDKR-ND - N23 pnpair alternate
800-3745-1-ND - N17 pnpair
CSD88548 - 40V Half Bridge 296-46923-1-ND
CSD88599 - 60V Half Bridge 296-48289-1-ND
Comm
CP2102n USB UART - 336-3693-ND
RS485 Driver 2/0 296-9964-5-ND
RS485 Driver 2/2 296-14348-6-ND
RS422 1/1 Full Duplex w/ term LTC2855IDE#PBF-ND
Optoisolator 2/0 516-2172-5-ND
Heat
thermal tape 3M10315-ND heatsinks
- Adafruit Heatsink 1528-1698-ND
- 21x21mm 345-1098-ND
- 28x28x6.5 345-1111-ND
- 28x28x9 345-1100-ND
- 19x19x6mm 294-1146-ND 7.1deg/W
- 41x41x9mm 294-1103-ND 4.5deg/w
- 40x40x12 294-1162-ND 1.9 deg/w
- 40x40x9 294-1160-ND 2.5 deg/w
- 40x40x6 294-1158-ND 3.3 deg/w
- 41x41x25.4 ATS1329-ND 2.4 deg/w
fans
- 50x50x15mm 102-4367-ND
- 50x50x20mm 603-1359-ND
Switch
Slide Switch 563-1340-1-ND
Switch for hella AC Amps 360-1897-ND
Safety Stop Kill for PSU Z1504-ND
Reset Line CKN10685CT-ND
Reset Line 90deg P16767CT-ND
Hella IEC C13 486-2264-ND
Power Entry 486-3979-ND
Power Entry 10A Fuse 486-1226-ND
Passives
4.7uH 2A 72Mohm 587-2407-1-ND
6.8uH 2.3A 52Mohm 587-3462-1-ND
10uH 0.15A 360M 0805 445-17073-1-ND
100uF 35v SMD 6.6dia PCE3951CT-ND
0805 Diode - 478-7802-1-ND
TVS Diode - SMAJ30ALFDKR-ND
40V 3A Diode - - FSV340FPCT-ND
16MHz Resonator - 1253-1339-1-ND
16MHz Crystal SER4370CT-ND
RCT 32 kHz XC1617CT-ND
| R 0402 470 | 311-470JRDKR-ND | | bleed r, calc | 2k7 A126466CT-ND / 1k CRM2512-JW-102ELFCT-ND |
| R 0402 470 | 311-470JRDKR-ND | | R 0402 1k | 311-1.0KJRDKR-ND | | R 0402 2k2 | 311-2.2KJRDKR-ND | | R 0402 10k | 311-10.0KLRDKR-ND | | L1 0603 10uH 300mA | 445-6755-1-ND |
| C0402 10pF 50v | 1276-1139-1-ND | | C0402 1uF 50v | 587-6278-6-ND | | C0603 10uF 35v | 490-13248-6-ND |
Crystals, Oscillators
| MHZ Crystal 4-SMD-3.2X2.5 | SER4046CT-ND | | kHZ Crystal 2-SMD-3.2X1.5MM | SER4088CT-ND |
BFCs
4700uF 35v 493-1088-ND 18d x 7.5l x 35.5
2200uF 35v 565-1590-ND 18d x 7.51 x 25.5
1000uF 35v 493-1589-ND 18d x 7.51 x 15
100uF 450V 1572-1660-ND 18d x 7.5l x 35.5
150uF 6.6x6.6 SMD Aluminum PCE5017CT-ND
47uF 400V P13546-ND ibid
Shunt Resistors
3mOhm 1% 3W 2512 CRE2512-FZ-R003E-3CT-ND
50mOhm 1% 3W 2512 CRA2512-FZ-R050ELFCT-ND
100mOhm 1% 3W 2512 CRA2512-FZ-R100ELFCT-ND
Solder Paste
SMD291AX250T3-ND