Skip to content. | Skip to navigation

Personal tools

Step by step Simple Part Design Tutorial (1)

In this step by step tutorial, we are going to demonstrate how to make a simple part. For this we will be making a general purpose diode. This part is currently (version 0005 alpha) not in our core library yet, so it serves a double purpose: it is explaining you how to add a part, and I'm making another part we can add to the core library later :). Instead of going to write the XML part description from scratch we are going to take and modify an existing XML part description, and show you how easy it is to create a new part from there.

Making a diode

Chapter 1: The XML descriptor

The diode has a lot in common with the resistor part; it's a basic part, has a similar size and shape, and has two terminals on each end. The diode also has some similarities to the LED part most important is that the polarity matters in the terminals and should be named accordingly.

Lets start by opening up the resistor's XML file, and start from the top.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<part generic= "false">
<version>1.0</version>

Just leave the first line the way it is.

The second line we'll just change to

<part>

because this generic="false" is only to describe the advanced features of certain parts that have unique attributes. Any part that fits this description will be included in the Fritzing core library, so its not something you need to worry about.

let's move on...
From now on, we are only going to talk about the sections in the XML part descriptor that we will change.

    <species>Resistor</species>
<genus>Basic.Resistor</genus>
<title>Resistor</title>
<description>A general-purpose Resistor</description>

In this section of the XML we need to change everything to reflect the part we are making.

    <species>Diode</species>
<genus>Basic.Diode</genus>
<title>Diode</title>
<description>A general-purpose Diode</description>

You can see all the changes we've made in Yellow. It is important to leave the Basic. in the dot notation For the a more comprehensive overview of what these tags mean, please see the Overview.

The next change we'll make is to change the label from:

    <label>R</label>

to

    <label>D</label>

The label is going to show up in Fritzing when you name your part, and also in your Eagle schematic to easily identify where to solder your parts.

The last thing we are going to change before we move on to making our image files and entering our image file parameters into the XML document is the connector id, name, and type. This is how it looks in the Resistor XML that we are modifying:

        <connector id="1" name="1" type="leg">

But, since polarity is important for a Diode, let's take a look at a two connector part XML descriptor for where polarity is also important like the LED.

        <connector id="+" name="+" type="leg">

The LED, like the Diode, has a plus (+) connector and a minus (-) connector, both in the type leg. We can just take this line verbatim and paste it over in our Diode XML. We will do the same thing for the second connector.

        <connector id="-" name="-" type="leg">

That's all we're going to do with the XML file for now, so
Let's move on to chapter two: The Images

Document Actions
© 2007- 2008 University of Applied Sciences Potsdam \ Powered by Plone