KiCAD Howto – Library and the text editor

I was asked by one of my blog followers about using KiCAD libraries and how to make a library and add parts to it.  So I’ve written this blog entry to help all KiCAD users.

One of the very cool things about KiCAD is all the libraries are just text files, so a good editor is all you’ll need.

On a Linux install of KiCAD the default libraries are tricky for a regular user to edit as they are all owned by root, so they are really read only (unless you want to do all that sudo stuff!).

What I have done on my system is create my own library and saved it on a shared directory on my server so any machine that I login from can see the same library.

Start your text editor and create a new library that has no parts in it, it’s just a “shell” like this:

EESchema-LIBRARY Version 2.3  Date: Wed 07 Nov 2012 01:16:37 PM GMT
#encoding utf-8
#
#End Library

Save this somewhere and call it something like “MyKiCADLib.lib”

Now when you start a new schematic go to “Preferences -> Library”

KiCAD: Select Library from the Preferences Menu

KiCAD: Select Library from the Preferences Menu

In the Library window:

KiCAD: Add a new library

KiCAD: Add a new library

Click on the “Add” button on the right top (near the “Component library files”) and find and select the MyKiCADLib.lib.  The press the “OK” button on the Library preferences window to finish.

Now when you add a component select the “Select by Browser” and you can search for it in your new library… It the moment this library has no parts in it, but it should show up in the left most panel.

KiCAD: New Library is empty...

KiCAD: New Library is empty…

So now it is time to add a part to the new library.  You have two options, you can go ahead and use KiCAD library editor.  This is nice, and I’ve used it a few times when I can’t find a part on the net.  But like most things on-line, someone has probably done the work already!

I’ve found that the part I’m interested in is somewhere in a existing library that may have a few hundred parts in it and I’m only looking for the one part.  So rather than adding yet another library to KiCAD I extract the part from the library and add it to my library.  As the libraries are all text this is easy to do.

For example the DS18B20 is defined like this:

#
# DS1820
#
DEF DS1820 IC 0 40 Y Y 1 F N
F0 "IC" -100 400 60 H V C CNN
F1 "DS1820" 0 300 60 H V C CNN
F2 "~" 0 0 60 H V C CNN
F3 "~" 0 0 60 H V C CNN
ALIAS DS18B20
DRAW
S 150 -100 -150 250 0 1 0 N
X GND 1 100 -400 300 U 50 50 1 1 W
X DQ 2 0 -400 300 U 50 50 1 1 W
X Vdd 3 -100 -400 300 U 50 50 1 1 W
ENDDRAW
ENDDEF

Parts always start with a DEF and end with an ENDDEF. Look out for these if you are taking a part from an existing library.

Paste the text into you new shell library:

EESchema-LIBRARY Version 2.3  Date: Wed 07 Nov 2012 01:16:37 PM GMT
#encoding utf-8
<insert component text here>
#
#End Library

Save your modified library and exit out of the schematic editor and restart it (required to pick up changes to libraries!).

Now when you add a component you should see your library has two parts in it: “DS1820″ and “DS18B20″.  Go ahead and add this to your schematic.

KiCAD: Part added to library

KiCAD: Part added to library

It as easy as that.. Hope you found this a help!

The EthNode – ATMega based Ethernet board

Taking inspiration from the good folks at Nanode and an Instructable I saw recently, I’ve come up with “another” AVR based Ethernet board that can be programmed and used like an Arduino.

It’s a simple design based on the ATMega and Microchip’s ENC28J60 Ethernet controller with SPI.  Running MQTT on one of these will open up a few options for home automation and remote sensor monitoring.

It’s not as complex as the Nanode.  It doesn’t have the Arduino header locations, but all the major pins are available at headers. There is a 25L512 chip providing 512 Kbit Serial EEPROM for MAC addresses and logged data if one needs it. The PCB is only 80x50mm in size!

Here is the schematic:

EthNode Schematic

EthNode Schematic

Here is the PCB layout:

EthNode PCB Layout

EthNode PCB Layout

All the resources (KiCAD files, libraries, etc) can be downloaded here:Ethnode-V0.9.tar

This morning I got a delivery from Farnell with all the parts.. Busy weekend ahead!

KiCAD version of JeeLabs JeeNode v6

I’ve been following Jean-Claude Wippler’s blog over at jeelabs.org, he has done some lovely work on a little board called the JeeNode.

The JeeNode is a wireless micro-controller board designed for a variety of Physical Computing tasks. From measuring and reporting temperature, humidity, and other environmental data to tracking and controlling energy consumption around the house. It was inspired by the Arduino Duemilanove and Uno boards, and by the “Real Bare Bones Board” (RBBB) from Modern Device.

The JeeNode V6 artwork on JeeLabs is done with Eagle. I’d like to make one and decided to rework the artwork in KiCad.

The schematic:

KiCAD versoin of JeeNodeV6 - Schematic

KiCAD versoin of JeeNodeV6 – Schematic

The artwork:

KiCAD versoin of JeeNodeV6 - PCB

KiCAD versoin of JeeNodeV6 – PCB

There possible I’ve used the same part references as the original. You can download the full artwork: KiCAD-JeeNodeV6.tar

So time to make this PCB. It will be tricky, lots of through holes and vias, but I’m up for a challenge!

 

Carambola i2c IO board – PCB

Late last week the parts arrived from my Carambola i2c IO board and I was busy over the weekend making and assembling the PCB.  Here are the results!

I used KiCad to create the artwork and my ink-jet printer to print it out onto OHP film.  Got better results with my ink-jet than my laser printer, the ink is a lot darker than toner.  As this is a double sided PCB I spent a good while getting the alignment correct, which was tricky!

For a UV source, I got an external 24W CLF bulkhead light which at a five minute exposure time worked the business. The back of the PCB worked out fine apart from the dodgy cheep FR4 board I got from Radionics.  The photo resist film on the copper was really crappy as you can see in the photo below (look in the centre of the PCB, the artwork was black but you can see the Cu has been etched in patches).

Carambola i2c IO Board PCB back side

Carambola i2c IO Board PCB back side

The top side was a little better apart from the PCB area at the top right of the board where there was a big blotch of resist.. Also the alignment of the top and bottom artwork was a little out on the right despite my best efforts.

Carambola i2c IO Board PCB front side

Carambola i2c IO Board PCB front side

Here is a close up of the track detail where they are at their closest, nice crisp tracks.

Carambola i2c IO Board PCB track detail

Carambola i2c IO Board PCB track detail

The switcher PSU with the 3.3V regulator:

Carambola i2c IO Board PSU

Carambola i2c IO Board PSU

And finally the assembled PCB..

Carambola i2c IO Board working

Carambola i2c IO Board working

The good news: it works!

Well I haven’t tried the Ethernet UTP connection yet, but the WiFi, PSU, input stage and relays work fine.