Circuit Corner - Issue 5
Nothing adds a touch of class or retro elegance to a project quite like custom analog meters and dials. But yet, most people are intimidated by making appropriate backplates for these. There is one common software package on the net to help with this task, but it is windows specific and tends to be inflexible. And as of this writing, the program is not free.So the last time I found myself needing a custom meter face, I wrote my own program for it. My version has the additional benefit of being entirely written in Postscript. Since most UNIX print systems (including all of the most common Linux ones) work directly on Postscript files, my program can be used with nothing but a common text editor. And because Postscript is relatively well supported on a wide variety of operating systems, my system will work on most platforms.
Making Meter Faces
The first thing you will need to start making meter faces of your own is the program itself:
- Download Meter Face Generator.
Once you have a copy of that, you need two things:
- Your favorite text editor. I personally reccomend Vim, but you can use anything: nano, notepad, jed, xedit, or whatever.
- Something to display Postscript files. I use either ImageMagick's "display" program or Ghostscript's "gv".
Now, fire up the postscript viewer and display the file. The output should look something like what you see at the side.
This meter is nothing to write home about. On top of that, it is probably nothing like the meter you have available. With some editing, though, the program will very quickly spit out an appropriate meter face.
Suppose we want a scale that looks like the one on the left. The design is a common volt/amp single-range multimeter, conventional, but it makes a good demo.
Start by making a copy of meter.ps, and open it in a text editor.
Unit Definitions
Skipping the copyright notices, we start with:
% These are unit definitions. They define conversion factors for
% common units like mils, inches, millimeters, etc.
% ------------------------------------------------------
/mil { 0.072 mul } def
/in { 72 mul } def
/mm { 2.83464567 mul } def
This section defines the standard units of measurement used by the program. It is highly unlikely that you will find a need to change this, although you may wish to add custom unit types.
Scale Definitions
% Define all the scales you wish to use. If you
% want more scales, add lines like this for scale2,
% scale3, etc.
% ------------------------------------------------------
/scale1 32 dict def
This section declares the scales on the meter. The default defines only one scale, but we want two. So we want to add this line after the first:
We could easily add similar lines for scale3 and scale4, if we so desired. The program does not support more than four scales, although modifying it to do so is relatively simple.
Meter Parameters
This next section defines the meter face itself, but not the scales. For those not familiar with Postscript, the syntax for each numeric line is:
And for each string:
Since this is a long section, we will look at it in several parts.
% These parameters define the meter. You should edit
% them appropriately for your project.
% ------------------------------------------------------
% Width and Height of the actual meter plate itself
/meter-width 5 in def
/meter-height 5 in def
This part is relatively self-explanatory. Two variables, meter-width and meter-height, are defined. These should correspond to the dimensions of the backplate of your meter.
% these should match the values for meter-width and
% meter-height. Then if the results vary in size, measure
% the actual produced width and height and enter them here.
% The next time you print, the result will be properly
% scaled.
/calib-width 5 in def
/calib-height 5 in def
These two parameters should start with the same numbers as meter-width and meter-height. After you print the file for the first time, measure the size of the boundry rectangle, and reenter the values here. This ensures that you will get a correct sized meter, regardless of the accuracy of your printer.
/pivot-vert 1 in def
/pivot-horz 0 in def
% Mounting holes, distance from bottom and separation
/mounting-height 1.22 in def
/mounting-distance 2 in def
The first two parameters define the distance from the center of the bottom of the meter backplate to the meter's actual (physical) pivot point. The second two define the distance from the bottom to the mounting holes, and the seperation between them.
/signature (Circuit Corner 2004) def
/signature-font (Times-Roman) def
/signature-fontsize 10 def
/signature-vert 1.8 in def
/signature-horz 1 in def
These parameters define and place the text signature on the meter face. The position is relative to the pivot point.
Scale Parameters
The next section defines the scales on the meter. Unlike the previous sections, there may be multiple instances of this one. Since we are making a two-scale meter, we will have to duplicate this entire section, once per meter.
When duplicating this section, change the name in this line appropriately (for example, "scale2 begin").
This defines the color of the scale. The "0 0 0" refers to a red/green/blue triple from 0 to 1.0, so to make a scale dark red, use ".5 0 0". To make a scale dark green, "0 .5 0".
/scale-divisions 50 def
/scale-linexp 1 def
/scale-degrees 100 def
/scale-virtoffset 1 in def
scale-radius defines the distance from the physical pivot point to the inside arc of the scale.
scale-divisions specifies the number of tic marks in the scale.
scale-linexp specifies the linearity exponent. This should be 1 for a linear scale, 0.5 for a square-law scale, or 2 for a square-root scale.
scale-degrees is the number of degrees deflection measured from the physical pivot point.
scale-virtoffset is the vertical distance from the physical pivot point to the center of the tics. This can be used to make the scale appear flatter, giving it a modern look.
/scale-labelfont (Arial) def
/scale-labelfontsize 12 def
These parameters define the font and distance above the scale arc to display the scale labels.
/scale-end 15 def
The start and end values of the displayed scale labels.
/scale-titlefont (Arial) def
/scale-titlefontsize 18 def
/scale-titlevert 2.8 in def
/scale-titlehorz 0 def
These parameters define the scale title, which is normally used to show the units of the scale. The position is measured from the physical pivot.
/dash-length2 150 mil def
/dash-length3 250 mil def
/dash-interval1 5 def
/dash-interval2 10 def
/dash-width1 1 def
/dash-width2 2 def
/dash-width3 2 def
These parameters define the lengths, widths, and intervals (counts of minor tics between tics of each size) for three different sizes of tic.
/arc-endlen 400 mil def
end
These parameters define the thickness of the arc line segment itself, as well as the length of the cap tics (the lines at each end of the scale).
The rest of the file is program code and will not ordinarily need to be altered.
You should now have a meter face appropriate to your project. A future issue will likely address the actual electrical use of analog meters.
Making Dial Scales
This program is flexible enough to use for laying out dials and other similar radial analog controls.The program readily accepts deflection angles above 180 degrees without modification. The virtual offset feature is of little use for these sorts of dials, but otherwise, the design method is the same.


