This is a description of how I made the Valor PM6078-004 5 Volt to 9 Volt DC-DC converter available in parts submit:
Following these steps should result in an identical part to the one posted (if not please post, as that would mean these instructions are unclear / wrong!). Initial knowledge assumptions basically none, when I started this several months ago I'd been a Fritzing user for about a week and had heard of but never used xml and had never even heard of an svg file. So you will have to work at it to be more ignorant than me. This is not anywhere near all my own work, both steelgoose and Old_Grey as well as other members of the forum have been a tremendous help. The entire community owes steelgoose a big thank you for spending several hours figuring out why bendable legs implemented with Inkscape (which he doesn't use!) didn't work. He correctly assumed I had no hope of figuring it out, and he managed to find a set of settings for Inkscape that work better than the official recommendation of "save the file as plain svg".
1) Install Fritzing on your machine (I used version 0.9.3 which is the latest at this time).
Install Inkscape on your machine (I used version 0.91 which is the latest at this time).
Note: I'm running on Windows 7 pro so this will be somewhat Windows centric although I expect most things will be the same on Linux or the Mac.
2) Download the Fritzing fonts from:
http://fritzing.org/learning/tutorials/creating-custom-parts/download-fonts-and-templates/
unzip the fonts from the zip file and install them by double clicking on them or executing them.
3) Assuming you are unfamiliar with Inkscape, go through the Inkscape tutorial to get at least somewhat familiar with running Inkscape. Its complex and bites without warning, and is vindctive and remembers settings you don't know how you set (and thus can't clear). I've had to uninstall and reinstall it (remembering to delete the Inkscape directory in AppData\Roaming\Inkscape which the uninstall does not delete as well!) to clear some errors I have made.
4) Do some intial configuration on Inkscape for use with Fritzing.
Inkscape has some default settings I don't like, so I changed them. To do the same:
right click on the Inkscape desktop icon and click "run as administrator" (needed to write to program files on Windows). The default Inkscape window comes up full screen (Which I don't like!) so
edit->preferences->Interface->windows from maximize to large
edit->preferences->Interface->Grids
(px are 90 dpi (dots per inch) set by the svg standard and in is inches for sensible people)
Grid units px to in
Spacing x: .01
Spacing y: .01
Major grid line every 10 (so at .1 inch)
At low magnifications the grid will be .1 inch at higher magnifications it will switch to .01 inch to allow you to check alignment more closely. Change to suit your tastes.
Then exit preferences as we are finished here.
view->page grid
this will enable grid lines, which by default are not displayed (which I find annoying).
edit->xml editor
this starts xml editer in a right hand window which I always want present.
Now we want to save this as the default settings to directory
c:\Program Files\Inkscape\share\templates
file->save as->(drawing) default.svg
Change the save as type (just below the file name) from Inkscape SVG to Optimized SVG
then click Save. Instead of saveing, a new text box will come up. We want to make some modifications to this for Fritzing!
untick Shorten color values (Fritzing will break if the colors are shortened)
tick Convert CSS attributes to XML attributes (this is the important one for Fritzing!)
untick group collapsing (doesn't seem to matter)
untick create group for similar attributes (doesn't seem to matter)
tick Embed Rasters
tick Keep editor data (keeps this data!)
tick remove metadata (removes stuff Fritzing doesn't use and reduces clutter in the svg files.)
untick remove comments
tick work around render bugs
untick enable viewboxing
untick remove xml declarations
Number of signifigant digits fro coords 5
XML indentation (pretty printing): space
then hit ok and replace to the message that default.svg already exists.
If you now close Inkscape answer "close without saving" to the box that comes up (we don't want to save it as an Inkscape svg file!) and restart Inkscape (without run as administrator) you should get a default screen with grid lines that doesn't take up the whole screen. Unfortunatly this won't over ride pre existing files such as Fritzing svgs, but at least the default action is what I want and we can (and will) fix Fritzing svgs to match.
4) Start Fritzing (and part creation!).
Select generic IC from core and drag it to the breadboard.
in Inspector set
chip label PM6078-004
pin spacing 600 mil
pins 24
Part # PM6078-004
edit pin labels
pin 1 +5V pin 24 GND
pin 12 +9V pin 13 9V GND
then click save
right click the part and Edit (new parts editor)
tab icon
file-> reuse breadboard image
Meta data
(the metadata will be turned in to html which is why the description text is being entered as one long line)
Title: (DIP - 24 pins) VALOR PM6078-04 DC-DC Converter
Author (Fritzing Part-o-matic) Peter Van Epp
Description (replacing "A DIP stand-in part for whatever IC you want. With 24 pins on a
600mil dual inline package (DIP) footprint."):
Valor PM6078-004 5 Volt to 9 Volt Regulated DC-DC converter
Since the data sheet is no longer available:
pin 1 +5V in
pin 24 +5V ground
pin 12 +9V regulated
pin 13 +9V ground (as noted isolated from +5V ground).
It needs some load to regulate with no load it is about 16V out) at up to 30ma of output current and with 2500V of isolation from the 5V input. Fits in a 24 pin 600 mil DIP IC socket although only 4 pins are actually used on the socket. Obsolete, but available surplus cheap while they last ($.30US at present) from:
http://www.bgmicro.com/pm6078-004.aspx
Useful when you need to isolate grounds between two systems via optocouplers (this will power the optocoupler that connects to the remote system from your local power source) and for powering the cheap digital volt and ammeters available on Ebay so you can use them the same as a multimeter at any point in a circuit. Without the converter meter measurement ground is also system ground which can be a problem.
(end of description)
label (IC) U
family (Generic IC) DC-DC Converter
Properties:
leave as is
Tags
DIP
(Fritzing core) fritzing user
DC-DC Converter
contrib
ground isolation
isolated power
Valor
PM6078-004
5V to 9V
file->save as new part-> filename prefix-> Valor_pm6078_004_dip24_600mil
exit parts editor
from arduino parts bin
right click on Arduino Pro Mini V13
edit part (new parts editor)
file->save as new part prefix mini
exit parts editor
exit Fritzing don't save sketch, do save parts changes
Note: the mini part is where we are going to get our pcb footprint later, as this copy has text in it and I wanted text on the silkscreen for this part. Inkscape and Fritzing have a disagreement about text: Inkscape uses the trans function for text which Fritzing doesn't support, but if you duplicate pre existing formatted by Fritzing text Inkscape will leave it alone and not convert it to trans (and thus not break Fritzing). If someone knows how to convince Inkscape to not use trans for text I'd love to hear about it!
(two notes here: I used hard links to change the location of the user Fritzing files off of the system disk so my path is a little odd, and by default the files on Windows are in a hidden directory so to see them you have to set explorer->Organize->Folder and search options->view->Show hidden files,folders, and drives. If you don't use the hard links the temp files are in C:\Users\Owner\Appdata\Roaming\Fritzing\ (where Owner is replaced by your Windows user name) and the data files are in
should now have files somewhat like:
C:\Users\Owner\My Documents\Fritzing\parts\svg\user
F:\Fritzing\My Documents\Fritzing\parts\svg\user\breadboard\mini_943e2d5d4e84c7f02ea243384ea9b112_1_breadboard.svg
F:\Fritzing\My Documents\Fritzing\parts\svg\user\breadboard\Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_breadboard.svg
ready for editing.
now change to directory
F:\Fritzing\My Documents\Fritzing\parts\svg\user\pcb
here we are going to replace file (note your file names will be different than these although they should start with the same text i.e. "Valor_pm6078_004_dip24_600mil_" Fritzing creates the long string of numbers in some unique way.)
Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_pcb.svg
with
mini_943e2d5d4e84c7f02ea243384ea9b112_1_pcb.svg
so copy mini_943e2d5d4e84c7f02ea243384ea9b112_1_pcb.svg to Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_1_pcb.svg
We don't want to delete the mini files at this time, because we later will want to remove it from the mine parts bin in Fritzing (who will be unhappy if the files aren't there!)
This replaces the default 24 pin pcb footprint with no text on it that we can duplicate in Inkscape with the one from the Arduino mini which does have text on the silkscreen that we can duplicate (it also unfortunatly has more pins that we need to delete and odd pin numbers that we will need to change, but the text is worth it!).
So start Inkscape and open the breadboard file
file->open->Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_breadboard.svg
You should have the image of a 24 pin DIP chip with PM6078-004 on the top of it.
click view->page grid to get the grid (although we set this in the default file, it is overridden by the Fritzing file, but we will correct that!). It is probably worth verifying that your grid is set as you expect so:
file->document properties->grids should have
grid units in
origin X: 0.0
origin y: 0.0
Spacing X: 0.01
Spacing y: 0.01
as we set in the default file above. If so close document properties for now.
Inkscape tip:
when (not if, but when ) you move the entire image instead of the item you meant to, undo it with cntrl-Z and reselect the item til you manage to move it. It may or may not help to be over the white of the letters when you try and move the text, I haven't found any method but many attempts and cntrl-Zs to do this. I'd love to hear of one from someone more experienced!
Most things in the svg files are in groups and by default a mouse left click on an object will select the entire group. Since we want to change things within the group we need to be able to select individual items within a group. cntl-left mouse click will (usually) do that. It actually always does it as long as you are on the correct place in the drawing but I find I often am in the wrong spot and get something I don't want.
A note before we start the actual part creation: it may be a good idea to load the final Valor part in to Fritzing and then in another Inkscape window, open the final svg file for the view you are working in. That way you can see (at least hopefully) what the instructions do which may make this easier.
The file likely came up as fairly small so pull the edge of the Inkscape window to make it a reasonable size (such that the entire IC fits in the window without zooming for instance). It also likely came up without the grid showing so View->Page grid to enable the grid (when we save the file it will keep these settings so we only need to do this the first time!).
You will see that the pins on the IC do not align to the .1 grid lines. We are first going to correct that so the pins line up on the grid correctly.
Start by making sure you are in select by clicking on the arrow at the top of the left side tool bar. Then move the mouse to the body of the IC and left click. A box with arrows at the corner should appear indicating that the entire IC group is selected. You now want to move the entire IC up and to the right til the center of the pins align with the .1 grid lines (the ends of the pins will stick out about .012 above the grid lines on the top and bottom. Zoom in with the zoom tool (2 icons below select in the left side tool bar, left mouse click to zoom in, shift left mouse click to zoom out). While you can click on the IC and drag it in to its new position with the mouse, I find it easier to use the x and y coordinate sliders on the second top tool bar. (you have x y w and h available there). if you click on the up and down arrows on those tools the image will move in the appropriate direction a little bit for each click). Once you have positioned the IC to align properly on the grid there will be a box (the viewbox) which used to contain the image that no longer does so. We want to adjust that box so it once again contains the entire IC. However when we do that we don't want it to again move the IC to 0 0 (which it will by default do) as that will cause the grid to be misaligned again. To prevent that we are going to create a rectangle at the 0 0 grid line to hold the origin position of the view box correctly. So select the rectangle tool (6th icon down on the left side tool bar) and create a rectangle starting at 0 0 (the bottom left corner of the screen). Size doesn't matter but zoom in and make sure it is aligned to the major grid lines at 0 0 (or move it with the second from top tool bar x and y sliders til it is at 0 0). Once that is done we are going to reset the view box. So once you have created the rectangle and positioned it move back to select and then check your alignment. To do that, zoom in on IC pin 1 then in the xml editor (right hand pane or if its not there edit->xml editor which will open it) scroll down til you find a line called
that should create a dotted line box around pin 1. The horizontal and vertical arrows of that box should align with the major grid lines if you have positioned the IC correctly. If they don't then click on the IC body and move it until the arrows align (note you don't want to move only the pin, and cntrl-z to undo it if you do!).
edit->select all (about the middle of the pull down menu)
file->document properties->Page->Resize page to content which will expand to show a button marked Resize page to drawing or selection. Click on that button to resize the view box. Once this is done the view box should once again contain the entire IC and the rectangle that we put at 0 0. Since we no longer need the rectangle (and don't want it in the final image) click on it to select it (it isn't in a group, so a click will select it) then press the del key to delete it.
Now to begin editing the breadboard view.
cntrl-left click to select label PM6078-004
select it and move it to top center
duplicate it (right click->duplicate in the menu)
Inkscape tip: Nothing will appear to happen because Inkscape has created the duplicate right on top of the original. If you select it with cntrl-left click and move it you will find you actually have two copies of the item the bottom one of which will stay in the original place.and move the dup (which is on top of the original) up 1 line now move the orginal (which we need to stay as PM6078-004 as Fritzing will override whatever we change it to with PM6078-004 ignoring the value in the svg file) to be the second line. do that twice more til you have 4 copies of PM6078-004 with the duplicate being the top, 3rd and 4th lines with the original label as line 2. select the the top one (cntrl-left click), then select text tool on the right tool bar or while unselected double click the image to get in to text mode. Use the right arrow key to move to the right end (the 4) of the text and the backspace key to erase all the characters in PM6078-004. Replace them with the text VALOR. Now go back to select mode (the upward pointing arrow on the top of the left side tool bar in Inkscape) to get out of text mode. Leaving VALOR selected again (if not select it) now drag it til it is centered on the chip outline. Select PM6078-004 on the third line and change to text tool (either by a double click or the menu bar) and change PM6078-004 to 5VTO9V then cursor over and put a space between 5V and T and O and 9 (Inkscape apparently won't insert a blank without a following character). Now one at a time select and move each line of text til they are evenly spaced in the center of the chip (if you need an example, load the finished part in Fritzing and look at the breadboard view).
Now we are going to change to the xml editor which is in the only or bottom right window in Inkscape (edit->xml editor or Shift+Cntrl+X on the keyboard if it is not in the pane). In the left side of that window an entry like should be highlighted. That is the xml that is generating the invisible circle we have selected in the image. In the right side of the xml editor window you should see a series of name value items:
cx 65
cy 534.7
fill #212121
id circle3350
...
in my case (your numbers may be different). In the right xml editor window click on
fill #212121
it should highlight and the box just below that window should have
fill Set
(and in a lower window)
#212121
then change the #212121 to #FFFFFF
and click Set just above it to make the change take effect.
the black dot by pin 1 should have changed to a white dot to match the VALOR.
While we are here make sure you have gotten the correct copies of the label with the correct text. Look for a label in the xml
< svg:text id="label">
"PM6078-004"
if the text isn't PM6078-004 there will be trouble in Fritzing so change it in xml editor to be PM6078-004 (and thus match what Fritzing is going to overwrite it with) and change whichever svg:text id="text3367"> like line currently contains "PM6078-004" to what ever was in the label field above. After this you will need to reposition the text in the image to be in the correct place.
Now use cntrl-left click to select pins 2 to 11 and 14 to 23 (one at a time!) and delete them by selecting the pin and pressing the delete key. You need to do this 3 times for each pin to remove the complete pin. You should now have an image that looks like the real device with only 4 pins one on each corner and we are done with the breadboard view so save it via
file->saveas->Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_1_breadboard
(the file name you started from, it will be different than this we hope!)
This time we are going to change the save as type from the default Inkscape SVG to
Optimized SVG (about 2/3 down the long list of available formats!). Note this is different from the recommended plain SVG format Fritzing recommends but this in practice works better.
press save now a new window comes up with the same set of options that we set initially.Check them to make sure they are the same (and correct them if they aren't) then
OK
answer replace to the "the file exists" dialog box
and the breadboard view is done and saved.
So on to schematic
file->open
we are currently in breadboard and we want to go up one level and in to schematic. So click on the arrow at the end of the box in Look in: on the top line. If in the long tree that appears you click on user the view should change to breadboard, icon, pcb, and schematic. Click on shematic and select
Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_schematic.svg
then click open. A new Inkscape window should now open with the schematic view svg file displayed. You can now close (answering "close without saving" to the prompt so as to not ave the breadboard file as an Inkscape file over the plain svg file we saved above!) the breadboard Inkscape window that we are now finished with.
click view->page grid to get the grid. Note in this case we are aligned to the grid correctly so we don't need to move the entire image.
Start by selecting pins 2 to 11 and 14 to 23 and deleting them as we did in breadboard. I find it easiest to click on the element in the XML editor (edit->xml editor if it isn't in the right hand window at the bottom) til it highlights the appropriate pin then hit the delete key to delete it. By default the xml view is not expanded, so you need to click on all the "+" signs until they turn to a "-" and the underlying data appears (with more "+" signs, isn't xml fun ). Again there are three elements for each pin plus 2 more for the text for the pin number and pin label text (so 5 deletes for each pin). The connector pin is 0 width so Inkscape won't highlight it (but it will delete it thank god). Once you have done all the deletes, lets fix the 0 length pins issue for the future (Fritzing doesn't appear to care whether the connectorxterminal is 0 or 10 units):
in xml editor select connector0terminal then in the right panel select
stroke-width 0
and in the data window where the 0 is change it to 10 and hit set. Nothing will appear to change, because we need to change another setting as well. Now select width in the right panel, it too will be 0. Change that to 10 and click set and a square box should become visable in the drawing to indicate the terminal so we can see where the terminal is in future. Repeat this for connector11terminal, connector12terminal, and connector23terminal
This leaves us with only 4 pins and a lot of blank space, and with 2 pins (GND 24, and +9V 13) that want to be swapped to meet the standard that inputs should be on the left and outputs on the right in a schematic. So cntrl-left click on the line of pin 1 to select it and then using the y: down arrow just past the numbers on the 2nd from top tool bar to move the line down til it is 4 major (.1 inch) spaces above pin 12. Do the same to connector0pin, connector0terminal (which is why we made it visible!) by clicking on them in the xml editor to select them (as you can't see them to click on them in the drawing) and then doing the same thing with the y coord in the 2nd from top tool bar. Then select with cntrl-left click the pin number text and the pin description text and move them down to match the line. Now zoom in on pin 1 til the .01 grid becomes visible and do the same thing (select and move with the Y: arrow keys) to get the alignment exactly on the major grid lines. Again use xml editor to select connector0terminal and connector0pin and align them correctly. Now zoom back out til the entire chip is visible and select all the parts of pin12 (the line, connector11pin, connector11terminal and the 2 text labels and move them all to the opposite side of the IC from pin 1 in the same way (but needing to use both the x and y coord settings on the 2nd tool bar this time). The keyboard arrow keys will move the selected item with bigger steps than the 2nd tool bar arrows, so you can use them to get the elements in the approximate position and then use the 2nd tool bar settings to make the fine adjustments needed. Note the keyboard keys won't move the connector pins, they change position in the xml editor instead so you will need to use the 2nd tool bar positioning arrows to move the two invisible connectors to their new home. Now zoom in and use the 2nd tool bar positioning arrows to place the lines exactly on the major grid lines. Now do the same thing with pin 24, but move it to where pin 12 started out (on the bottom left corner of the IC). Now we want to select the outer rectangle and cntrl-left click to select it. In the middle of the bar at the top is an up/down arrow, if you position the mouse pointer over it, it changes from black to white. With it being white drag the top bar down til it is on the major .1 line above pins 1 and 12 and the outer rectangle becomes a box ,6 inches on a side. Now click on one of the pin labels (such as +5V next to pin1) then right click and duplicate then move the duplicate to just above the PM6078-004. That gets the appropriate font size for the other couple of text lines we want to add to the label. First duplicate the pin text twice more and move them down until there is pinx then PM6078-004 followed by 2 pin lines. Now double click on the first line to enter text mode and replace pin with
VALOR
click the 3rd line and replace pin with
9Vto5V then go back and add a space to 9V and to to end up with
5V to 9V
click the 4th line and replace pin with
DC-DCConverter then add a space to DCCon to end up with
DC-DC Converter
Now we are going to reset the view box to the size of our new part and we are done.
edit select all
file->document properties->resize drawing or selection
file-> save as->Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_schematic
optimisesd svg
save
(check the ticked values which should be ok)
OK
replace
So on to pcb
same procedure as for breadboard to schematic, except now from schematic to pcb
(out of space, continued in next post!).