Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Aahei98/kicad
  • krisjanis.rijnieks/kicad
  • ricardo.marques/kicad
  • honnet/kicad
  • ari.vuokila/kicad
  • manojsahukar/kicad
  • pub/libraries/electronics/kicad
7 results
Show changes
Commits on Source (210)
Showing
with 35832 additions and 135 deletions
......@@ -5,3 +5,4 @@
*.FCStd1
kicad-library-utils
test-project
*.FCBak
# This file tests integrity of libraries in this repository
# Created by Krisjanis Rijnieks on 2 May 2020
image: python:latest
before_script:
- git clone https://gitlab.com/kicad/libraries/kicad-library-utils.git
- python -V
- apt update && apt install -y jq
- git clone --depth=1 https://gitlab.com/kicad/libraries/kicad-library-utils
stages:
- stage_test_inventory
- stage_test_footprints
- stage_test_3dmodels
test_inventory:
stage: stage_test_inventory
script: |
echo "Do we have all parts in inventory covered?"
./tests/inventory.sh ./fab.kicad_sym ./tests/whitelist.txt
test_footprints:
stage: stage_test_footprints
script: |
echo "TODO: Do we have footprints for all symbols?"
test:
script:
- ./klc-check.sh
test_3dmodels:
stage: stage_test_3dmodels
script: |
echo "TODO: Do we have 3D models for all footprints?"
# Contributing
Please follow the [KiCad Library Convention](https://kicad-pcb.org/libraries/klc/) before contributing.
This library is supposed to reflect the active state of the Fab Inventory. Some legacy parts might be there, but generally the idea is to keep the library simple and easy to use for beginners. Keep that in mind when you have that one fancy exotic superpart that you def wanna add.
TODO: Use official [KiCad Library Utilities](https://github.com/kicad/kicad-library-utils) to check and fix libraries.
## How Do I...
Take a look at the [KiCad File Format DEF](https://en.wikibooks.org/wiki/Kicad/file_formats#Description_of_DEF). As for the FAB library there are a few things to keep in mind:
Easy...
- In schematics, keep the IC background filled.
- Leave passive components not filled.
- Adjust the footprints so that they are easy to hand-solder.
1. Clone or `git pull` the latest version of the library from here.
> Run `test.py` before pushing changes to reposotory.
1. Add a symbol first and check if there is a generic footprint (e.g. SOIC-8) available before creating a new one.
It will check if everything is right. It will help you fix errors if any. The script is run automatically when push to the repository happens. However it is best to do it before pushing locally. The following is a list of what the script does.
1. Add manufacturer ID number to the keywords field of the symbol you are adding. It is used by the repository CI tests to compare all schematic parts with the electronics parts list in the [Fab Inventory](http://inventory.fabcloud.io/). The test script can be found in the `tests` directory. Refer to the `.gitlab-ci.yml` file for more details.
- [x] Match symbol DEF name with its F1 name
- [x] Check if the footprint entry has a library field (fab:Part_Name)
- [x] Check if the footprint fab.pretty/footprint.kicad_mod file exists
- [x] Check if footprint is mapped to a symbol in the library
- [ ] Check if the footprint file name matches the name in the file
- [ ] Check if footprints are visible also on layers F.Cu F.Paste F.Mask
- [ ] Check naming structure PartName_SizeXYZmm_Pitch
- [ ] ...
1. Please follow the [KiCad Library Convention](https://klc.kicad.org/) before contributing. The official KiCad library is split into categories such as connectors, motor drivers, LEDs. The future of the Fab library is that. For now category name is used as a prefix, for example "LED_" or "MotorDriver_". Then we use the manufacturer name and the product number of the part (not the DigiKey one, but the actual manufacturer number).
This library should have all the basic components and parts for the FabAcademy and it's always under construcction. If you want to contribute and add more components to the KiCad libraries, feel free to follow this manual.
1. Whenever adding a new part, use official [KiCad Library Utilities](https://github.com/kicad/kicad-library-utils) to check and fix libraries. There are some things that are not fully respected, such as using rounded rects for rectangular footprints. We use regular rects due to compatibility with some PCB milling tool path generating software.
You will need to follow this 3 steps:
- Create the footprint and add it to the footprint's library
- Create the symbol and add it to the symbol's library
- Make sure they are connected and they work fine
1. At the moment we skip checking the PWR_FLAG symbol as KLC says it should have a power input pin, but in official KiCad libraries it has power output pin. Use the following to skip it.
```
./check_symbol.py ../../fab.kicad_sym -p '^(?!.*PWR_FLAG).*$' -vs
```
Notice the regex.
## Create the footprint and add it to the footprint's library
Create a new project in KiCad and open the Footprint Editor:
1. Do a `git push` to the repository if you have access or use the merge request feature. If you do not know what a merge request is, read about [GitLab merge requests here](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html).
![](https://i.imgur.com/npzIxGA.png)
## 3D Models
Here you can create a new component from scratch, drawing the pads of it and the vias if necessary. You can write the name of the component and its value or refer it to the schematic. This is the icon to create a new Footprint:
![](https://i.imgur.com/jstb0v3.png)
You can also create a new Footprint using the Footprint Wizard using this icon:
![](https://i.imgur.com/Gsvlrzt.png)
There are different predefined shapes and edit the main parameters. This is an example of a SOIC package and the parameters that you can define:
![](https://i.imgur.com/mS3L9nJ.png)
Another option is to use an existing footprint from any library and edit it. When you finish your footprint, save it as a new footprint.
Finally, you can create a symbol by code. This code is an example of a footprint, in this case it is the code for a 1x05 SMD Pin Header.
```
(module fab-1X05SMD (layer F.Cu) (tedit 5E6F66F5)
(attr smd)
(fp_text reference >NAME (at -2.54 0 90) (layer F.SilkS)
(effects (font (size 1.27 1.27) (thickness 0.1016)))
)
(fp_text value Val** (at 0 0) (layer F.SilkS)
(effects (font (size 1.27 1.27) (thickness 0.15)))
)
(pad 1 smd rect (at 0 -5.08) (size 2.54 1.27) (layers F.Cu F.Paste F.Mask))
(pad 2 smd rect (at 0 -2.54) (size 2.54 1.27) (layers F.Cu F.Paste F.Mask))
(pad 3 smd rect (at 0 0) (size 2.54 1.27) (layers F.Cu F.Paste F.Mask))
(pad 4 smd rect (at 0 2.54) (size 2.54 1.27) (layers F.Cu F.Paste F.Mask))
(pad 5 smd rect (at 0 5.08) (size 2.54 1.27) (layers F.Cu F.Paste F.Mask))
)
```
The most important part here is to make sure you have the correct numbering of your pads, as this will be the link to your symbol.
When you save your component KiCad will ask you in which library you want to save the new footprint, select the fab library.
## Create the symbol and add it to the symbol's library
> Tip: Keep 150 unit distance between the pins for consistency.
After creating a footprint, it's time to create the new symbol for the schematics of the footprint. First open the symbol editor.
![](https://i.imgur.com/SM1c8HN.png)
Here we have 3 options too:
We can create a new symbol from scratch, using the KiCad symbol editor. When you create a new symbol, it will ask you to choose a library and then you can define the properties of it. Finally, you will need to draw the schematic of it and its shape.
![](https://i.imgur.com/MRbK2EW.png)
You can also edit an existing symbol. Just double click it to open it in the editor, edit it and Save it as a new symbol in the library.
Finally, you code it in the <i>fab.lib</i> file, just open the file in a code editor and add your component following the structure of the other components. This is the code of the 1x05-SMD-PinHeader, for example.
```
#
# PINHD-1x05-SMD-HEADER # PINHD-1x05-SMD-HEADER
#
DEF PINHD-1x05-SMD-HEADER M 0 40 Y Y 1 L N
F0 "M" 0 0 45 H I C CNN
F1 "PINHD-1x05-SMD-HEADER" 0 0 45 H I C CNN
F2 "fab-1X05SMD" 30 150 20 H I C CNN
$FPLIST
*1X05SMD*
$ENDFPLIST
DRAW
P 2 1 0 0 250 650 100 650 N
P 2 1 0 0 100 650 100 -075 N
P 2 1 0 0 100 -075 250 -075 N
P 2 1 0 0 250 -075 250 650 N
X 1 1 0 500 200 R 40 40 1 1 P I
X 2 2 0 400 200 R 40 40 1 1 P I
X 3 3 0 300 200 R 40 40 1 1 P I
X 4 4 0 200 200 R 40 40 1 1 P I
X 5 5 0 100 200 R 40 40 1 1 P I
ENDDRAW
ENDDEF
````
If you've created the symbol in the Symbol Editor, you will need to define the footprint. Just press the <i>Edit symbol properties</i> icon and search for the footprint you've created before in the footprint gap.
![](https://i.imgur.com/PqoqEpy.png)
Save the library and go back to KiCad, you have your symbol and footprint up and running.
## Make sure they are connected and they work fine
Before uploading the new component into this repository, please, make sure they are well connected and referenced and that the footprint works with the physical component, this library will be used by the students so we have to ensure that they work fine.
Yes, we need 3D models of all parts! How else you will get those beautiful board renderings? It would be nice to have original Fab designs, with a little logo or something fun on them. Bright colors could be interesting. Funky textures. You got the idea. Follow official [KiCad 3D Model Guidelines](https://klc.kicad.org/model/m2/m2.1/) for technical details. At the moment there is an additional folder `fab.3dsources` which is intended for FreeCAD source files. Not sure if it will remain in future versions of the library.
\ No newline at end of file
(c) Fab Academy and contributors 2020
(c) Fab Academy and contributors 2021
This work may be reproduced, modified, distributed, performed, and displayed for any purpose, but must acknowledge "Fab Academy". Copyright is retained and must be preserved. The work is provided as is; no warranty is provided, and users accept all liability.
# Fab Electronics Library for KiCad
This library (should) cover all the electronics components found in the official [fab inventory](http://fab.cba.mit.edu/about/fab/inv.html). Using this library should also make it easier to share KiCad project files between Mac, Windows and Linux systems.
[![all tests](https://gitlab.fabcloud.org/pub/libraries/electronics/kicad/badges/master/pipeline.svg?key_text=all+tests&key_width=60)](https://gitlab.fabcloud.org/pub/libraries/electronics/kicad/-/commits/master)
> **What about KiCad 8?** Yes, it is KiCad 8 compatible.
> **It does not work on KiCad 7!** Yes, sorry, it is easier to maintain the library with latest KiCad. Please install KiCad 8.
This library includes all the electronics components listed in the official [Fab Inventory](http://inventory.fabcloud.io/).
> **Warning!** the library is under active development. Naming of components can change overnight. Make sure to `git pull` the latest version before doing work.
## Installation
> Make sure you have at KiCad 6 or greater installed.
> Make sure you have at least **KiCad 8** or greater installed.
1. Clone or download this repository. You may rename the directory to `fab`.
1. Clone or download this repository. You **should** rename the directory to `fab`.
2. Store it in a safe place such as `~/kicad/libraries` or `C:/kicad/libraries`.
3. Run KiCad or open a KiCad `.pro` file.
4. Go to "Preferences / Manage Symbol Libraries" and add `fab.kicad_sym` as symbol library.
5. Go to "Preferences / Manage Footprint Libraries" and add `fab.pretty` as footprint library.
6. Go to "Preferences / Configure Paths" and add variable named **FAB** that points to the installation directory of the fab library, such as `~/kicad/libraries/fab` or `C:/kicad/libraries/fab`. This will enable the custom 3D shapes to be found. The 3D shapes project has just started and most of them have to be populated still.
4. Go to "Preferences / Configure Paths" and add new environment variable "FAB" that points to location of the fab library on your drive, e.g. `~/kicad/libraries/fab`. This is needed for the 3D models to load correctly.
5. Go to "Preferences / Manage Symbol Libraries" and add `fab.kicad_sym` as symbol library.
6. Go to "Preferences / Manage Footprint Libraries" and add `fab.pretty` as footprint library.
## Note on modules
Symbols and footprints of breakout boards (such as [DFRobot DFR0299](https://www.digikey.com/en/products/detail/dfrobot/DFR0299/6588463) or [Adafruit 3006](https://www.digikey.com/en/products/detail/adafruit-industries-llc/3006/6058477)) are not added to this library. Use plain pin-headers or pin-sockets for them in your design. Most of them have headers with 2.54mm (0.1inch) pitch and available drawings with dimensions available. As this library is made for teaching purposes, take this as an exercise.
## On-Going TODO
## ToDo
- [x] Create a test script that checks if parts from fab inventory are included
- [x] Make sure all parts from the inventory are there
- [ ] Review symbol and footprint local (Fab Academy) naming conventions
- [ ] Fix symbols and footprints according to KLC tests using [KiCad Library Utilities](https://gitlab.com/kicad/libraries/kicad-library-utils)
- [ ] Fix initial test script to work with KiCad 6 library system
- [ ] Fix footprints missing symbols and symbols missing footprints
- [ ] Review symbol and footprint local naming conventions
- [ ] Create a list of parts to test against
- [ ] Add 3D models for all parts
- [ ] Move components to group-specific symbol and footprint libraries (like KiCad)
## Contributing
Please refer to the [CONTRIBUTING](CONTRIBUTING.md) document. Run `test.py` locally before `git push`.
Please refer to the [CONTRIBUTING](CONTRIBUTING.md) document.
## License
......
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.