This Blog will document projects I have
in progress or completed. You can search for my
handle on Flickr, Facebook, YouTube, or Picasa
for photos. I will link some of those here.


Arduino – Si5351 Powered Signal Generator

Arduino-Si5351 Signal Generator

Arduino-Si5351 Signal Generator

Device Description

For a long time I wanted a general purpose signal generator. Now Direct Digital Synthesizer hardware is available on a single programmable chip. The Analog Devices AD9851 is used in many ham radio projects, also widely used is the Silicon Labs Si5351. Either of these can be obtained from many sources such as Adafruit, Sparkfun, or on EBay and there’s lots of information on the internet. Even Amazon has them. A few dollars gets a DDS chip that will tune continuously from audio to VHF mounted on a small breakout board. I purchased an Si5351 board from Etherkit because they offer a version with a TCXO.

Silicon Labs makes the Si5351 in several variations. It’s intended use is as a multiple output clock generator with up to eight individually programmed frequencies. Most commonly available breakout boards though, use the A version with three outputs. Digikey has the bare chips for less than $1. Connectors are optional, most boards are set up for SMA female jacks. The signal generator I built brings out all three outputs but I used good old RCA phono jacks. SMA connectors are wonderful but the cables to use them are pricey. My box will be used to check and align receivers so precision impedance control is less important.

AD9851 chips have a real Digital/Analog converter on board, it uses an amplitude lookup table to produce a fair sine wave. The data sheet says:

“The AD9851 uses an innovative and proprietary angle rotation algorithm that mathematically converts the 14-bit truncated value of the 32-bit phase accumulator to the 10-bit quantized amplitude that is passed to the DAC. This unique algorithm uses a much-reduced ROM look-up table and DSP to perform this function.”

which sounds suspiciously like the quarter wave sine synthesis I experimented with a few years ago. I’ll have to revise my WordPress pages about quarter wave DDS techniques to include the phrase “angle rotation algorithm”. The price for pure sine wave complexity is, the device has only a single output. In contrast, the Si5351 outputs a square wave on all it’s ports – it is intended to serve as a programmable frequency clock source but for my purposes I don’t care and the available multiple outputs are attractive.
I breadboarded the Etherkit breakout along with one of Paul Stoffregen’s Teensy-LCs I had on hand for the controller. A Teensy-LC has an ARM Cortex M0 heart clocked at 48 Mhz. An ordinary 16 Mhz Arduino would probably work in this circuit but would have trouble with sweep. I used basic software from N6QW to get started and my oscilloscope soon showed it was working. Then a series of enhancements to the N6QW sketch followed:
  • expand to controlling all three outputs
  • setting up frequencies using rotary encoder and LCD menus
  • save and restore setup in EEPROM
  • add output power change to the menus
  • add  output OFF to the power menu
  • add sweep capability with menu control

The Box

A thin metal gift card box was cut up to form an enclosure for the generator. It is about a quarter inch larger than the usual Altoids tin in all three dimensions. I needed the extra volume to fit in a battery and charger removed from a cheap phone power pack. These booster packs usually contain a single 18650 cell and it just fits.

Arduino-Si5351 Signal Generator Interior

Arduino-Si5351 Signal Generator Interior

The components are, top to bottom, blue 16×2 LCD board supporting the Teensy-LC. The entire unit can be 5 volt powered either from the Teensy USB jack or from the battery charger, I added a fat diode to isolate the two sources.  Both the Teensy and the Si5351 board are using their on board voltage regulators. The LCD is five volt, but the Teensy-LC does not have 5 volt tolerant inputs. There are 2.2k resistors between the LCD data pins and the Teensy to smooth over that discrepancy, these would not be necessary if the LCD was a 3.3 volt unit. The pot below the Teensy adjusts the LCD contrast.
At left below the LCD is the Adafruit (Bourns) rotary encoder. It just clears the battery. Right of the encoder is a strip of perf board with the three output select pushbuttons mounted. The LCD, encoder and buttons are Adafruit parts.
At the top of the open box bottom is the salvaged 18650 cell. The measured drain of the whole circuit is less than 100 milliamps so the battery should last half a day at least. The gooey glob at the center is a 2.5 amp fuse. To the right of the battery is the on/off switch and isolation diode. The salvaged Lithium charge/boost circuit is the green board at bottom right. It has it’s own separate USB jack because the USB data leads are not accessible. To program the unit you have to plug into the Teensy USB jack.
Finally the blue board in the bottom is the Etherkit breakout. The actual Si5351 chip is at the left end, next to the TCXO. There are three RCA output jacks mounted in the left side of the box, the fourth jack next to the handle is for syncing the scope when sweeping.


On power up the unit reads saved frequency settings from EEPROM. The display then shows frequency, current port selected, and the output power setting.

Click one of the three buttons to change the port selected to display on the LCD.

Rotating the encoder knob will change the frequency digit under the flashing cursor. Press click the encoder knob to change the digit under the cursor, you can set the cursor to change digits from 1 Hz to 10 MHz.

Hold one of the port select buttons down and turn the encoder knob to change output power for that port. The chip has choices of 8 milliamps, 6 mA, 4 mA, 2 mA, and OFF. Silicon Labs’ spec for driver impedance is 50-85 ohms.

If any of the above settings are changed, the software waits ten seconds, then copies the current settings into EEPROM. In the event the unit gets confused, it can be restored to last saved settings by cycling the power switch. Also it can be returned to default settings by holding down all three port select buttons, while powering up.

Arduino-Si5351 Signal Generator Frequency/Power

Arduino-Si5351 Signal Generator Frequency/Power Setting


Sweep Function

Sweep is accessed from a separate menu. Press down the encoder knob for more than two seconds (a long press) and release to enter sweep parameters for the currently selected port.  A short click of the encoder knob will advance the menu through the sweep choices, currently +/-  0, 1000, 5000, 15000, 50000, or 150000 Hz. The unit sweeps from frequency minus that amount to frequency plus that amount so the total width of sweep is twice the setting. Sweeping is done by reprogramming frequencies in 20 steps between the limits.

A second long press of the encoder knob will return to the frequency menu. The letters “sw” appear on the LCD to indicate that that port is set up to sweep. All three ports can be set up but only the port currently selected in the display will be sweeping at any given time.

A pulse is available at a phono jack on top of the box to trigger an oscilloscope at start of each sweep iteration.

Sweep parameters are not currently saved in EEPROM.

Arduino-Si5351 Signal Generator Sweep

Arduino-Si5351 Signal Generator Sweep Setup Screen


The Software

I am using the Si5351 library from Etherkit. I added a function to completely disable the output drivers to save battery when a port is set to “OFF” so I will include the library in the zip file.
Most of the sketch, implementing multiple port and the menus, was straight forward. The one thing that gave me fits was the quadrature nature of the rotary encoder. This is a mechanical switch and it glitches. Not a problem if you are say, setting an analog output from 0 to 1023, you probably wouldn’t notice but if you need to change a digit by exactly one, glitches are intolerable.  Conventional debouncing a switch usually just waits a certain amount of milliseconds after a transition is detected, read again and proceed. There are debounce libraries for doing this. I had no luck. I finally found an post by Oleg Mazurov about treating the quadrature pulses as a Gray code. It helped a lot and I posted about my findings in the Adafruit Feather forum.
The Adafruit rotary encoder outputs four state transitions on each of it’s 24 rotary detent positions. To get one increment per detent, I tried skipping four state reads with a software counter but it was still glitching if the knob was inadvertently touched. What finally worked was changing the Gray code decode table to disallow all but one positive change and one negative change. The allowed changes remaining are in the middle of the detent so glitches near the resting position are unlikely.
Sweep is accomplished by reprogramming a port frequency on the fly. Tests indicate this is slow and the 20 step sweep takes about 65 milliseconds which limits the sweep rate to about 15 per second. I found a very good way to time something is to write a 1 to some output pin at the beginning, then write a 0 at the end. It’s easy to see exactly how much time the intervening code took by measuring the pulse on an oscilloscope. The send_frequency function takes 3.5 milliseconds. Looking at the Si5351 library, the set_freq code is long and complex. It might be possible to speed this up by using the set_freq_manual call but I’m not smart enough to do that. Porting this code to a 16 Mhz Arduino might make the sweep unusably slow.


A zip archive is available including sketch source, the Si5351 library, and a schematic
Jan 4, 2018 V1.1 including the sweep function
 Jan 5, 2018 V1.11 Sweep bug would not change freq while in sweep mode. Cleaned up schematic.

Arduino Iambic Keyer – 2017

Last spring I started doing what I call “Morse Walking”. Going out with headphones on, beeping morse code. I’m doing this hoping I will get good enough at morse to actually use it on the air without making a fool of myself. I previously made two battery operated Arduino based keyers here and here that can generate random morse characters. But they are awkward, the 2015 version requires an external battery and the 2016 model won’t fit in my pocket. Obviously I needed another project.

Arduino Feather keyer

Arduino Feather keyer


I decided to use an Adafruit Feather, it has an Atmel 32u4 processer, built in USB interface, a charger/converter for a 3 volt lithium battery, and plenty of pins brought out. The idea was to cut down the previous keyer software to fit the 32u4 equipped with only the hardware I needed for battery powered practice. Like many of my projects, putting it all into a small box proved to be difficult. Not many parts in the schematic but that Altoids tin is only 2 1/4″ x 1 1/2″ and about 1/2″ deep.

Arduino Feather Iambic Keyer Schematic

Arduino Feather Iambic Keyer

Note the unusual wiring at the headphone jack. Ring is grounded while tip carries the signal. Sleeve is not connected. This puts the two headphone elements in series and presents a higher impedance to the output circuit. The ring normal contact can then signal power enable to the Feather when the phones are plugged in.

I sawed about a quarter inch off the breadboard end of the Feather to make it fit, along with two phone jacks, in an Altoids Small tin. I wired up the Feather along with a quadrature rotary encoder which I thought would be cool to use as a volume control. Porting the previous keyer sketch to the 32u4 proved more difficult than I expected. The encoder required major changes to the keyer code as volume control is now in software and requires manipulation of the sine wave synthesizer tables. I got that part mostly working but set the project aside in May.

So now it’s November and I’ve picked up the little keyer again. The software has been revamped and now has these features:

  1. Characters to be sent are buffered in an asynchronous circular queue so memory buttons or keyboard characters can be “typed ahead”.
  2. USB serial terminal is supported as a keyboard for sending or function programming.
  3. Paddle generated morse is interpreted and printed as ASCII letters on the serial terminal.
  4. Four programmable memories available with 251 character capacity each.
  5. Memories programmable from serial terminal or from the paddles.
  6. Random code practice modes, letters, letters and numbers, letters numbers and punctuation.
  7. Adjustable character spacing in code practice mode (Farnsworthiness).
  8. Morse character speed settable 10 to 45 WPM.
  9. Sidetone frequency settable 100 to 1200 Hz.
  10. Synthesized sine wave sidetone with leading and trailing edge envelope shaping.
  11. Memories and operating parameters stored in EEPROM and easily reset to defaults.
  12. Stand alone operation from LiPo battery.

I went for an hour walk today with the keyer in my shirt pocket and it performed flawlessly so I consider it done.

This is a photo of the unit with battery removed.

Arduino Feather keyer battery removed

Arduino Feather keyer battery removed


I had to move the JST connector to the side to get clearance, the battery would not fit under the rotary encoder. There are four memory buttons, plus the back switch on the encoder used for Function. I’m using my usual analog read routine to debounce the button switches. Metal cap switches from Adafruit, work much better than the 6mm plastic buttons I used in previous versions.

You can see here the battery just fits.

Arduino Feather keyer with battery

Arduino Feather keyer with battery


I spent quite a bit of time working on the waveform generation setup. The encoder routine generates a number 0-64 which is used to scale the synthesizer waveform. Four 16 byte amplitude tables must be regenerated in RAM each time the volume is changed. Initially the sine waves were horribly distorted so I made a spread sheet helped to see what was happening. I was able to work out code that produced a good stepped morse element.  There is very little audible clicking now at beginning or end of the morse elements.

This photo is a dit at about 25 WPM.

Arduino Feather keyer waveform

Arduino Feather keyer waveform

The software, detailed operating instructions, schematic, and spreadsheets can be downloaded from Dropbox.
Any future revisions will appear here

Version 1.0 12/3/2017

Version 1.2 12/6/2017 Was running out of memory, rearranged startup and moved stuff to PROGMEM

Jim Harvey – wb8nbs@gmail.com


Making an Octagonizer


In more than one episode of “The Woodwright’s Shop” Roy uses a gauge he calls an “Octoganizer”.  See this recent show at about 23 minutes in. He can mark a piece of square stock with the layout lines needed to plane off the four corners, creating an octagon. The tool has a pair of locating posts that straddle the work piece, and two scratch pins to mark the face.

These screen shots from the Woodwright’s 3613 episode show the antique Octagonizer and also Roy marking a stool leg blank. He made a point that the tool can follow a tapered leg blank.

Bottom side of the Octagonizer

Bottom side of the Octagonizer


Using the Octagonizer

Using the Octagonizer

Searching the internet reveals this is a common tool in the boat building business called a “Spar Gauge”. I don’t know what “Spar” is on a boat.  I thought it was something Texans carried in the back of their pickup. Many internet pages discuss methods of making this tool, here is one that uses a graphical method to locate the marking pins.

I decided to explore the concept and make one. Or two. Or three. It turns out one size doesn’t fit all.

The Method

So exactly where do you drill for the scratch pins?

This is the necessary derivation:
In the following W = Width of stock, F = Width of a full facet, X = Width of an angled facet (to be removed).

Square stock layout

Square stock layout

The full width W contains one full sized facet and two angled facets
W = F + 2 * X

Angled facets measure full width times the cosine of 45 degrees, which is \frac{1}{\sqrt 2}
W = F + 2 * (F * \frac{1}{\sqrt 2})
W = F * (1 + \frac{2}{\sqrt 2})
W = F * (1 + \sqrt 2)

Rearrange the last to solve for the full facet width:
F = \frac {W}{1 + \sqrt 2}
Plugging in the numbers and calculating gives:
F = W * 0.4142

But we really need to know X, the width of the angled facet, so we can mark the stock by measuring from an edge.
X = F cos 45
X = \frac {W}{1 + \sqrt 2} * \frac {1}{\sqrt 2}
X = W * \frac {1}{\sqrt 2 + 2}
Running that through my calculator gives:
X = W * 0.2929

So 0.2929 is the Magic Number!

Just to verify:
0.2929 + 0.4142 + 0.2929 = 1


Locating posts on either side of the tool are a source of error because of their thickness. If the tool has to be skewed to a really steep angle, like using a four inch long Octagonizer to mark a half inch stick, the marks will be too close to the edge. In this exaggerated example with posts an inch in diameter, the scratch pins miss the thin board completely.

Error caused by peg diameter

Error caused by post diameter

If the locating posts were infinitely thin this would not happen and the tool could always lay out an accurate octagon. Therefore we need to keep posts as small a diameter as practical and avoid steep skew angles. I’m going to use six penny nails for posts and eventually make several Octagonizers to accommodate projects of different widths. Practically though, for many uses octagon shapes don’t have to be perfect.

The Octagonizer I made doubles up on a 4 1/2″ piece of Osage Orange. The wide side will mark stock up to 3 3/4″ wide. I let the wide side scratch pins stick out on the side opposite the points, these form the locating posts for marking narrower stock up to 1 3/8″.

Dual Octagonizer front

Dual Octagonizer front


Dual Octagonizer wide side

Dual Octagonizer wide side


Dual Octagonizer narrow side

Dual Octagonizer narrow side


This photo shows the wide side marking a piece of 2 inch stock. I’ve enhanced the scratch marks with pencil for the photo.

Marking a blank with the Octagonizer wide side

Marking a blank with the Octagonizer wide side

I had a piece of Poplar about 1 1/4″ square, I marked it out with the Octagonizer’s narrow side. Here it is clamped corner to corner in the vise.

Planing a 1 1/4" Poplar square into an octagon

Planing a 1 1/4″ Poplar square into an octagon

The Poplar works down quickly. I left one facet uncut just to show how it works.

The first try, three facets planed

The first try, three facets planed

While working through the arithmetic to locate the six holes in this double sided tool, I had to carefully account for the radius of the nails. Six penny nails measured 0.116″ in diameter, not accounting for this would throw the accuracy off a lot. I sharpened the points before assembly by chucking the cut off nails in a battery powered drill, then gently spinning them against a grinding wheel. The points were tempered by heating them red hot, quenching in water, then cooking in a toaster oven for 20 minutes at 425 degrees. I used a machinists vise to press the nails through pre-drilled holes in the Osage Orange.


In many cases you can set a marking gauge to Width times the Magic 0.2929, and just mark all eight lines with that.  If I had to make only one octagon I would use a marking gauge. If I had to make more than four, I might make an Octagonizer. A marking gauge will not encounter the error discussed in the previous section and you can lay out an octagon on a piece of stock any length, any width. It would not work though on tapered stock.

I plan to Octagonize a treated 4×4 for a porch support post.

Roy showed using the Octagonizer to lay out a tapered stool leg but laying out a short tapered octagon like a chisel handle, can also be done by marking both ends of a tapered blank, then using a straight edge to connect the dots. This is also a good method if you don’t want to see evidence of scratch marks.

Eclipse 2017

Viewing Methods

A few weeks ago I started thinking about what to do with materials I have on hand for the August 21 Solar Eclipse. This area of Illinois (just West of Chicago) will see about an 88 percent occlusion, per this calculator, starts at 11:53, peaks at 1:19PM and ends at 2:42. Weather permitting of course – what are the odds?  This post is written six days before the event. I will update if the viewing is successful.

Pinhole projection seemed like a good traditional method, but Google research indicated the image would only be about 3/4″ diameter. One of the pinhole discussions also talked about using one side of binoculars to focus the Sun’s image. I do own a medium quality 7×30 pair with zoom so decided to try them. This is one of the first images obtained.

Close up of projected sun image

Close up of projected sun image

I was very pleased with this, if you look just below center slightly to the left, there is a genuine sunspot clearly visible. The image is about 3 inches across at minimum zoom.

Now to make a two hour viewing interval practical I explored mounting the binoculars to a good camera tripod. This tripod has the pan and tilt head on a tall crank up rod and a mechanism to tilt that rod at it’s base up to 90 degrees (parallel to the ground). Long ago I owned a telescope with an equatorial mount and I thought maybe laying the central rod down at the proper angle would enable that function.

The advantage of an equatorial mount is you can track a star, or the Sun, by adjusting only one of the two axes of the telescope mount. Having to manhandle both the azimuth (pan) and elevation (tilt) to track is a real PITA. You don’t realize how fast the Sun moves across the sky until you magnify it 7 times. The sky moves 360degrees/24hours = 15 degrees every hour. The way the mount works is, you align the primary axis of the scope, in this case the tiltable rod, with the earth’s rotational axis. Then the stars rotating around the earth’s axis also rotate around the telescope’s axis and you can keep the scope pointed at the same spot in the sky by adjusting only the azimuth. Ideally with a powered clock mechanism.

Of course it’s you that’s moving, not the Sun but the result is the same. Thank you, Nicolaus Copernicus.

First, my binoculars had to be firmly attached to the tripod. The dozen or so rubber bands I used for initial testing just didn’t work out. I drilled a block of hard wood to fit the round central spine of the binoculars. All binoculars I have seen are made like this, it is part of the mechanism that allows the two eyepieces to separate or close to match your eye spacing. Then I sawed through the drilled block and installed a couple of screws to clamp the block on the spine. Then I drilled and tapped a 1/4-20 hole in the bottom of the block to mate with the tripod screw.

You need a large shade so the projected image is in shadow. This was easily made from cardboard.

Binocular clamped to tripod

Binocular clamped to tripod

This photo shows the tripod tilt mechanism with the riser set to equatorial position.

Tripod extended in equatorial position

Tripod extended in equatorial position

I made a box to further keep out stray light. It’s about ten inches square, painted flat black with a sheet of white paper at the bottom. The string you see in the photo above helps align the shadow box axis with the binoculars. I mounted the cardboard box on a 1×6 with a hinge and a sliding prop arrangement so the box can easily be tilted to align with the projected image.  The box must be moved and realigned every now and then as the Sun moves across the sky.

Sun image projected into shadow box

Sun image projected into shadow box

If I was observing stars at night, I could align the scope by looking at the north star. But during the day the procedure for equatorial alignment is:

  1. Align the riser rod exactly North by positioning the whole tripod.
  2. Raise the central rod to the exact latitude of the location. About 42 degrees here.
  3. Uncover one side of the binoculars
  4. Hold a sheet of paper below the eyepiece and move the tripod pan and tilt until you see the Sun image. Try to center the image in the binocular field by exploring the edges.
  5. Remove temporary paper, set and align the shadow box with the projected image. Stretching the string back to the box will show you the axis.
  6. Tighten the tripod tilt but leave pan axis loosen enough to move with the Sun.

Here is the assembled Helioscope. You can see the projected image in the bottom of the box.

Binoculars with shade projecting sun image

Binoculars with shade projecting sun image

So far my only expenses are a spray can of flat black paint and new batteries for the camera.

Camera Modification:

Hand holding a camera on the image is awkward. I decided to mount a camera directly on the box so it would always see the same image field. To enable this and not block the projecting beam, I bumped out one side of the box 2 1/2 inches. Hot glue is wonderful stuff. It took some fussing with a tapered shim to get the camera pointed at the image correctly.

Camera mounted inside box

Camera mounted inside box

It’s very hard to read this Canon A530 screen in the sun so I connected a small television which has a composite video input to remote the display. This works well. You can see the 2 1/2 inch bumpout in this photo.

Camera in box and composite monitor

Camera in box and composite monitor

The best images are shot with the camera zoomed in a bit. I’ve worked out how to crop the pictures consistently with GIMP. A stretch goal is to make a video of the whole occlusion. I’ll need a photo every 30 seconds, two hours and 45 minutes should fit on a 2 gig camera card.  But I worry about having to change camera batteries in the middle of the sequence.

I worked up a BASIC script with the Canon Hack Development Kit. It is based on a Wiki post by Keoeeit, his version 3. It should solve the setting consistency problem if I have to change the batteries and fires the camera at a set interval.

It has the following parameters to set:

  • Initial Zoom amount, a number 0-8 for the A530
  • Delay before first shot Min, Sec, Allows time to reposition the camera after a disturbance
  • Number of shots to take, zero runs forever
  • Time between shots, Min, Sec.

I run the camera in Manual mode with shutter about 1/80 sec at F4.5 (the small Canon cameras don’t really have an iris). I don’t want the exposure to change any time during the run. I put a magazine page in the box so the lens has something busy to focus on then put the camera in CHDK mode and start the script, .

The following happens:

  1. The lens zooms out to the fixed setting supplied.
  2. There is a delay countdown so you can tweak the camera position
  3. The lens focuses and then locks the focus
  4. A ten second delay to allow removing a focus target.
  5. The camera begins taking pictures at the specified interval.


This is the BASIC script

rem Author – Keoeeit
rem Upgraded by Mika Tanninen
rem Time accuracy and shutdown for a710is by Viktoras Stanaitis
rem h-accuracy for delay, j-accuracy for interval
rem Reset zoom added to restore the same picture
rem in case batterys have to be changed during a long session


@title Eclipse Intervalometer

rem number of zoom steps to execute at beginning of script
rem A530 has steps 0 – 8
@param i Initial Zoom
@default i 3

rem the delay is after zooming so camera positon can be tweaked
@param a Delay 1st Shot (Mins)
@default a 0
@param b Delay 1st Shot (Secs)
@default b 0

@param c Numb. of Shots (0 inf)
@default c 0

rem interval is the time between shots
@param d Interval (Minutes)
@default d 0
@param e Interval (Seconds)
@default e 10


rem Move the zoom to a consistent setting
set_zoom 0
for s=1 to i
print “step”,s
set_zoom_rel 1
next s

if c<1 then let c=0
if t<1000 then let t=1000
if g<=0 then goto “focus”

rem count down seconds until begin shooting
for m=1 to g
print “Intvl Begins:”, (g-m)/60; “min”, (g-m)%60; “sec”
sleep 930
next m

rem set and lock focus
press “shoot_half”
sleep 2500
release “shoot_half”
print “Remove Focus Target”
sleep 10000

if c=0 then print “Shot”, n else print “Shot”, n, “of”, c
if n=c then goto “quit”
sleep t
goto “interval”




More Fun With Direct Digital Synthesis: Adafruit Feather 32u4

Feather Port with Volume Control

Long walks are a good thing and I’ve taken along one of my morse code keyers running in practice mode to pass the time. Neither of the keyers I made fit pockets very well so I decided to build yet another one, battery operated, with headphone only output. The target container is an Altoids Small tin easily carried in a shirt pocket.

An Adafruit Feather 32u4 Basic has built in USB and an on board battery charger so it is a good start for this project. I ported my previous 32u4 code easily. Reference my previous page on the 32u4 experiments here. Driving headphones directly from a Pulse Width Modulated output is different from my previous projects where I used a small audio amplifier to drive a speaker. Headphones have a much lower impedance than an amp so RC filter components change radically. Implementing a volume control would be a challenge. I tried a 500 ohm trim pot and that worked fairly well with some but not all of the headphones I tried. But I couldn’t find a pot with a shaft that would fit in the Altoids tin.

With PWM Direct Digital Synthesizer generating a sine wave I might be able to throttle the PWM output with software. I have an Adafruit Rotary Encoder that fits the Altoids tin if I’m careful so I worked that into the demo program.  Rotary Encoders are basically mechanical, therefore subject to contact bounce like any other switch. I Googled up a half dozen different Encoder sketches and all of them would glitch badly. I finally found code by Oleg Mazurov that uses a Grey coding technique to ignore invalid inputs. It works well. I was able to get that code running on the Feather and contributed the sketch to the Adafruit Feather forum.

This photo shows the slightly truncated Feather in the Altoids Small tin. The encoder is the green object in the center of the lid. There are a couple of Oscilloscope umbilicals attached and the battery is not yet installed.

Changing the apparent volume of the DDS output is a process of multiplying the Sine table values by a volume parameter between zero and one. I copy the Sine table into RAM and apply this transform. But since I use only integer math in the sketch, the method is, read the value from flash then multiply by 0-63 volume, then divide the result by 63. Close enough.

One more improvement: in the original sketch, even when the volume is set to zero the PWM signals are 50% high and 50% low, averaging zero as far as the Sine wave coupled through the output capacitor is concerned. That means the output pin is still driving full voltage at the PWM frequency. With the low load impedance it’s a significant drain on the DC power and I’m using a very small battery. The remedy was to lower the zero crossing base line in step with lowering the amplitude of the Sine table.  A new volatile variable maxSine passes the necessary correction to the DDS Interrupt Service Routine. The ISR doesn’t like having it’s variables changed on the fly. Rotating the Encoder makes a scratchy sound like a dirty potentiometer but it’s fine when you stop adjusting.

I measured 18 milliamps constant draw from the USB supply before implementing the zero crossing shift. With the shift, current varies from 10 ma at zero volume to 17.6 ma at maximum volume. The 150 mah battery should last 6-10 hours, way more than my morse code attention span.

My example sketch with all the experimental options in the previous version is downloadable from Dropbox. A short video showing the waveforms produced is on YouTube.



Plow Plane Arm Repair

Broken planes is a subject that comes up often in the Facebook Unplugged Woodworking group. Stripped threads are common on wooden planes that use threaded arms to position a fence. They usually break next to the arm’s foot as that is where the fence is most often needed.

This is my example, it will be my repair experiment. Years ago I demoted it to a kerfing plane by replacing both skates with a blade cut from an old rip saw. I screwed an inch and a half spacer block on the fence to skip over the defective threads, which worked, but is awkward and heavy.  I’m going to simply cut out the defective section, which will shorten the range of the plane, but who plows grooves six inches out anyway.


These are the two threaded arms. Each was made from a single piece of wood with a 3/4″ O.D. threaded section. The challenge is to securely and accurately splice the amputated threads back on the foot.


So my plan removes the stripped part, then makes a half inch round tenon on the end of the good threaded rod, with a matching half inch mortise in the foot. The two parts are reassembled with a 1/4-20 threaded steel rod pulling them together, I think it will be at least as strong as the original solid wood part.

Most of the work was done on my Delta DP-300 drill press on which I have carefully aligned the press table square to the quill.

The first task was to make a fixture to hold the threaded arm accurately aligned with my drill chuck. I had to file the hole in the drill press table a bit to get the threaded arm to pass up through easily from the bottom.

To make the alignment fixture, I screwed a bit of 2×4 to a piece of scrap, clamped that to the press table, then ran a 3/4 inch Forstner bit down as far as it would go, I had to finish the bore with a longer spade bit. I removed the drilled 2×4, cut a slot on the table saw, then installed two screws to help clamp the threaded arm in place. It did take a small amount of sanding to get the threaded arm to pass through.


This is the bottom of the fixture. Two screws hold the drilled 2×4, they are placed so they will not interfere with the clamping slot on the top side. It’s easy to align the fixture on the drill press table, insert the threaded arm from underneath through the hole in the table about half way into the fixture. Lower a 3/4 forstner bit into the top of the hole, lock the table, and set the clamps.


I sawed the stripped arm off about an eighth inch from the foot. That left an inch or so of threadless wood on the shaft to practice on. In fact, I used a piece of 3/4 dowel up in the fixture to make the first practice tenons.

The first operation is to drill down on the sawn face with the 3/4 Forstner bit. That leaves a center dimple and faces the end off square.


The mortise will be drilled with a Forstner bit so I made a half inch hole in a piece of hardwood scrap to test the size of the tenon. I believe this is called a Mullet.


I considered a few alternatives to make a tenon. Maybe a hole saw (too sloppy). I looked at a half inch plug cutter (would have to regrind the tip to get a shoulder). I decided to use a cheap circle cutter, which can be tuned and has an angled bit that would make a nice tapered seat. The inside of the bit is ground flat so it was easy to sharpen with diamond paddles, and the pilot drill is smaller than the #7 size needed to tap the hole. I also ground a relief angle on the inside of the cutter. It was not designed to make a clean cut on the inside, making an angle of 15-20 degrees away from the cutting edge helps a lot. You only need to grind the cutter up about a half inch from the bevel, leave it flat where the set screw clamps.

It was very difficult to set the diameter accurately. I hit on using feeler gauges to measure the gap between cutter and pilot drill. I would hold the cutter against the feelers and tighten the set screw, which allowed me to add or subtract a few thousandths from the tenon diameter in a controlled manner.


You have to lower the circle cutter onto the wooden shaft slowly, it’s difficult to see where the cutter is when the whole thing is spinning. After a half dozen practice cuts in the 3/4 dowel, I had a tenon that fit well in the test mortise. I set the bit depth so that the tenon is a quarter inch long when the body of the tool contacts the wood. And with the fixture, I’m sure the tenon is axially aligned with the chuck and the dowel.


I made one test tenon on the end of the threaded arm, then took a deep breath and sawed the bad part off, leaving about 3/8″ of the stripped area to make the final tenon.


Again, faced off the freshly sawn end with a Forstner bit. Then made the tenon with the circle cutter. It looked good.


The final operations on the truncated arm were to drill and tap a hole about an inch and a quarter deep. I had a couple of 3 inch machine screws to use, but threaded rod would be good also. I used a tapered tap and ground the end of the sawn off bolt to match, to allow a bit more wood where the bolt ends. The bolt was screwed in by tightening a couple of nuts on the protruding end so I could turn it with a wrench. I also cut small grooves in the tenon for possible glue squeeze out.


That completes the preparation of the tenon.

Now to create an accurately aligned matching mortise in the foot. The first step is to secure the separated foot in a good sized wooden clamp for machining. Don’t want fingers near that router bit. I used an engineers square to check that the surface that contacts the fence is exactly perpendicular to the drill press table.


Now lower and lock the quill, run the drill press to maximum RPM, and carefully rout the sawn surface flat. I did this in three shallow passes leaving about a sixteenth inch of the original shaft.


When this arm was originally made, the outside diameter of the threaded part was even with the sides and top of the foot. That made it fairly easy to find the center of the cut off with a marking gauge.


I center punched the foot and drilled an eighth inch pilot hole


Followed by a half inch Forstner bit in about 3/8 inch. The pilot hole was enlarged in three stages finishing with a #7 bit, appropriate for a 1/4-20 tap. I wanted to engage an inch of thread under the mortise so the hole was run in about 1 1/2″.


I had to create a tapered seat to match the tenon. I did this in the drill press with a counter sink bit.


The countersink chattered if it wasn’t fed very slowly but did a decent job. Actually I found it worked better to remove the drill press drive belt and turn the countersink by hand.


Next, the hole was tapped to a depth of about an inch and an eighth. I went through the full set of tapered, plug, and bottoming taps. To ensure the threads were accurate I make the first pass with the tap in the drill press chuck turned by hand. The plug and bottom taps were run in with a tap wrench.


The long threaded bolt was cut to have about an inch and an eighth protruding from the end of the arm.


The final test – will it go together? It did fit a little tight but the arm is parallel to the fence face as best as I can tell. The real test will be is the fence parallel to the plow skates after it’s put back together. That might be the subject of another web log post.


I brought the two parts into the house where it’s warm enough to apply liquid hide glue and screwed the arm home snug but not tight. Here is the repaired fence arm next to the unfixed second arm. You can hardly see where the two pieces are seamed together. The small piece is what was cut out of the bad threads.


The process was successfully repeated on the second arm.


Now the plane could be reassembled. I found the fence would no longer clear the body, so I make a couple of thin spacers to get clearance. I’ve added leather washers to the thin inside fence nuts so the minimum space between blade and fence is about 3/16″. I may tune the fence further at a later date but for now it appears to be parallel to the blade so is very usable.


I tried it out, set the fence to a quarter inch and it kerfs beautifully.


Sliding Lid Pencil Boxes


“The Woodwright’s Shop”, Season 36, Episode 2 shows Roy Underhill’s method of quickly making many small wooden boxes for Christmas gifts.  The show is not really about boxes, but about jigs to make them.  I decided this would be a good project for the Dupage Woodworkers Club annual charity Christmas toy drive. Club members make a lot of toy cars which are most appropriate for boys. These boxes will appeal to girls or boys. I adapted the Woodwright’s ideas to mass produce boxes using a table saw, apologies to Roy, but my goal is to make 14 in a day.

Saws cut fingers as easily as wood. In many of these operations hands are very close to the blade. Pay attention, think through each cut before moving the wood,  and turn the saw off to clear chips. I will not be responsible if you injure yourself.

Small boxes can get away with mitered corners simply glued. Three things are necessary for a box to come together perfectly:

  1. Miter cuts must be perfectly square to the edges

  2. Opposite sides must be exactly the same length

  3. Mitered edges must be cut to a precise 45 degree angle

Given that standard pencils are 7 1/2 inches, the first boxes were designed for an inside dimension just under 8″. They are made from 1×3 stock from the local Home Center (really 3/4″ x 2 1/2″) resawn and planed to 5/16 thickness. I need 39 3/4 inches of stock to make one box and It’s possible to get fourteen out of three 8 foot boards. Dimensions are:

  • Height: Full stock width 2 1/2″
  • Front width: 2 7/8″
  • Side length: 8 1/2″
  • Top and bottom lid width: Full stock width 2 1/2″
  • Top and bottom lid length: 8 1/8″

These dimensions were calculated to fit using 5/16″x2 1/2″ stock. See this paper for details.

The main tool is a table saw with a 3/32″ thin kerf blade to cut out the parts, and a standard 1/8″ thick blade to make the top and bottom grooves.  I resaw the 3/4″ thick boards with the thin blade. You could of course use a band saw but I don’t have one. Finally a lunch box planer cleans and thicknesses the resulting 5/16 stock.

You also need a miter gauge, or better (and safer) a crosscut sled, equipped with a flip down stop like this Rockler part. I made a stop from two pieces of hardwood scrap, two quarter inch bolts, and a makeshift T track.

I carefully adjust the fence to 90 degrees from the bar using an engineers square to satisfy the first rule above.


This is the dedicated crosscut sled I fabricated. A piece of half inch MDF core plywood and two pieces of leftover oak flooring. Did not take long to make, the critical things are the rear fence has to be flat and exactly perpendicular to the saw kerf. I used 3/4 inch pine for the two runners. The sled is now the only thing I’m using to cut the box miters. It is much easier to control than the extended saw gauge. I use the saw mitre gauge only for the vertical lid cuts.


This is a closer view of the flip stop. Placing the board against the rigid stop satisfies the second condition above.


And this is with the stop flipped up.


You also need a spacer block so you don’t have to reposition the flip stop to cut the shorter end pieces after cutting a longer side piece. The length of the spacer block is the difference between the long side and the shorter end pieces, 5 5/8″.


Because it takes time to set up each operation, every piece of stock is handled in parallel. In other words, if you are making 14 boxes from three 1″x3″x8′ boards, do step 1 on all boards before moving to step 2, do step 2 on all pieces before setting up step 3, etc.

  1. all the 3/4″ boards are crosscut according to the cutlist
  2. all the boards are resawn to half thickness
  3. all boards planed to 5/16″
  4. cut four mitered sides for every box
  5. cut top and bottom plates for every box
  6. cut grooves in each side to receive top and bottom
  7. rabbit edges of each top and bottom plate
  8. slice the half inch handle portion off the front piece

At that point you should be ready for glue.

Here is  a cut list for the project, also available as a PDF. It’s easier to resaw the 3/4″ stock if it is cut into shorter lengths.

Note: Drawings and files can be downloaded from Dropbox.


I do the resaw in three passes, raising the blade about a half inch each time, ripping both top and bottom edges. I first check the blade for exact squareness using a Wixey digital angle gauge and set up a feather board. If my saw had a bigger motor I could do this in fewer passes.

I always try to move my lunchbox planer to the driveway when thicknessing stock so I can clean up the mess with a leaf blower.  Since these boxes are destined to be unfinished gifts for small children, it’s not necessary to do a perfect planing job but any snipe or defective spots should be marked to go to the inside surface. Actually, in this cold weather, I have been planing most of the resawn boards with hand planes. It goes quickly and warms me up.

Once the 5/16″ stock is ready, the first step is to mitre one end. The saw blade is tilted to 45 degrees measured with my digital Wixey (love that thing) to satisfy the third condition above, and raised through an aluminum insert for zero clearance.  Note this is a left tilt saw.

Stock is positioned on the right side and aligned using the tilted fence kerf to cut the first bevel. The stop is lowered and adjusted for this set of boxes so the outside measurement to the blade is 8 1/2″.


Move the stock to the left side and make the second cut by holding it against the lowered flip stop. This completes the first long side.


Raise the stop, return the stock to the right side, and make a new initial bevel as before. The cutlist measurements are tight so it’s necessary to cut exactly on the previous bevel line.

For the second cut the spacer block is placed against the flip stop to create a 2 7/8″ end piece.


Repeat the above two operations to create another long side and another short end piece.  Cutting out the four sides of a box takes only a couple of minutes once the initial setup is done.


Cutting box sides sequentially from a single board lets the wood grain wrap around three of the four corners, a nice touch. To make that possible, the box has to be ultimately glued up in the same order as it was cut.  Turn the pieces in order bevel side up and mark each beveled edge with it’s mate. If you make marks on the bevel near the center, they won’t show when the box is assembled.  Use a dark Sharpie so you can see the dots through a layer of glue, (but not too dark, I found sometimes the Sharpie bleeds through to the outside face). In this photo, see a one dot corner and a two dot corner for box #5. Note how the grain flows through the three pieces.


Care in squaring the fence, setting the blade angle, and using a solid flip stop is rewarded with perfectly closed corner joints.


Finish the six box components by cutting out two plates for the top and bottom. Return the thin kerf blade to vertical, adjust the stop for an 8 1/8″ cut and make two pieces. That little bit is all that’s left over from one of the 40 inch boards.


Here are four box kits ready for grooving.


Next, set up the table saw to do eighth inch deep grooves at the top and bottom of each side piece. The same setup can be used to make eighth inch rabbits around the top and bottom plates.  I use a 1/8″ brass setup bar to help set the saw to just over 1/8″ height and spaced 1/8″ from the fence. The blade in the photo is one side of a Freud dado stack. It makes a clean cut and has the correct width.


Roy’s video shows cutting the groove before slicing off the beveled side pieces. With the table saw it’s easier to do this after the sides are cut out.

Here I am grooving a long side using a push block.


Grooving the short side. Have to be extra careful where you put your fingers.


Now all four sides of each top and bottom plate get rabbited. You need an eighth inch tongue on each edge that makes a sliding fit in the groove around the box sides. It may take some fine adjusting of the spacing between saw fence and blade to get the fit just right. The plate should slide easily in the groove but not rattle around.

Hold the pieces vertically, pushing them across the saw blade. Cutting the tongue with a single eighth inch blade leaves a thin sliver of material on the inside edge of the top and bottom pieces. You can eliminate that by adding a second Dado blade on the saw arbor to make a kerf wide enough to remove all the wood.  Or just break off the sliver.

Here I have added a tall fence to help guide the lid plates, and I’m using a push block for the end grain cuts. Even with the push block, the piece tends to wobble and cut unevenly, so I usually make two passes to make sure the rabbit is full depth. It’s best to do the short edges first, then the long edges.


Rabbiting the long side is straight forward. Again, fingers are close to the blade so extra care is needed.


The final milling step is to mark and slice one of the ends off a half inch down. I do this in an old fashioned wooden miter box with a saw that makes a fairly thin kerf. Pick the end that has the grain wrapping around both sides, this should be the end piece with one dot and two dots. You can clamp a stop block inside the miter box to speed things up if there are many boxes to cut.


Here is a completed set of pencil box components.


Finally the glue up which takes more time than cutting out the parts. Use a long open time adhesive like Liquid Hide Glue or Titebond III. I apply with an acid brush that has half it’s bristles clipped off to make it stiffer.

Here’s all my gluing tools. Bottle cap to hold a puddle of Titebond or LHG, wood stick wrapped with damp towel to clean grooves, cut down acid brush, burnisher to close corners, thin snap knife to cut lid handle free if it’s gotten stuck from squeeze out. The tools are sitting in a two sided tray I use to hold the box while assembling the parts.


Roy says to rubber band the parts so I made Red Neck glue clamps from something I have a lot of, punctured bicycle inner tubes.  Just slit a length of tube top and bottom. They will stretch about 25% so make the slit an inch or so shorter than the box. It helps if you use the two sided tray to corral the box parts while you’re stretching the rubber over the outside.

A 45 degree miter will be half end grain. To get good adhesion, I paint glue on the bevels in two stages,  I give each a first coat to fill the wood pores, then after a minute, another coat to do the joining.  Try not to get glue in the corners of the eighth inch grooves, it will stick the lid plates in place and you don’t want that. Make a groove cleaning tool by folding a damp paper shop towel around the end of a putty knife. Do NOT apply glue to the bevel area at the box front where the half inch handle will go.

Put the box together by inserting the top and bottom plates in the two long side pieces first (watching those Sharpie dots), then press on the end pieces. The half inch handle is not glued at this time but do put it in place to help shape the rest of the box.  Apply two Red Neck rubber band clamps, then fuss the side corners to get good miter alignment.  Also check that the miter joints are aligned vertically so the top and bottom edges are all in the same plane.  It doesn’t take much of a vertical mis alignment to make the sliding lid hard to seat. Finally check with a small square to see if the corners are 90 degrees.

Allow a few minutes for the glue to take hold, then pull the half inch handle off.  Slide the top plate out. If it won’t budge, you have squeeze out on the back corners. Get a pair of pliers and wiggle the lid until it lets go. Now apply glue to the end of the lid that will receive the handle. Press the handle on to the end of the top plate, centering it on the plate and clean up any squeeze out on the bevels.  Place one or two thicknesses of paper towel in the groove at the rear of the box top. This will force the lid plate into the handle groove. Push plate and handle back into the box against the paper towel, making sure the handle seats properly against the box sides. Slide the rubber band up over the handle.


Remove the Red Neck clamps the next morning, sand off any glue squeeze out, and lightly break sharp corners and edges with fine sandpaper. If there are any gaps in the miters, you may be able to close them by burnishing the two edges. The lid should slide smoothly. If it doesn’t, tune with sandpaper or a shoulder plane. For extra credit, plane the top and bottom edges flat. I use a 5 1//4 for this, the bed is long enough to use the opposite side of the box as a reference surface.


This has been a very satisfying project. Thanks to Roy Underhill for the inspiration. Here is the first crop in Poplar and Pine from Menards cut off bin.


Update 12/26/16

I had a few of the lids stick hard due to squeeze out in the back corners. Had to pull them out with pliers which runs the risk of damaging the wood. Now I’m nipping about 1/3 of each corner off with a chisel which gives squeeze out a place to go. I don’t nip the front corners of the top lid where it will be fitted to the handle piece.


Update 2/1/17
I typed up the page of arithmetic for sizing the box parts. Also made a spread sheet to do the calculations. All this and more is in this zip archive.

Update 2/11/2017
Trying an alternate design. These 4″ x 4″ x 4″ cubes are each made from a 24 inch piece of 4″ by 5/16″ stock which was ripped and resawn from a 1×10. Since the sides are square, I don’t need a spacer. Also learning more about Titebond Liquid Hide Glue, you do need to paint on two coats or the joint will be weak. And I’ve found that a small amount of warp is tolerable, because cutting the stock into short pieces means the warp in each piece is small. Warp can complicate resawing though, and if the board is cupped, you will have trouble with the glueup. A cupped board will not allow an accurate miter unless it’s forced down flat on the crosscut sled.

I made these 12 in one afternoon, glueups were done the following morning in the house where it’s warmer. I cut up my last bicycle inner tube to make shorter redneck clamps, using a paper punch to make a hole at the ends of each slit which should reduce strain at that point.



Update 2/20/2017

Revised some photos and text to emphasize use of a crosscut sled. It really does work better.

Update 4/3/2017

Nineteen pencil box sized “kits”. This batch was made from steeply discounted lumber and will bring my count to 110 boxes. I think that’s enough, I’m running out of places to put them.When I go through the production process I line up all the box parts on the bench to keep them together. After the last operation each is rubber banded into a package ready for glue. It’s still too cold to work liquid hide glue in my garage so these will be finished in the house.


And here are the 19 pencil boxes assembled, sanded and ready to go.


Also built several mongrels out of scrap. Making a box from bits of different boards has it’s own set of problems. I’m keeping these two and applying three coats of Watco oil.


Update 5/13/2017

I can’t stop making these things. Over 130 now. This batch is mostly mongrels, made from scraps but the four cubes on the right came from a single 24 inch 1×10 from Menards’ cut-off pile. The board was was $1.75 so less than 50 cents per box.  Two Cherry cubes on the right have a center divider, both lids slide open. I’m keeping and finishing that nice grained Yellow Pine bottom center, and some of the Cherry boxes.


Update 11/18/2017

I’m presenting my methods to the Dupage County Woodworkers Club next week and since I can’t fit a table saw into my car, have created a slide show.

It is downloadable from dropbox at https://www.dropbox.com/s/c67c4xhlw3bata7/SlidingLidBoxes.zip

The miter sled is upgraded to a real TTrack and there is a different setup for making the grooves. The calculations are now done with a spreadsheet.