Creating A PCB In Everything: Creating A Custom Part In Fritzing

This is the continuation of a series of posts where I create a schematic and PCB in various EDA tools. Already, we’ve looked at Eagle CAD, KiCad, and took a walk down memory lane with one of the first PCB design tools for the IBM PC with Protel Autotrax. One of the more controversial of these tutorials was my post on Fritzing. Fritzing is a terrible tool that you should not use, but before I get to that, I need to back up and explain what this series of posts is all about.

The introduction to this series of posts laid it out pretty bare. For each post in this series, I will take a reference schematic for a small, USB-enabled ATtiny85 development board. I recreate the schematic, recreate the board, and build a new symbol and footprint in each piece of software. That last part — making a new symbol and footprint — is a point of contention for Fritzing users. You cannot create a completely new part in Fritzing. That’s a quote straight from the devs. For a PCB design tool, it’s a baffling decision, and I don’t know if I can call Fritzing a PCB design tool now.

Contextualizing this Whole Mess

If you’re like the majority of desktop or laptop users, the easiest tool to make pixel art is Microsoft Paint. With MS Paint, you can edit individual pixels, select colors, and even do flood fills. It’s exactly what you need if you want to create pixel art quickly with a tool that’s easy to use. There are better tools to create pixel art, though. Photoshop lets you zoom in to see individual pixels and has transparency and layers, and Aseprite is a professional tool specifically designed for the creation and animation of pixel art.

It’s easy to draw parallels between KiCad, Fritzing, MS Paint, Photoshop, and Aseprite. Fritzing and MS Paint are easy-to-learn tools where you can produce acceptable results quickly. This is a false equivalency, though; you can do anything you want in MS Paint, but you can’t do anything you want in Fritzing because you can’t add custom parts. Fritzing is a tool just like MS Paint if MS Paint didn’t have the color blue.

Creating a custom part is necessary functionality of a PCB design tool. The first PCB design tool released for the PC had this functionality. Without the ability to create custom parts, Fritzing cannot legitimately call itself a PCB design tool and should not be used as such.

Of Course You Can Make Custom Parts (It’s Just Tedious)

The Fritzing FAQ is wrong. Of course you can make custom parts in Fritzing. This summer, Adafruit created a whole bunch of Fritzing parts that still haven’t been added to the core libraries. Instead of complaining about the relatively small core library, or the difficulty in adding custom parts, I’m going to do something better: for the next two thousand words, I’m going to demonstrate how to create a custom part in Fritzing.

It should be noted that since the introduction of the new Fritzing Parts Editor introduced in version 0.7.9 (the version that took away the ability to create custom parts), there have been no tutorials on how to create a custom part in Fritzing. This is the first such tutorial and by definition the best tutorial on creating custom parts in Fritzing. I encourage the Fritzing team to post a link to this tutorial on their blog and FAQ.

With the justification of why you should never use Fritzing and why this tutorial is necessary, let’s begin. This is how you create a custom part in Fritzing.

The Easy, Dumb Way

proof

The picture above is of an ATtiny2313, a part not in the Fritzing core library. I created this part in just a few minutes using tools built right into Fritzing. Yes, you can make your own parts in Fritzing. Here’s how I did it.

edit-a-partFrom Fritzing’s ‘Core Parts’ selector, take the generic IC part and drop it onto the breadboard view. In the Inspector window, you will find options for what type of package this part is, how many pins, it’s label, and even the pin spacing. If you want to drop a 40-pin CERDIP 6502 into your Fritzing project, you can do that. If you want to drop a 64-pin Motorola 68000 into your Fritzing project you can do that. If, for some reason, you want to add an IC that isn’t in the core Fritzing library, you can do that too. All of this is done semi-automagically by Fritzing. All you need to do is tell Fritzing the number of pins, and what package it comes in.

newpartsed

What’s the bottom line? If you’re dealing with a DIP chip, a QFN, SOIC, or some other standard package, you can probably make a Fritzing part in about three minutes. Is this making a part from scratch? No, but for most use cases, this is all you need.


Actually Creating A Part From Scratch

The challenge for this tutorial was to create a part from scratch. To that end, I’m going to build a purple and gold 64-pin DIP Motorola 68000. Why not, right?

The relevant documentation from the 68000 datasheet.
The relevant documentation from the 68000 datasheet.

Step 1: Creating A Breadboard Footprint

Download Inkscape. It’s like Illustrator, only it doesn’t send your soul back to the Adobe mothership. Select File -> Document Properties, and set the size of the canvas to 3.2 x .98 inches. While you’re in that window, set the default measurement unit to ‘inches’.

The width of the canvas is the nominal width of the package, and the height will be the nominal height of the package plus space for the pins. The pins will be squares with a dimension of 0.04 x 0.04 inches, so add 0.08 inches to the top and bottom of the canvas.

With the dimensions of the canvas set, draw a rectangle. If you’re feeling exceptionally artistic, make the rectangle purple and add some gold accents. Now it’s time to add pins. This is a 64-pin device, so add sixty-four rectangles. Use Inkscape to arrange and distribute them logically. In Inkscape’s ‘Object Properties’ window (Shift+Ctrl+O), set the ID of each rectangle to ‘connector0pin’ to ‘connector63pin’. Yes, Fritzing uses zero-indexed numbers to label all the pins on the breadboard view.

connector3pin

Once all the pins are labeled, select all, group everything and name this group ‘breadboard’ in the Object Properties window. Save this file to your desktop as a plain SVG (not an Inkscape SVG). That’s it for the Inkscape portion of building the breadboard part. Now we take it over to Fritzing.

In Fritzing, create a new part just like you did in the ‘Easy, Dumb Way’ above. In the Parts Editor, select File -> Load Image For View, and select the SVG you just saved from Inkscape. You’ll get something that looks like this:

newpartseditor68k

Yes, the font changed, but whatever. This is the closest anyone has ever gotten to building a custom part in Fritzing. On the right side of the screen, there’s a list of connectors, with a button labeled ‘select graphic’ next to each pin. For each pin on our 64-pin monster, click the ‘select graphic’ button, and then click the gray rectangle of the corresponding pin. This shouldn’t be necessary if you labeled your parts correctly in Fritzing, but it’s another option for you.

Save the part, open up a new Fritzing window, and here’s what you get:

fritzing68k

To reiterate, this is a custom part, with a custom breadboard view. There are no other tutorials that tell you how to do this. You’re welcome.

Step 2: Creating The Schematic Footprint

The breadboard view is only one-third of what’s required to make a part in Fritzing. Now we’re going to move on to the schematic view. This is a simplified view of the part that shows the functions of all the pins.

schematicviewFirst, create a new Inkscape document with a width of 1.5 inches and a height of 3.3 inches. If you’re making a DIP schematic, the formula to calculate the height of a part is ([number of pins on one side] + 1) * 0.1. For a 64-pin chip with 32 pins on a side, it’s 33*0.1 = 3.3.

The body of the schematic footprint is a rectangle, no fill, black outline, with a 1px stroke width. The pins are a straight line, 0.25 inches long, arranged along the side of the black rectangle on 0.1″ centers.

Right now we have a simplified version of what the schematic footprint should look like. Yes, we’re missing labels for all the pins, but something even more important is missing: the IC terminals, or where the lines on the schematic connect to. Fritzing thinks these should be rectangles 0.2 pixels square (yes, point two pixels), so we need to add these to the end of every pin on this footprint.

Create a 0.2 by 0.2 pixel rectangle on the tip of every leg of the schematic, and label them in the Object Properties dialog as ‘connector0terminal’ through ‘connector63terminal’. Once that’s done, label the pins in the Object Properties dialog as ‘connector0pin’ through ‘connector63pin’. Yes, that’s one hundred and twenty-eight things you need to rename. It’ll take a while. When that’s done, save it as an SVG, go to the parts editor in fritzing, and select File -> Load Image For View and choose the file you just created in Inkscape. Here’s what you’ll get:

schematicviewfritz

I’ve added a few things to this schematic view, most obvious is the pin labels. Other than that, it’s pretty standard, and now we’re almost done creating a part from scratch in Fritzing.

Step 3: Creating The PCB Footprint

You know the drill by now. Create a new Inkscape document. The dimensions of the canvas are (width of the package + 0.02 inches) by (height of the package + 0.02 inches). For the 68000, that’s 3.22 inches by 0.92 inches. Your pads are just circles, with no fill, and some sort of yellow stroke. Arranging these pads is left as an exercise to the reader.

Fritzing requires you to name these pads, so name them ‘connector0pin’ through ‘connector63pin’. Group all of these pads and call that group ‘copper0’, then group them again and call that group ‘copper1’. This is, ostensibly, for the top and bottom copper layers.

inkscapepads

Save this as a regular SVG, open up Fritzing, go to the Part Editor, and replace the PCB footprint with the SVG you just saved.

fritzingpcbfinished

With that, we’re done. That’s how you create a part mostly from scratch in Fritzing. Hit save, close Fritzing, and throw your computer in the garbage. It’s tainted now.

What this all means

The Fritzing breadboard layout of the Lilipad Mini.
The Fritzing breadboard layout of the Lilypad Arduino. Yes, this is a Fritzing part, made from scratch.

Admittedly, I didn’t make this easy on myself by creating a 64-pin DIP from scratch in Fritzing. Making a part in Fritzing is a tedious process and should not be done by anyone. It’s possible, though, and if you have enough time on your hands, you can create beautiful vector graphics that are also real, working parts in Fritzing.

Supporters of Fritzing say its greatest strength is that it’s an easy tool to use, and useful if you want to whip up a quick PCB for prototyping. They are correct, so long as all the parts you want to use are already in Fritzing’s core libraries. It is possible to create parts from scratch, but this is a task that could be done faster in literally any other PCB design program. What we’re looking at here is a walled garden problem, and for the second most popular Open Source PCB design software, this isn’t doing Fritzing any favors.

It should be noted, however, that many of the tasks required to make a Fritzing part can be automated. PCB and schematic footprints can be auto-generated. In theory, a simple command line tool could tie these parts directly to breadboard footprints. If anyone wants to contribute to Open Source in a meaningful way, there’s a project for you: make a tool that takes an SVG of a chip or component and turns it into a Fritzing part.

Closing out this tutorial, I’d like to thank [Arsenijs] who created the first tutorial on making a Fritzing part over on Hackaday.io. [Arsenijs] did this because I put up a bounty for the first guide to making a part in Fritzing from scratch. Not only do I contribute to Open Source (which means I’m better than you), I contribute to Open Source documentation. I am a unicorn that lays golden eggs.

That’s it for Fritzing. I’m not touching it again. For the next post in this Creating a PCB in Everything series, I’m going to take a look at the cloud-based PCB design tool, Upverter. Will it be better than Fritzing? Who knows. Maybe. Probably.

23 thoughts on “Creating A PCB In Everything: Creating A Custom Part In Fritzing

  1. “Fritzing thinks these should be rectangles 0.2 pixels square (yes, point two pixels), so we need to add these to the end of every pin on this footprint.”
    Also, making those is just too fucking hard. If anyone has a better way (maybe Inkscape has a scripting engine?), I’d want to hear that. My guess is – autogenerate a 64-pin IC and take the autogenerated schematic view.

    “Hit save, close Fritzing, and throw your computer in the garbage. It’s tainted now.”
    Damn, 100$ doesn’t cover a new laptop =(

    Also, you didn’t even cover linking those 3 together (not that I did it well). That’s the hardest part to figure out on your own the XML of a .fzp is easy to understand but the .fzp addition rules are weird, the available docs are misleading and one should really autogenerate a part (and, thus, a .fzp) and then substitute his own SVGs into it.

    1. Making a 0.2×0.2 pixel square is very easy — just draw a rectangle, and then enter the dimensions you want in the menu at the top of the screen. Then select it, press ctrl+d (for “duplicate”) as many times as you need, select the whole group with the rectangle selection, and select Object->Align and Distribute. Enter the spacing you want for them, and you are done. Duplicate the whole group for the other side.

  2. Yeah, a long time ago (2014-ish) I created a breadboard version of my project in Fritzing. It wouldn’t even let me create a 600mil 40-pin DIP chip if I recall correctly, I think. Looks like nothing much has changed and I’m still going to stay away from it, as you advised.

    ===Jac

  3. Fritzing is to ECAD what Notepad is to word processing. Many people use it, because it’s easy to start with, and it’s OK for a quick scribble, but once you do a little bit more, you quickly realize that you should’ve started with something better in the first place. But while you can just copy your text out of notepad and paste it into an actual word processor, you can’t do that with Fritzing. So it’s even worse.

    And I don’t know why so many people put the breadboard depiction of their circuit online, but not the actual schematic.
    Do they really think that this is any easier to read?

    1. Fritzing is easier to read for people who don’t understand schematics but have a task to breadboard a circuit (think education, like workshops). Not attaching a schematic when posting a project online is rarely a good idea, of course.

    2. I’ve never understood that either, Cyk. People don’t seem to understand that schematics are the standard way to share how electronics components are connected together. Unfortunately, they’re not always being encouraged to move in that direction by some others who claim to be teaching about electronics.

      Fritzing diagrams are useful if you’re going to build something, but not necessarily as much if you just want to understand the circuit. And likely even less useful if you want to communicate with a working technician or engineer.

  4. Thank you for this! I just want to note, that you can just let Inkscape name all the things, and then just select them in Fritzing using the “Select graphic” button. Should be must faster. Also, Inkscape has a lot of tools for aligning and spreading a lot of objects — they make the work much faster.

  5. Yes, the font changed, but whatever.

    After creating the text, convert it to an object by selecting Path → Object to Path. That will create polygons of the text, you won’t be able to edit it as text anymore but it should mean that the shape of the letters are preserved.

  6. “Not only do I contribute to Open Source (which means I’m better than you), I contribute to Open Source documentation. I am a unicorn that lays golden eggs.”

  7. That was one reason I never used it (I prefer Eagle) but I am saving this tutorial to my harddrive. You never know when this information might come in handy! Thank you :)

  8. Upverter is much better than Fritzing. It has a huge parts library, and if you can’t find a part, its pretty easy to make your own because there is a custom parts generator featuring common packages. If it has an unusual package, you can easily design your own part and place pins. PCB design is pretty easy too, but it doesn’t have an autorouter if that’s what you are used to using. I usually work with Eagle, but I have been designing a device with Upverter for the past few months as I needed to be able to work on it from many different systems without installing software. One of the only things I would like them to improve is the ruler, as it cannot lock onto parts, so its basically impossible to get precise spacing unless you do math with the parts’ coordinates. Overall I would say maybe 8/10 – 9/10.

  9. i use fritzing for all my PCB’s. but in only use PCB view. so all parts i made for myself are just for this view, works great, just converting all sizes from a datasheet into the SVG takes a while.

  10. The more people lament about Fritzing and do that with just personal preferences, the more I find it interesting. Apparently it’s difficult to understand that Fritzing simply isn’t made for those engineers working on the next generation PC motherboard.

    It’s made for children, artists, people barely knowing what “voltage” means. These want to get their Christmas tree custom-blinking, too. Having a tool converting a schematic into a breadboard layout automatically is a _great_ tool for those.

    Regarding the review: why all this whining? Accepting SVGs is a great idea, good looking schematics FTW! Can’t see anything overcomplicated in this process. Well, except perhaps choosing one of the most complex DIP chips available while a smaller one had worked for a tutorial just as fine.

  11. Notwithstanding your negative comments, you seem to have demonstrated that it is in fact fairly straightforward – if a bit time-consuming – to create a custom part in Fritzing, so thanks for that! :D

    One thing nobody seems to have mentioned here or in the comments on the previous article (unless I missed it) was that you can use Fritzing’s breadboard view to design stripboard layouts. That’s how most of my circuits are built, at least the first version, and no other usable free package has this capability as far as I know.

    Yes, there are bugs, and no, development and support are not what they ideally should be. One could even say it’s a bit hacky. ;-)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s