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.

DISCLAIMER: 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:

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.

Update 05/17/2018

The spring 2018 episode 35 video from Highland Woodworking, about 22 minutes in, shows Doug Stowe creating mitered corner boxes using a crosscut sled and spacer block in a manner similar to mine. His method does not require a flip stop though.

Frame and Panel Construction – Part 1: The Panel

These WordPress pages document my method of constructing a frame and raised panel door. I need to make a pair of these about 30″ x 18″ each to replace an ugly entrance to the crawl space in my home. Each door will be a single solid Pine panel, the frame will be about 2 inches wide with molding on the inside edge.

One episode of “The Woodwright’s Shop” contributed to my panel raising techniques. “Raising Panel-Zona” describes several methods, though my tools don’t match Roy’s.

I have a small panel raising plane. It is unusual in that it has an adjustable fence, there is no nicker and no flat area near the fence, the cut is beveled all the way to the edge of the work. It may have had some other use in the past but it works for panel raising. I have since added brass strips at the main wear points.

Making a cabinet door usually proceeds by constructing the outside frame to fit the target opening, then creating a panel to fit the frame. I have a number of frames made as practice exercises for a real job closing off the crawl space in my house. These were all based on square blanks cut from a length of 1×8 select pine from Home Depot. I used up all the spare lumber so for this weblog post I glued up some scraps and trimmed to 7 1/4 square.

Panel blank glued up and trimmed to size

The panel will have a quarter inch tenon all around the edges that seats inside a groove plowed around the inside edges of the frame. The first step is to define this tenon edge by measuring the frame face to groove distance so the panel  will be flush with the frame. Subsequent operations will remove wood down to these lines. I darken the marked lines with pencil.

Mark the tenon edges on the panel blank

The panel raising plane fence has been set to an “about here looks right” distance from the cutter tip. I’m measuring this horizontal distance carefully, maintaining the angle of the bevel.

Measuring horizontal length of the bevel cut

I will be defining the inside line of the raised area using a cutting gauge. This is necessary, especially on the cross grain sides because the plane does not have a nicker. Here I transfer the measurement from the previous step to the gauge.

Transfer bevel dimension to cutting gauge

Cut the gauge lines deeply into all four sides of the panel blank.

Cutting bevel extent lines

Here I have darkened the lines with pencil.

Bevel lines darkened

One hand tool principle I have learned well is to remove as much material as you can with the blade that is easiest to sharpen. I block plane off wood down to about 1/16 inch from my two lines.

Removing waste wood

Now the panel raising plane does it’s work, starting with the cross grain edges. This plane works well across the grain because it has a steeply skewed blade. Which also means it is hard to sharpen.

Using the panel raising plane

Raising the center creates a shadow line which makes the panel look a bit smaller and lighter.

Panel showing shadow line

The final step is rabbiting the back of the panel to the line. This M-F 85 has the fence set to cut a quarter inch wide relief and the depth stop set to stop at my line. Since the raised portion of the panel is angled, the edge tenon is tapered so I will make this a little less than a quarter inch thick to make it easier to fit the frame groove.

Rabbiting the back side

The finished panel came out fairly well though I had trouble with the panel raising plane. I believe the blade is not bedding flat inside the body which causes the blade to flex slightly and chatter. The wedge also loosens too easily which causes the blade to fall out. I’m working on it.

Finished panel

And it does fit the frame. See how all those shadow lines make the panel look like something other than a flat board.

Finished panel fitted in frame

Frame and Panel Construction – Part 2: The Frame

These two WordPress pages document my method of constructing a frame and raised panel door. I need to make a pair of these about 30″ x 18″ to replace an ugly entrance to the crawl space in my home. Each door will be a single solid Pine panel, the frame will be about 2 inches wide with an Ovolo molding on the inside edge. An Ovolo is a quarter round with a small step. It creates a shadow line around the inside of the frame which softens the edge visually.

Completed practice panel

Another goal is to, as much as possible, use only hand tools in the project. A few years ago I acquired a small panel raising plane at an estate sale and it’s time to put it to work. This photo shows some of the tools used in creating a frame.

Hand tools used in frame construction

Three episodes of “The Woodwright’s Shop” contributed to my techniques.
Raising Panel-Zona” describes several methods of making a raised panel.
Painless Panel Doors” where Roy constructs a mortise and tenon frame.
Simple Sash Restoration” shows how to join a frame with molding around the inside.

To understand and practice the procedure I’ve made several small framed raised panels. These will find their way into a box or maybe a lamp sometime in the future. This procedure builds a frame to house a pre-constructed panel though usually the frame will be built first, made to fit an existing opening, then a panel constructed to fit.

This, the second page of my frame and panel series describes the frame construction.  It turns out that making the frame, with a molded inside edge, is harder than building the raised panel.

My practice raised panels were cut from 1×8 pine, resulting in a 7 1/4″ square panel. The frame begins with two 10 3/4″ rails and two 11″ stiles cut from a pine 1×4 ripped down the middle.The stiles are longer than needed to make them more likely to survive the mortise chisel.

The raised panels have a centerline mark so the first step is to mark a centerline as an alignment reference on the frame pieces.

Center line used as reference

The stiles and rails are inspected. the best sides marked as face, and a position in the frame picked and marked.

Two stiles, two rails with face sides marked

The panel with grain vertical, and both rails are turned bottom up and aligned with the center marks. Four tenon shoulders must be located on the rails. These are aligned with the inside edge of the panel back rabbit but an allowance should be made for the panel expanding across the grain in humid conditions. I use a thick steel ruler as a spacer which results in about 1/32 inch extra. The 12 inch ruler is flexible and bent down so it butts up tight against the rabbit. Both left and right side tenon shoulders are marked on the rails. They are knifed later.

Marking for rail shoulders

On the face side, the tenon shoulder is a quarter inch farther out to allow for coping the molded edge. Here the back side line has been extended up the rails side and I used a 1/4″ brass spacer to locate the face side shoulder.

Quarter inch spacer defining face shoulder

This shows the offset shoulder laid out. The face and rear shoulder lines will be knifed to help with accurate sawing, the short side lines are not knifed.

Rail tenon offset to allow coping

My practice raised panels varied a bit in depth so here I am checking the distance between panel top surface and the bottom of the rear rabbit. Ideally the distance between the top surface of the panel and the bottom of the rear rabbit groove will be 9/16″ which will allow 1/4″ panel raise, 1/4″ panel edge thickness, and 1/16″ for the Ovolo molding.

Measure for tenon depth

Set the mortise gauge outside pin to exactly the depth measured above.  The separation between the two pins is set to exactly the width of my quarter inch mortise chisel.

Set bottom pin of tenon gauge

Tenons are marked with the mortise gauge then penciled in lightly. Note here the face side line is scratched shorter that the rear side because of the offset shoulder.

Tenons outlined with pencil

Now to cut the tenon cheeks. As Roy shows, part from one side, part from the other, then clamp the rail vertical and saw down to the shoulder line.

Sawing tenon shoulders

Before the tenon shoulders are cut free, a groove to receive the panel is cut with a plow plane. The depth stop is set for 5/16″ a little deeper than the panel rabbit, we don’t want it to bottom out. he plane fence is carefully adjusted so the groove runs right down the center of the tenon.

Plowing the rail groove

Once the groove is done it’s checked for depth with vernier calipers. A dry fit of the raised panel confirms the groove.

Panel dry fit in freshly cut groove

Next the tenon shoulders are cut off. A bench hook supports the rail while sawing.

Removing tenon shoulders

The frame groove defines the inside extent of the tenon but the outside is marked 3/8″ in from the edge. The cut will not go all the way to the offset tenon shoulder, it stops about 1/8 inch from the shoulder to create a haunch. The haunch fills excess space in the stile groove and it will be trimmed later to fit exactly.

Gauge outside tenon edge

I’m using a fine tooth dovetail saw to cut the outside of the tenon. It is important that the inside and outside edges be parallel but precise width is not critical. Saw in at the haunch then cut vertically on the line.

Sawing outside tenon edge

With the outside wood removed, these start to look like real tenons.  In this photo you can see the offset top shoulder and the short haunch left.

Sawn tenons with haunch stub

Nobody’s perfect and my tenon sawing technique needs a lot more practice. In the meantime I made a jig so I could true up the sawn surfaces with a router plane. I cleaned each face until the tenons measured exactly 1/4″ with my calipers. This also ensures that all four tenons are the same depth from the rail faces. The jig is just two pieces of 3/4″ MDF clamped to the table top with a machine screw. They support the router plane while it’s doing it’s thing.

Tuning tenons

Now the completed tenon outlines have to be transferred to the rails to define the matching mortises. I dry fit the grooved rails to the panel and lay that assembly on the rails. Everything is rear side up in this photo and the rails are aligned with the panel using the center line marks.

Dry fit to locate mortises

The tenons lay flat on the blank rails making it easy to mark where the mortise edges will go.

Transferring tenon edges to rail

Here you can see both tenon edges are traced on to the rails.

Tenon edges traced onto rails

I use an engineering square to bring the marked mortise edge lines around to the sides of the stiles. Then the mortise gauge defines the sides.

Gaugeing mortise sides

Pencil in the gauge lines and the stiles are ready for the mortise chisel.

Marked mortise locations

My mortise chopping technique is straight from Roy’s video. Chop from the far end to near going deeper with each eighth inch increment, reverse the chisel and chop back near end to far. Straighten the edges and in this soft pine you will be half way through. Turn the stile over and repeat, chopping all the way through.

Chopping one side of a mortise

I

I use an engineers square to check for true inside edges. Trim with the mortise chisel if not.

Checking straightness of mortise edges

Once the mortises are cut and dry fit successfully, I plow a groove in the stile. If all measurements were good, the groove will go through the center of both mortises.

Plowing a groove in a stile

This is a face side dry fit of all four joints. It’s looking like a real frame now. If the tenon shoulders were carefully cut, it will be square.

Dry fit to check squareness

Molding the inside edges starts with cutting a thin rabbit on the inside edge. I use a Miller Falls 85 for this with the fence set to a quarter inch width and the depth stop is set to 1/16″. This should leave a quarter inch square shoulder on the inside which will be rounded over.

Planing board set up to rebate

It took about a dozen strokes with the rabbit plane to make the 1/16 inch step.

Rabbit plane defining Ovolo

In this photo you can see the shadow line created by the small rabbit.

Small rebate defines Ovolo

To begin the Ovolo round over, I chamfer the edge with a block plane. This makes it easier for the molding plane as much of the wood is already removed. It’s a woodworking principle to always use the tool with an easily sharpened blade first.

Roughing in the Ovolo shape

I have this small hollow plane, it has a 5/16 cutter. The round edge is smaller so it takes some fussing and finally a few swipes with sandpaper to get the curve correct.

Hollow plane smoothing Ovolo molding

When all four pieces are molded, the frame is dry fitted and the edge of the rails Ovolo step carefully transferred to the stile.  I also transfer the outside edge of the rail to the stile but since the end (horn) of the stile will ultimately be cut off, that’s not really necessary. The molded edge between the two marks is removed.

Marking stile molding for removal

I carefully chisel out the molding of the stile between the marks. The rail’s longer tenon shoulder will fit into this recess.

Removing stile molding

The next step is to cope the rounded molding on the rail. It will fit over the stile molding and give the illusion of a 45 degree miter. This procedure is right out of “Simple Sash Restoration” and begins by using a template to precisely miter the corner of the rail molding.

Trimming rail molding with miter template

A close up of the mitered rail molding.

Mitered rail molding

Now the mitered bit is coped. a small scribing gouge is used to remove the wood visible when you look straight down at the miter. This gouge is a little too big for this job but it’s all I have.

Coping the rail molding

This photo shows the coped corner.

Close up of coped Ovolo

The coped joint is dry fit and trimmed to fit closely. Trimming might require fine tuning the cope, planing one of the tenon shoulders, and trimming the haunch. Sometimes it helps to undercut the shoulders a bit. If the shoulders were planed, check the assembly for square afterwards.

Dry fit coped Ovolo

Success is a dry fit of all four joints with no gaps.

Dry fit all four pieces

With the panel inserted you can see what the final product will look like. Since the whole reason for separate frame and panel construction is to allow the panel to move a bit, the panel must be finished before the assembly is glued up. Finishing the glued up frame would be easier but would risk an unfinished line appearing at the panel’s long grain edges in dry weather.

Panel inserted – front

The back side doesn’t show anyway but the rear of the assembled frame and panel should be flat if everything was done correctly. The protruding horns on the stiles and tenon stubs will be sawn off and planed smooth after the final glue up.

Panel inserted – rear

Frame and Panel Construction – Part 3: The Real Thing

Parts one and two of this series showed construction of a small frame and panel assembly. I made a half dozen of those as learning exercises for the final project, rebuilding the entrance to the crawl space in my tri-level home. This may be way over engineered but the old doors are truly ugly, made from thin paneling covered with contact paper, and besides, I wanted to learn how to make raised panels with hand tools.

Most of the techniques I used came from the Woodwright’s Shop episodes mentioned in part 2, this part 3 will document differences needed to complete the larger scale crawl space entrance.

I built a new outer frame from 2 inch pine to fit the existing opening.  I have to admit not using hand tools for that as I recently acquired a Kreg K2 jig and wanted to try it out. Also the rails on a butt jointed frame would be four inches shorter than a mitered corner frame which worked out much better with the 72″ stock I had.

Pencil study for cut list

The outside dimension of the doors is determined by the inside edges of the outer frame so I propped up the outer frame and centered the stile pieces leaving about 1/16″ gap at the sides.

Outer frame with door stiles

Each pair of stiles was checked for parallel with pinch rods. Everything came out OK with very little tweaking. Stiles were marked top and bottom where they touched the outer frame.  Then I centered the rail blanks on the stiles and marked where they touched the rails left and right. Those four lines define the dimensions of the doors.

Checking stiles for parallel

Here you can see tenons laid out on the four rails. These were sawn, tuned, and outlines transfered to the stiles as in part 2. Mortising the stiles, then grooving and molding the inside of each piece proceeded as in part 2.

All four rails with tenons laid out

I glued up two panels a couple months ago but had to square them for fitting in the frames. Could not hold the panel steady against the miter gauge so I built a miter gauge helper from a piece of heavy aluminum angle and a toggle clamp, should have done that years ago. The panel surfaces were planed with a Stanley 4 1/2.

Straighten and square the panels

Each completed door frame was laid over the square glued up stock. I aligned left and bottom panel edges with the inside of the frame, marked the top and right edges of the inside opening on the panel stock, then ruled a line one half inch farther out on the top and right. This allows room for a 1/4″ tenon all around the finished panel. I then trimmed the panel top to my ruled line on the table saw using the miter gauge as in the previous photo.

Next, the panels had to be trimmed to width. They are too tall to use the miter gauge, so I got out my standard homemade saw fence, a four inch oak timber. I used the line on the cut off top piece to adjust the fence to the proper width.

Setting fence to rip long side of panel

A deep breath moment.  I had been putting off cutting these panels to exact size because I was afraid of screwing up the measurements. In the end, they fit well.

Panel ripped to final width

As in part 1, I struck a line with a cutting gauge to define the panel step, then removed wood with a block plane to 1/16″ of the line.  Raising the panel actually means lowering the edge. It depends on your point of view. In this photo, the cross grain ends have been lowered and I’m ready to work the long grain edges.

Roughed in panel bevel

The panel raising plane lowered the bevel to the edge line and created the top step as in part 1. This took a while as the panel raising plane was acting up and I took time to tune it. I believe the bed under the blade is not flat so the blade doesn’t fit properly.

Completed raising of both panels

There were a LOT more shavings than in part 1. Working the two panels took most of an afternoon.

Shavings from panel raising

The last operation on the panels is creating a rabbit all the way around the rear side. Always cut the cross grain ends first then the long sides. Knifing the cut line with the gauge is mandatory on the ends, the spur on this MF 85 sticks out way too far. I also used a sharp knife to relieve the wood at the left end of the rabbit before planing to reduce tearout there. There was a small amount of fuzz which I cleaned up with the wooden shoulder plane.

I had more trouble with the sides than the ends, the grain was not with me. Home Depot pine does not have a strong grain pattern and it’s hard to see how it’s running. Waxing the plane about every fifth stroke helped.

Rabbit the back side of panels

Checking the tongue for fit in one of the rail piece grooves. I want a good fit to keep the panel from rattling around if it shrinks. I found a web site that calculates wood movement, these 14 inch wide panels could move with humidity variations as much as an eighth of an inch.

Test fit of panel with one of the rails

Finally, the completed panels fit with very little tuning. I sawed off the frame horns and am happy with the results. This photo shows the back side of the assembled doors.

Rear view of panels assembled into frames

And this is the raised panel side.

Front side of assembled doors

The sawn off horns were rough so I converted my workbench and planing fixture into a shooting board.

Shooting a top edge

Checking the frame and panel doors for fit in the frame is awkward as I don’t have an area in the garage that I trust to be flat. I had to trim 1/16″ from the left bottom, the rest fit well. There will be a final tweaking after the hinges are installed, and a final-final tweak after the glue up, and a final-final-final after it’s nailed onto the crawl space.

Checking the doors for fit

Hinge position is somewhat arbitrary. I used the bottom of the panel field as a reference. A steel ruler is held against the raised line and the outer frame marked. This sets the outer edge of the hinge gain.

Marking hinge position on outer frame

Laying the hinge on the marked frame defines the inside of the hinge pocket. Both marks were squared across the inside with a knife and deepened with a chisel. I chiseled every quarter inch along the area to be removed then used a Stanley 71 to remove wood. Clamping boards to the sides gives the router plane has something to sit on.  A Stanley 71 1/2 that doesn’t have the wide gap at the front would work better for this.

The hinge plate measured .060″, I cut the pockets to about .080″deep to narrow the gap between door and outer frame.

Routing a pocket for the hinge

I use a small Vix bit to establish the hinge screw position then pilot each hole with a 1/16″ drill so the screw doesn’t wander in this soft pine grain.

All four hinge gains were cut in the outer frame, hinges screwed in, then the doors were re-inserted and marked where the hinges touched. Those marks were knifed square across the outer stiles and incised with a chisel.

Preparing to seat a door hinge

I was able to clamp my router support fixture on the doors. It forms a reference surface for the router plane and also furnishes a square outer edge to locate the hinge.

Router support fixture

Here the hinges are seated and the doors dry fitted back in the outer frame.  The doors closed OK with a small amount of planing on the inside vertical edge. There will be a final fitting after the door frames are finished and glued up.

Completed frame with doors dry fitted

Tenon cheek cutoffs are perfect for trying out different finishes and I have 16 of them. I made several samples using Minwax Jacobean, Dark Walnut, and English Chestnut stains plus a few samples with various mixtures. I also experimented with Minwax Pre-Stain Conditioner which produced much more even results. Most of the wood in the house near the crawl space entrance is very dark and I thought the Jacobean would be the best match, but the wife overruled and picked the English Chestnut sample which is much warmer.

The doors were removed and completely disassembled for staining. A raised panel can not be finished in place because if it shrinks, an unfinished area would appear at the edge. So at least the stain has to go on with the panels outside the frames.  I did separately the door frames, then the panels, then the outer frame as I did not want to let the stain set too long without wiping off. The Chestnut stain did not color evenly though the conditioner did help. This photo shows the two door frames, one of the panels and the outer frame.

Stained doors

With every frame piece stained and both panels stained all the way to their edges, it was finally time to glue up the doors. I dry fitted the everything together again, reattaching the doors to the outer frame with the four hinges for a final fitting.  I noticed the hinge screws were loosening up after being removed three or four times so following a tip in a recent magazine, I drizzled super glue into the screw holes. It seems to help quite a bit.

I propped one door open, removed the center stile, pulled out one rail at a time, applied liquid hide glue to the hinge side tenon and plugged the rail back into the hinged stile. Because I did one rail at a time, the panel could remain in place. Both rails then got the inside tenon buttered with LHG, and the inside stile installed.

Since the doors were still hinged to the outer frame I could check for racking before the glue set up. I clamped the doors in the outer frame, using thin wedge shims inserted under the hinges to even the pressure.  After 2 hours for the glue setting, I did the second door the same way.

Clamping the glued up mortise and tenon joints

The next day, I removed the doors yet again and took the outer frame to the crawl space for a fitting around the opening. A little dry wall trimming was all that was necessary. Minwax semi-gloss poly was next, two coats applied to each door and to the outer frame.

Panel with Poly applied

Check out the shadow lines in this photo.

Detail showing frame molding

There were a bunch of cutoffs from ripping original stock down to two inches. I planed, stained, and varnished some of them.  These will form a lip around the inside of the crawl space opening. One of the original specifications was that the doors be insect proof.

Cutoffs to be used as seals

Finally it was time to install the frame and assemble the doors.  There are only four 8d finishing nails, one at each hinge, holding the frame on in this photo. I may put more nails in the top and bottom rails after the wood acclimates but for now the doors close without rubbing anywhere. One of the finished strips was screwed to the inside edge of the left door with a quarter inch protrusion, so the right door holds the left door closed and theres no visible gap. The old doors had two magnetic catches, I reused one at the bottom of the right door.

Installed!

This is what it used to look like.

Crawl space entrance Before

This has been a four month long project with much of the time spent learning how to use hand tools to create the raised panels. I couldn’t have begun without inspiration and education from Roy Underhill. Three episodes of “The Woodwright’s Shop” contributed to the project.
Raising Panel-Zona” describes several methods of making a raised panel.
Painless Panel Doors” where Roy constructs a mortise and tenon frame.
Simple Sash Restoration” shows how to join a frame with molding around the inside.

How To Sharpen A Router Plane Blade

If you don’t know what a router plane is, you probably don’t need one.

I have a couple of Stanley 71 router planes. The cutters are difficult to sharpen because the bevel is blocked by the shaft that connects the foot with the plane. Last weekend, at a Midwest Tool Collectors show, I acquired a Stanley 271 which is similar to the 71 but only about a third of the size.

Stanley 71, Stanley 271 Family photo

The small cutter in the 271 is even more difficult to sharpen that a 71 blade and this one had significant rust pitting to grind out.

271 cutter, 71 cutter

The foot (business end) bottom side of these cutters is flat and ground at an angle to the plane base to provide a relief area behind the cutting edge. Flat surfaces can be ground and polished on stones in the conventional manner, I have a coarse diamond plate and with sufficient elbow grease was able to flatten and remove all rust pitting on the bottom of the 271 cutter. That little guy is hard steel!

But the bevel did not yield as easily. An internet search showed people holding the cutters upside down with the bevel on the edge of a stone. I could not hold the small cutter at a consistent angle and I was rounding over the bevel, a no-no on a plane blade. So I did what any red blooded woodworker would do. I took a nap. When I woke up I had an idea. I have a saw sharpening jig that combines a saw vise with a flat reference plate which stabilizes the triangular file. If I could create a similar reference plate parallel to the router plane blade bevel, I could use that to guide a diamond file. And this method would work just as well on a Stanley 71 cutter.

In the junk pile I found a bit of aluminum bent at a 90 degree angle. It probably was a rack spacer in a previous life. This would do as a reference.

Aluminum angle to be used as reference plate

Sandwiching the cutter between the machinists vise jaw and the reference surface was easy. I propped up the back end of the reference plate with wood blocks.

Cutter clamped in vise against the reference surface

Now to align the surface of the bevel to the reference surface. The bevel angle on the cutter is thirty degrees. To that must be added the six degrees of the flat bottom relief angle. So the bevel is thirty six degrees from the shaft axis. I marked a 36 degree line on a plastic template and eyeballed the shaft angle.

Aligning the cutter shaft at 36 degrees

Next, the height of the bevel above the reference surface has to be set. I am using a ruler to support the far end of the diamond file so the bevel surface must be exactly one ruler thickness above the reference.

Positioning the bevel in the jig

After fussing back and forth checking the shaft angle and the bevel face altitude several times, I was ready to grind. A drop of oil went on the reference plate so the ruler would slide easily. Then hold the ruler with two fingers and press the diamond paddle tight to the ruler with another finger then slide the whole thing down the surface and back. It was easier than it sounds. I actually started with a much coarser diamond file just to get the bevel initially flat and rust free.

Filing the bevel with a diamond paddle

This photo shows how raising the cutter bevel to the proper height makes the paddle parallel to the reference surface.

The diamond paddle is parallel to the reference surface

Did not take long at all to get through the four diamond grits I have available and now a nice even shine on the cutter bevel. No more dubbed over.

Shiny flat bevel

I touched up the flat bottom of the cutter to polish and remove any burr.

Touching up the flat side

And it works! Many times I could have used one of these little routers and now I own one. Thanks MWTCA.

It Works

Third Generation:

Arduino Iambic Keyer – Top

Arduino Iambic Keyer – Left Side

Arduino Iambic Keyer – Right side

In a Chicago winter it’s way too cold in the garage for woodworking, so I turn to coding to pass the time. In 2014 I built an ATTINY85 Morse Code keyer in an Altoids Small box and in 2015 I expanded that with an Arduino Pro Mini based keyer in a regular Altoids tin. It was a lot of fun and consumed pretty much the whole winter. I’ve written down a few ideas for enhancements and in this year’s model some of those are implemented. The hardware wish list (so far):

1. Battery power, enabling stand alone operation > 24 hours
2. LCD display 16×2 minimum
3. Real Time Clock, Local and GMT
4. More memories (7 or 8 buttons)

Batteries and LCD won’t fit in an Altoids tin. I found a metal Crayola box at Tuesday Morning. It was made by the Tin Box Company, who produce many designs that would make interesting project enclosures. It is 3″ x 5″ x 1.5″, about three times the volume of an Altoids box, the metal is slightly sturdier than Altoids but still flimsy enough to be difficult to work without distortion. I found the inside surface was coated with a thin layer of something which repelled solder unless sanded a bit first. I don’t see this particular box available any more but there is a slightly larger version. My experience indicates that the time to complete a project is inversely proportional to the size of the enclosure (maybe to the fourth power).

Unmodified Crayola Box

These days “Arduinos” come in many shapes and varieties. The latest official 1.6.7 IDE is almost 100 megabytes, expanded to accommodate different versions.  I wanted to try processors other than the standard ATMEGA328, so last summer bought a Teensy2.0 (32u4) and a TeensyLC (ARM Cortex M0) made by PJRC. Both promise built in USB client support. The PJ in PJRC is Paul Stoffregan, who has contributed a great deal to the Arduino community. There’s an IDE add-on “Teensyduino” that must be downloaded from the PJRC site to use Teensy boards. Teensyduino installation is dead simple and includes Teensy versions of most familiar Arduino libraries plus a few useful additions from Paul.

Last summer I worked with the Teensy2.0 a bit, wanted to see if the DDS sine wave generation function I used in the 2015 design would work. The port was successful, the 32u4 required only a few minor tweaks, and I even got Fast PWM working as described in Atmel’s documentation. PJRC has a forum where you can brag about your accomplishments so I wrote something on the 32u4 DDS sketch thinking it might be useful to others. Paul Stoffregan replied suggesting I consider a Teensy3.2 as it has an integrated Digital-Analog Converter which would produce a cleaner waveform. I fired up the similar TeensyLC and used Paul’s suggested method. DDS on the TeensyLC was also successful so I built a breadboard version of last years keyer using the LC.  Everything worked with PJRC’s libraries including DDS side tone, the PS2 keyboard, and lcd.prints added for the display.

The small module at the upper left of the breadboard is an Adafruit PAM8302 audio amplifier. Last year I struggled with a 1 transistor class A amp for the speaker, gave up on that and built an LM386 design. The PAM8302 amp at only four bucks is clearly a winning choice. The only problem I had was later on I discovered the Output side did not like being grounded and I had to insulate the external speaker jack.

First Breadboard – TeensyLC

TeensyLC has one serious limitation for my application. Because the ARM chip handles flash differently than the MEGA328, TeensyLC has only 128 bytes of emulated EEPROM. That meant limiting stored button memory to four messages only 30 characters each. At that time I was thinking about adding a Real Time Clock so looked at getting Adafruit’s FRAM breakout and their DS1307 RTC. But for less money than these two modules plus a TeensyLC I could get a Teensy3.2 module with a Cortex-M4, lots of memory, built in RTC, and 5 volt tolerant inputs. I sent off an order to Adafruit (10% off if you watch “Ask An Engineer”).

Teensys have lots of I/O pins, same spacing as the LCD modules, so I elected to mount the Teensy board directly on the LCD.  One 3 pin header and one four pin header is needed. In the next photo you can see the headers with two short gray spacers to separate the PC boards. I had to flatten one of the LCD bezel mounting tabs for clearance but the mount is very compact and rigid. Note to self: make sure you don’t need any more connections to the bottom of the board before soldering down the headers.

I had the idea to use a software driven flashing LCD back light to indicate a flat battery. ARM I/O pins are limited to 9 milliamps each, not enough for an LCD back light so a 2n2222 transistor was glued in to act as back light current switch. The trim pot on the right is for adjusting LCD contrast. It is across the back light LED pads, did not work out well, as later in development I am PWMing the 2n2222 to get adjustable back lighting. So the trim pot has been moved up on the LCD board, epoxied in place, and hard wired to ground and +3.3 volts.

Teensy3.2 Grafted on to LCD

The two wires leading off the right end of the Teensy go to a CR2032 backup battery for the Real Time Clock, and you can just see the Adafruit 32KHz crystal added on the bottom of the Teensy. With this minimal configuration I was able to test and experiment with the built in RTC using the example program furnished with the PJRC Time library, modified with LCD prints.  Initially setting the clock was a problem, you need to send a “T” followed by Unix time (seconds since 1970) into the serial port. I worked out this Linux incantation to get the proper format for Central Standard Time:
echo T\$[`date +%s` – 6 * 3600]
T1453151560

Then copy “T1453151560” and paste into the Arduino serial window.  Once the clock has been set it takes care of itself though I’m not sure how. I believe it reads and sets time from code uploaded from the compiler. The Time library is more than a little obscure.

Clock Testing Processor/LCD Sandwich

Of course many wires have to be added to interface Teensy with the rest of the keyer. It’s not so neat looking now, I’m using nearly every I/O pin plus power from the built in 3.3 volt regulator. I use mostly 24 gauge wire, solid if connecting to other points on the lid, stranded if routing to points below. I have an old Ungar fine tipped soldering iron plugged into a Variac set to about 70 percent.

Processor/LCD With Necessary Wiring

There are three auxiliary perf boards in the design, One mounts seven memory switches, another holds volume control, transmit LED, and the Function button, the third has clock battery and an optoisolator for transmitter keying. These boards were carefully laid out on paper, then cut out and marked up so mounting holes could be located. Working with a hinged lid box you have to be careful to leave extra clearance for the lid to close. I did have to file a bit off the button board and the speaker.

The box needs a couple dozen holes to mount parts. Blue tape was applied to all surfaces, a layout drawn on the tape, then all holes center punched.  I start with my smallest drill bit in a drill press then enlarge 1/64 at a time to final size.  A few holes required fine tuning with a tapered reamer.  I made a rectangular cutout for the LCD bezel by using a wooden template screwed to the lid, then cutting with a 3/16 carbide router bit surrounded by a 1/4″ collar. Mounting hardware is mostly 2-56 with a few 4-40 spacers.

Crayola Lid Drilled

I had a pair of paralleled 18650 cells taken from a cell phone charging pack. These are fastened in the box by a strip of tin can metal soldered in, and restrained by an angle bracket soldered at one end. The small speaker was taken from a defunct IPod dock. In the next photo, most of the lid components are mounted. The small audio amp board goes on the two screws at right center of the lid, mounted mezzanine style.

Box Lid Components Mounted

Next is a close up of the batteries with 2 amp fuses soldered in both plus and ground leads. Also see three stereo jacks at the right side for Key/Audio Out, External Speaker, and Paddles In. You can see in the bottom three long #2 screws for mounting the third perf board and Adafruit boost/charger. Most board mounting screws have three nuts; one to secure the screw, one to support the bottom of the board at the proper height, and a third to secure the board against the second. Thank heaven I still have a Heathkit nut starter.

Mounted 18650 Cells with Fuses in Both Leads

At the right side of the box there is a power switch, PS2 jack, and a micro USB jack breakout. The power switch does not actually switch power, it grounds the Enable pin on the charger board which turns off the boost converter.  That allows charging to continue while the rest of the unit is off.  Later in debugging the hardware, I added bypass capacitors to that switch and a separate wire to the Enable pin on the audio amplifier which suppresses a weird sequence of sounds from the speaker on powering off. The PS2 jack leads wouldn’t reach the processor board so they route to the third perf board and get jumpered there to stranded wire headed for the Teensy.  It’s getting hard to find a real PS2 keyboard but the software works fine with a USB keyboard plugged into a USB/PS2 adaptor.

Power Switch, PS2, and USB Connectors

This is a good place to register a complaint. I bought the Adafruit PowerBoost 500 board to manage the battery. It charges from 5 volt USB in and boosts from the 3 volt battery, seamlessly switching sources when you pull the USB connection. It does NOT however pass through or even break out the two USB data pins from the micro USB input jack. The only way to actually use USB while charging the battery is to wire out the D+ and D- leads outside the board. Adafruit support suggested doing this by cutting up a USB cable. I was able to route the micro USB breakout data leads (Green in the next photo) to the processor and the incoming positive and negative supply leads to the PowerBoost using a plug from an Adafruit micro USB connector (red and black in the photo). An extra \$2.50 in parts that wouldn’t have been needed if Adafruit had only provided pads on the PowerBoost for D+ and D- or better, added two traces to route the data signals from the input connector to the output connector.

Detail of the Hacked USB Connection

One more issue with the PowerBoost. It has a nice pair of status LEDs (where it says CHRG) yellow when charging and green when fully charged. These operate from a single pin on the charger chip but that pin is not broken out and you can’t of course, see the LEDs when the box is closed. I added a wire (gray, leading off to the right in the photo) to the common side of the LED dropping resistors so I could have the Teensy display charging status on the LCD.  Not difficult but would have been nice to have official access to that chip pin.

The keyer has four monitoring leads between the PowerBoost and the processor. Besides the status signal mentioned above, I wired up the LowBattery pin and USB (power).  USB activates the Status signal which is only valid when USB is plugged in and receiving power from the host.  LB goes low when the battery is REALLY flat (3.25 volts I think). I also wired the BAT pin to the Teensy A10 analog input through a 10k calibration pot so software can read and display the battery voltage. You can see the calibration pot at the bottom of the board in this photo.

TX board, PowerBoost with Voltage Cal Pot

The next photo shows how I insulated the External Speaker jack by opening up the mounting hole and screwing a small piece of Lexan to the box. The plastic had to be counterbored so the jack mounting nuts would fit.

Output Jack Insulation

Here is a close up of the box lid interior. You can see the LCD contrast pot which is glued to the LCD, perfboard for the LED, volume control, and Function button. Two screws and a couple of spacers mount the PAM8302 audio amp on top of the LED board.

LCD Contrast, Audio Amp On Top of LED Board

Here is the completed keyer opened up. Clockwise from top left, I/O stereo jacks, 18650 batteries, memory button board, Teensy3.2 processor on top of 16×2 LCD display, LED board, speaker, on/off switch, PS2 keyboard jack, USB input jack, PowerBoost charger/boost converter, and the transmit interface board.

Keyer Internals

An Eagle schematic diagram of this project can be downloaded from:
https://dl.dropboxusercontent.com/u/40929640/ArduinoMorseCode/keyer2016/KeyerDrawings.zip

Keyer 2016 Schematic Version 1

Revision History

February 25, 2016       MemoryKeyerTeensy3.2_V1.0    Initial sketch
March 9, 2016             MemoryKeyerTeensy3.2_V1.1.0  Rework battery alarm logic, bug fixes.
March 16, 2016           MemoryKeyerTeensy3.2 V1.1.1   Workaround fix LCD does not have backslash in its font.

Requirements

The 2016 version keyer hardware has four additions that require software support; more memory buttons, stand alone battery operation, Real Time Clock, and the biggest change a 16 character 2 line Liquid Crystal Display.

Additional memory buttons need:

• Expansion of button scanning while in operation
• Expansion of button programming
• Addition to default messages
• Consideration of potential uses while not in operation

Battery and associated (PowerBoost 500c) charger/converter need:

• Charge status monitoring
• Discharge status monitoring and alarm
• Work out how to turn the unit off while charging

The Teensy3.2 built in Real Time Clock will need:

• Ability to read hardware clock and convert to display friendly form
• Ability to set hardware clock when in stand alone mode
• Display GMT and Local time and date
• Desirable: sync hardware clock over serial from PC

Stand alone operation requires all information displayed on the LCD as well as the serial port.
This will require:

• Battery charge/discharge status
• Keyer parameters, speed and side tone frequency
• Time and date
• Desirable: manage the LCD backlight

A link to my sketch is at the end of this article.

Following is a description of some things I learned writing this code.

Event Loops

When I first looked at KC4IFB’s Iambic code I couldn’t see how it worked. But after a fair amount of study and experimentation (see my instrumented version) I now understand and use event loops often, avoiding delay() whenever possible.  In an Arduino sketch loop() is an event loop. It just spins forever waiting for something to do. Code entered within loop() is repeatedly executed, like scanning an input pin for a button press which sends in a ground.

Why avoid delay()? Because it stops all sketch processing until it times out. Better to use the timer to trigger an event asynchronously at the current time plus a delay interval. Let loop() continue to spin, watching over the rest of your code. An example might be:

```unsigned long trigger1k;
unsigned long trigger5k;
unsigned long currentTime;```
`void setup() {}`
`void loop() {`
`currentTime = millis();`
```if (currentTime > trigger1k) {
< do stuff every second >
trigger1k =trigger1k + 1000;
}```
```if (currentTime > trigger5k ) {
< do stuff every five seconds >
trigger5k = trigger5k + 5000;
}
}```

This would not work well with delay(1000) and delay(5000) in place of the time triggers.

You can roll your own event loops. I’m doing this often in the keyer sketch. Just set up your own infinite spinner:

`while (true) {`
`  < code executed until a break; is seen >`
`}`

The C statement break: exits the while loop. You can make event loops inside of event loops but more than two levels gets very difficult to debug.

Stupid Switch Tricks

I used the “C” switch statement a lot in this years update and thought I would document some of the ideas.

This is a function to print 2-4 digit numbers with leading zeros. It can also be used to right justify a number by changing “0” to ” “. Note there are no break statements in the switch, it is entered at a point determined by “digits” then falls through all succeeding statements.

``` /********************************************************
Just to get leading zeros on up to four digit integer
arg k is variable to print
arg digits is # places to use
********************************************************/
void lcdPz(int k, int digits) {
switch (digits) {
case 4:
if (k < 1000 ) lcd.print("0");
case 3:
if (k < 100  ) lcd.print("0");
case 2:
if (k < 10   ) lcd.print("0");
default:
lcd.print(k);
}
}```

Building a Menu with Switch

I gave a lot of thought and time to how I could do stand alone update menu system.  The menu loop is entered if the “FUNCTON” button is down when the processor boots up. Teensy3.2 does not provide easy access to the reset pin so my workaround is just switching power off and on.

In this bit of pseudocode, the switch statement just displays menu options. Pressing the “ENTER” button while a specific item is on the LCD selects that menu item for updating. I use a separate function to actually implement specific item updates but that could be done in line.

`while (true) {             // Event loop`
`  Mtime = millis();`
```  if (MTime > nextMenuTime) {
nextMenuTime = MTime + 1500; // New menu item trigger  whichMenu = (whichMenu + 1) % 8; // Counts 0 to 7```
`  switch (whichMenu) {`
```    case 0:
< display first menu item >
break;```
```    case 1:
< display second menu item >
break;```
`etc. etc.`
```    case 7:
< display seventh menu >
break;```
`  }        // End of switch statement`
```if ( < SELECT button is pressed > ) {
do something about it  >
}```
`}           // End of while() loop`

Selecting Columns to Update

One particular problem was how to update the clock time and date. Time is displayed on the LCD as HH:MM:SS so how to click through that and change individual digits? I decided to only increment or decrement the ones digits so the second “H”, the second “M”, and second “S” digits are the only targets. I can skip everything else. Two buttons were designated as “up” and “down” and I wrote a function that returns 1 if “up” is pressed, -1 if “down” is pressed, zero if neither.

Using switch() to select the appropriate digits on the LCD easily allows skipping over columns.

```case 3:                            // Set GMT time

Ltime = now();                    // System time snapshot
// Convert snapshot into simpler variables for display
Lhour = hour(Ltime);              // Need the date as well
Lmin = minute(Ltime);
Lsec = second(Ltime);```
``` cursorPos = 0;                    // Start at first position
lcd.cursor();                     // So you can see where you are```
` lcd.setCursor(0, 1);`
```// Walk the cursor down the displayed time
while (true) {                    // Start event loop

Action = upDown();              // Up or Down pressed?
if (Action != 0) {
delay(150);                   // limit speed of change
Changed = true;               // Flag something was changed
}```
```switch (cursorPos) {
case 0:                       // Hours tens digit
cursorPos += 1;
break;
case 1:                       // Hours ones digit
Lhour = (Lhour + Action) % 24;
break;
case 2:                       // Ignore the colon
cursorPos += 1;
break;
case 3:                       // Skip Minutes tens digit
cursorPos += 1;
break;
case 4:                       // Minutes ones digit
Lmin = (Lmin + Action) % 60;
break;
case 5:                       // Ignore the colon
cursorPos += 1;
break;
case 6:                       // Skip Seconds tens digit
cursorPos += 1;
break;
case 7:                       // Seconds ones digit
Lsec = (Lsec + Action) % 60;
break;
}                               // End of switch```
```if ( < ENTER button pressed > ) {
cursorPos = (cursorPos + 1) % 7;//  Move to next digit
}
if ( < EXIT button pressed> ) {
< Write changed time to the system clock >
break;                         // Jump out
}```
`  <  redisplay the time on LCD >`
`}`
``` break;                        // Exit the while()
}```

Revision History

February 25, 2016      MemoryKeyerTeensy3.2_V1.0  Initial software
March 9, 2016            MemoryKeyerTeensy3.2_v1.1.0 Rework battery alarm logic, bug fixes
March 16, 2016           MemoryKeyerTeensy3.2 V1.1.1   Workaround fix LCD does not have backslash in its font.