Just in the nick of time, I received the Adabox 019. It contained a keyboard circuit, keys, keycaps, OLED display, rotary encoder, encoder knob and housing — some assembly required. Adafruit promotes this product as a way to send commands through a USB port to the foreground program running on a computer. There is also a MIDI use case.
The included demo code interprets key presses based on a menu of items that are specific to a given program. You can have multiple menus for multiple programs. You switch between menus using the rotary encoder. Each menu can set the neopixels under the keys to visually group keys by functionality. Here’s an example menu I did for Inkscape.
Key 1 (upper left) resizes the document to match the selection Key 2 is for Trace Bitmap Keys 4-8 are for manipulating layers
It worked, but this use case for the MacroPad wasn’t satisfying. For me, a keystroke on the pad isn’t any better than just using the shortcut keys on the full keyboard. I soon started to hunt for a bigger itch that needed a bigger scratch.
The first one I came up with was to use the example menu framework to simplify my use of various Linux terminal commands. The ls command, for example, has dozens of options. The combination of dashes, case sensitivity, non-mnemonic codes, etc. makes the command tedious to type — especially if you need to use many different options in various combinations. Not to mention that the meanings of the options are different depending of the flavor of Linux!
Here’s the menu I wrote for the terminal on MacOS. I took better care on this menu to color code the keys. The yellow keys are for formatting options, the green key is for recursion, Key4 isn’t enabled, the red keys are for sort order and the purple keys are groups of file extensions. Pushing the rotary key enters the “ls ” command itself.
With an open terminal window, the MacroPad connected and my custom menu selected, I can use the keys to easily form the command that lists “code” files with units, long dates, sorted by size, in reverse order:
<Rotary><Key1><Key2><Key5><Key7><Key12> #These are the key presses
ls -h -T -r -S *.py *.sh *.sed #This is what gets typed at the prompt -rw-r--r-- 1 appleadmin staff 75B Jul 9 09:40:36 2021 mymoduletest.py -rw-r--r-- 1 appleadmin staff 72B Oct 19 09:59:35 2020 timezones.py -rw-r--r-- 1 appleadmin staff 59B Mar 30 16:17:28 2021 getSkyCharts.py -rw-r--r-- 1 appleadmin staff 58B Apr 2 16:39:43 2021 mymod.py -rwxr-xr-x 1 appleadmin staff 46B Mar 31 06:38:26 2020 rhi.sh* -rw-r--r-- 1 appleadmin staff 24B Aug 2 21:47:36 2021 goPad.sh
It works well.
Finally, having just finished my 2-Player+ Chess Clock, I made version V2.0 using the MacroPad. This time, I have a display screen to properly prompt for input and display time remaining, a rotary encoder with an “ENTER” feature for numeric value input and a physical, color-coded button for each player to push.
We are makers. Some of us take an object and reshape it to make something new. Others of us assemble components together. For 50 years, I’ve made computer programs. And I still enjoy it.
In this post, I want to explain about the User Interface challenges I faced while programming an enhanced chess clock.
If you’ve seen the movie Queen’s Gambit (or just about any other movie with chess in it), you’ve seen chess clocks. Chess clocks are used to ensure games end in a reasonable time.
A chess clock comprises two, linked stop-watches. There are two buttons on top. The left button stops the left clock and starts the right clock. The right button stops the right clock and starts the left one. The clocks measure the total amount of time each player has spent thinking about and making their moves. Each player is given a certain amount of time at the start of the game. If a player hasn’t beaten their opponent before their time runs out, that player loses. There’s an indicator that shows which clock is running, and a little flag that drops to indicate that time has run out. In this day and age, digital chess clocks have often replaced analog clocks.
Now that looks like something makeable. A couple of 4-digit, 7-segment displays, a few buttons, a 3D printed case, some LEDs, a microcontroller — and a little bit of programming.
I took a different approach. I didn’t feel like buying and assembling the individual components. I wanted to write the code and begin using it very soon. Also, while chess is a two-player game, my family plays Rummikub which can be 2, 3, 4 or more players — so I wanted a variable number of clocks. I decided to use a Circuit Playground Express (CPX) from Adafruit.
The CPX is a microcontroller board that includes 1 red “status” LED (Pin 13), x,y,z-accelerometer, light meter, JST battery port, USB port for communication and/or power, temperature sensor, digital and analog pins, 7 capacitive touch sensors, 3.3 and 5.0V power and ground, two clicky push buttons, slider switch, infrared tx/rx, speaker, microphone, and (this is the best part) 10 RGB pixels.
It’s a great product to introduce people to programming. Programming can be done with MakeCode (a block based language), CircuitPython or the Arduino IDE. I chose to use CircuitPython and the Mu IDE to make my clock. When the CircuitPython firmware is installed, the CPX appears as a thumb drive called CIRCUITPY when plugged it into your computer. If you copy a file called code.py to the root of CIRCUITPY, the firmware starts to run it. The firmware senses whenever a new code.py overlays the previous one and auto restarts.
The challenge with this project was to design a user interface that can be used for a variable number of countdown timers using only the built-in components on the CPX. Here are the decisions I made.
How to tell how many players will be playing. When the CPX is powered up, it immediately launches the code.py program which waits to be told how many players there are. It assumes at least two players, so it lights the first two pixels red. If there are more players, press and hold the A button until additional pixels light up. It’s possible to accidentally turn on more pixels than you intended. If this is the case, use the B button will turn pixels off. Code prevents you from setting fewer than 2 players. To finish up this step and move on to the next, tap the A1 capacitance pad. (My CPX is housed in a 3D-printed enclosure and the pads are a awkward to reach. To solve this, I clipped the head of an alligator clip to the pad. Rather than touching the pad, I can touch the tail of the alligator clip.)
How to indicate who’s turn it is. With 2 players, each player gets allocated 5 pixels. Each set of 5 is a different color. With 4 players, each player gets 2 pixels. A player’s pixels will light up with appropriate color when their turn begins.
How to indicate that the clock is running. I use the red status led. Each second, I toggle the LED.
How to end your turn, stop your clock and start the next player’s clock. When the current player is done, they click their button – either button A or button B. When the next player is done, they click their button. Internally, players are numbered 0 to n. Even numbered players share button A and odd numbered players share button B.
How to indicate which player makes the first move. Games don’t usually last a long time (although some players in my circle have historically taken a LONG time to make their move — hence, the need for this clock) and it’s common to play a second or third game after the first is finished.
For the first game, one of the players is designated the starting player (however that gets decided). That is player #0 and is assigned the first set of pixels and button A. The next player is assigned the second set of pixels and button B. This continues for all remaining players. When playing several games in a row, the starting player of the first game is not necessarily the starting player of the second game. For the second and subsequent games of the tournament, a new starting player must be indicated.
The number of players is the same, the order of players is the same, player numbers, pixels and buttons have all been assigned. None of that needs to change. But the clock does need to know which player will make the first move. The CPX prompts for the identify of starting player by lighting the 1st pixel blue. If the starting player is actually the 3rd player, holding the A button lights up the other pixels. Continue to hold until the starting player is indicated. Code prevents you from turning on more pixels than there are players and from turning off all the pixels. Tapping the A2 capacitance pad will lock that choice in.
When to start the first clock. The number of players is set. The player to make the first move has been set. The next thing is to activate the clock of the starting player. This is done by covering the light sensor with your hand. When the sensor detects a significant change in brightness, it will start the countdown clock of the starting player, illuminate their pixels and blink the status led blinking.
How much time left. In this first implementation, the CPX is connected to the Mu editor on a laptop via a USB cable which supplies power to the CPX. The Mu editor includes a serial monitor to which the CPX can write status information (like each player’s time remaining). Mu also has a built-in plotter. If a tuple is written to the console, the plotter will display the values of the tuple in a time graph. If you want to know how much time you have, just glance at the plotter (or the serial monitor). Here we see that player 1 (zero relative) has run out of time and gone negative.
A future implementation of the clock will be battery powered and there will be no plotter nor serial monitor. Instead, a single 4-digit, 7-segment display connected to the CPX’s I2C interface will display the time remaining for the current player. This exceeds the design goal of no additional components, but, what the heck.
What to do if the current player’s time runs out. I play a sad sequence of tones on the speaker and light their LEDs red.
Here is a two-minute video demonstrating a four-player game with an artificially short time limit.
Yet to be programmed: Set the length of time: Maybe light up the LEDs. The binary equivalent will be the number of minutes. This would put a 17+ minute limit for each player. Indicate someone won (rather than someone timed out), game over, start next game. This could be done by shaking the CPX since there is a built-in cpx.shake() function that can be queried.
My 2.5 year old grand-niece loves jigsaw puzzles. I thought it would be a nice to make a custom puzzle for her using a photograph of people she knows.
Here’s how I did it.
My approach was to take a photograph, glue it to a substrate and laser cut it into interlocking puzzle pieces. I’ve seen my niece assemble 25-piece puzzles, so I wanted to keep the total number of pieces to about that number. The pieces need to be an appropriate size to fit her little fingers. Combining this with the 25+/- constraint, I decided to order an 8×10 print and to cut it into a 5×4 matrix. Twenty pieces is a little light on piece count but it matches the aspect ratio of the photo.
Puzzle pieces need to be sturdy. Simply cutting the photo into pieces wasn’t satisfactory. The pieces need a stiff backing. I considered three materials — 1/16″ basswood sheet, acrylic, and heavy card stock. I ran test cuts on all three materials. I printed three 5×6 test photos and used Locktite 300 spray adhesive to glue the photos to each of the above materials and let them cure overnight. Then I covered the photos with blue painters tape to prevent charing of the photo. It’s best if the width of the tape is LESS THAN the size of a puzzle piece. The 300 adhesive helps ensure that the photo does not separate from the substrate either during the cutting process or when removing the blue tape.
The first material I tested was the card stock. I’d picked up some mat board typically used for picture framing. I cut a series of 1″x1″ squares through the tape, photo and substrate with various laser settings. The best setting seemed to be 10% speed, 100% VC, 100% power and 2 passes. The pieces cut very cleanly. The edges of the square were darkened, but the backside only had a little bit of soot and the blue tape completely protected the photo. The next test cut was a single, 2″x2″ jigsaw-puzzle-shaped piece. I found and downloaded a vector image of a single puzzle piece. It printed beautifully. The stiffness was perfect — just like a commercial puzzle — and fit well when dropped back into the hole left in the test material. I didn’t bother test cutting the other materials.
Finding a 5×4 vector jigsaw puzzle template for the production run was more difficult. I found plenty of .jpg images, but converting them to vectors for cutting exceeded my Inkscape skills. I ended up buying a collection of 13 templates in .svg format on ETSY for $2.50.
For the production run, I printed an 8×10 image and glued it to the mat board. In Inkscape, I opened the 5×4 puzzle template and sized it to 7.5″x9.5″ — slightly smaller than the image. I colored the interior lines blue and the outline red. The plan was to cut the blue first and the red last. This way, the pieces would stay together until the outer perimeter cut through. I added a second layer to the bottom of the layer stack, imported the original .jpg that I had printed and resized it to 8×10. With the two layers superimposed, I made whatever subtle changes were necessary to ensure the best placement of pieces within the boundaries of the photo. Once satisfied, I turned the background/photo layer off and sent it to the laser.
Surprisingly, the settings from the test cuts failed on the production run and I ended up using speed 30% and 3 passes. Once cut, I took each piece out of the laser one at a time, stripped the blue tape and reassembled the puzzle to ensure all pieces fit nicely.
When stripping the tape, there’s always the risk of pulling up the photo as you scrape along the edge of the piece trying to get a foothold to pull. By keeping the width of the tape small, you can ensure that the center of the piece with have two strips of tape overlapping each other.
It’s far easier to scrape at that seam to get started. Once the first one strip of tape is removed, it’s easy to start the second by scraping across the flat, center surface of the puzzle piece instead of along the edge of the piece.
Here is the final result.
I did eventually test cut the other materials. The 1/16″ basswood was sturdy, but a little thin. The acrylic was beefy thick, but light and strong.
Here are the details of the mat board purchased from Michael’s:
Last month, we (my wife and I) disassembled an IKEA Expedit shelf unit, and while I didn’t take a photo of ours before disassembly, it was a 5×5 unit identical to the one featured here. The room the Expedit was in was getting rearranged and there wasn’t going to be a place for it any longer in the room. We don’t really have any other spot in the house where it would fit, so my wife suggested putting it on the curb.
I realized that while it wouldn’t fit in the closet in our home office, I could salvage much of the material and repurpose it for a custom shelf system. What I figured I could salvage and reuse were the 20 short pieces (the vertical walls in the photo on the above linked page) and the four long and thin pieces (the horizontal pieces in the photo on the linked page.)
On Thingiverse there is an thing called the Shelfie, described as a DIY parametric shelf and storage designer. I had made a few of the brackets a few years ago when I had a surplus of small plywood panels, but I never finished that project. Originally, you could use the customizer on Thingiverse to configure the brackets exactly how you wanted them, but the Customizer hasn’t been working on Thingiverse for awhile now. However, you can load the design in OpenSCAD and customize the design to be whatever you need.
The screenshot above shows how the Customizer in OpenSCAD is used to configure the part to be a T shaped bracket with a back and a pass-through channel so the long board can go all the way through.
I did a quick measurement of the closet and figured out that the long boards would fit in the width of the closet and that I could easily get three rows of shelves to fit without having to work around anything already mounted in the closet. So, I drew up a quick sketch:
I wanted a few tall cubbies, so I scribbled out the parts where there wouldn’t be a shelf. Then, I came up with a shorthand for planning out what brackets needed to be 3D printed: Ts = standard T bracket, Tp = T bracket with passthrough channel, Xp = X bracket with passthrough channel, and each of the corners was going to get a standard L bracket, so I didn’t label those.
I needed two complete sets of the brackets, one for the front and one for the back. The ones on the back I decided (after suggestions from other Workshop 88 members) to add the option to screw a backer board onto.
After customizing all the designs in OpenSCAD, I started printing. And printing. And did some more printing. I lost track of the total print time, but it could have easily been a week of continuous printing. With the breaks I took between some of the prints, it took me about three weeks to finish all of them.
Finally, I was ready for assembly!
Somewhere towards the end of the assembly, I realized that I had miscounted the number of short panels I needed. I thought I would only need 18 of the 20 panels from the Expedit, but I had forgot to count the three horizontal short panels needed for the top three cubbies! So, it turned out that I needed 21 panels, but only had 20 available. Whoops!
Fortunately, my design only was using three of the four long boards, and since they were all the same thickness, I cut the end off the extra board to make the last needed small panel.
I also made a last minute decision to attach the brackets directly to the wall panel in the closet. I figure that it is a closet that I don’t mind if the wall panel (it is a panel, not drywall) gets some holes in – especially since they will be small holes. Hopefully the shelves last quite awhile, though!
In the assembly process, I only had one bracket break – a T bracket with a passthrough and wall attachments. The reason it broke was that I had attached it to the wall before putting in the last horizontal long board. It wasn’t lined up with the other brackets, so when the long board was inserted, it bent the bracket and snapped off one side of the passthrough channel. Fortunately, I had a leftover test print that worked as a replacement part.
In the Workshop 88 slack there is a channel called “entropy” which I find to be delightful because members use that channel to discuss the various ways that they try to reign in the disorder in our workspaces. I don’t have a “before” photo of the closet, but I can attest that although the closet is accurately described as a “walk-in” closet, it would have been impossible to do that before I added the modified shelf. Here is the photo after adding all the stuff back into the shelf:
I’m really happy with how this Ikea-hack project turned out. I’m cautiously optimistic that the shelves will have an extended life helping to control the disorder in this closet.
About Workshop 88
Workshop 88 is a makerspace in Glen Ellyn Illinois. We are more than a workshop, we are a growing community of creative talented people who aspire to learn and share knowledge, experiences, and projects.
Join us! To become a member join at Workshop88 or you can help us continue to share our projects and activities by supporting us via Patreon.
One of our members, Mark Frost, recently made up some custom awards for a group at his church. Here’s what he had to say about this project:
Every summer for 30+ years some guys from church have been doing a golf trip. I’ve been going for the last 15years or so and have recently taken over the “hardware” aspect. In previous years we would order engraves plaques, mugs, glasses, embroidered towels, etc. But this year I figured I’d take production “in-house”. I grabbed the church and resort logos, threw the text on top and engraved squares I cut from a 2’x2′ MDF board from HD
Mark Frost via slack.com
This is a really great example of the kinds of projects that our members are able to create quickly at Workshop 88! What could you make with a laser cutter/engraver?
At the end of the last post, the board looked like this:
The full board
Today I’ll be moving on to the VFO section of the board. A VFO, or variable frequency oscillator, is the circuit that allows you to tune a radio. This particular VFO is based on a Collpits oscillator, and can tune over a 50-70 kHz range centered on a frequency determined by the component values. The frequency range shown in the image may seem a bit strange. This transceiver can be built to cover that 50-70 kHz range somewhere near 3.5 MHz to about 3.75 MHz. The short explanation is that the frequency we’re interested in is shifted by the frequency of the VFO to an intermediate frequency of 8 MHz, where we can do filtering and amplification at a single fixed frequency. Since a lot of circuit characteristics are frequency-dependent, performance is much better if the components can be selected for just one frequency.
The majority of the components are supplied with the kit, so their values are fixed. One of them, an inductor, I had to wind myself. Since this phase required quite a few components, I decided I’d lay them out before I started.
Rather than start building immediately, I decided to wind the inductor first, so I could get that out of the way. The instructions specified 28 turns of the green #28 enameled wire on the red toroid core. I had to count the turns several times to be sure.
The inductance of the coil is dependent on a lot of things, including the material the core is made of, the diameter of the core, the number of windings, and the spacing between the windings. Later on in the build, I tweak the range covered by the transceiver by adjusting the coil spacing.
From this point on, it was simply a matter of stuffing the board and soldering, as per the instructions. The one thing I would have changed was the process for doing initial testing of the inductor. They have you tack a couple leads to the pads you’re going to use, and then tack the inductor to those. Unless your inductor is wildly off, you’re not going to be rewinding it, so I would have skipped that step and just soldered it in directly at the beginning.
The testing of phase 2 was relatively simple, because I’m using a frequency counter. I just hooked up the frequency counter, and adjusted the spacing of the turns on the coil I mentioned before until the VFO covered the range between 4.470 MHz and 4.391 MHz.
I’ll talk more about it in the next post about the transmit mixer and filter, but that provides an actual range of 3.530 MHz to 3.609 MHz. This includes the QRP CW calling frequency at 3.560 as well as W1AW’s code practice sessions transmitted on 3.5815. It does not include the main CW DX window between 3.500 and 3.525 MHz, but I’m still working on getting my Amateur Extra license, so I’m not authorized for that part of the band anyway.
I won a T-Kit 1380 80m 3 watt CW transceiver kit at the WCRA Hamfest back in 2014, and it’s been sitting on my bench unopened since then. I didn’t have my license at the time, but I got my General license about a week later. I decided that this summer was a good time to start building it. Here’s a link to one you can pick up if you’re interested : http://www.rkrdesignsllc.com/-13/
I have quite a lot of kit-building experience, but most of it is digital electronics, so this is probably the most complex kit I’ve ever built, both in number of components and circuit complexity.
If you’re not familiar with amateur radio, this kit will let you transmit and receive on the 80m band (between 3.5 and 3.75 MHz) using CW (morse code).
The schematics in the manual are a bit low-res, but the instructions for assembly are very good. My biggest complaint with the manual so far is that errata are supplied as a stack of papers inside the manual. Some of them referenced parts this kit doesn’t use, so it was a bit of a chore to go through and update the instructions and update the steps by hand.
The assembly process is documented in phases, with testing procedures at the end of each phase.
Phase 1 is construction of the DC input circuitry as well as the keying circuit. The keying circuit is connected to the code key, and disables the receive circuitry while transmitting. Here’s the diagram for phase 1.
Phase 1 schematic
Here’s the board as assembled:
Phase 1 assembled
This is a pretty densely packed board, and the silkscreen suffers for it. The manual gives pretty decent drawings of the section of the board each phase is concerned with, and this helps quite a lot. You can usually locate a component by finding a nearby component you’ve already installed, or one whose silkscreen isn’t broken up by a pad.
Once this phase was assembled, there was a short test procedure to verify that it is operating correctly. Essentially, I had to apply 12v to the 12v input, and then verify that R13 (the resistor in the center of the board, just between the two beige ceramic capacitors) read 0v while the key wires were disconnected (the white and black wires just under ‘J1’), and 12v while they were touched together.
I misread the directions and it took me a while to figure out what I was doing wrong (I was measuring voltage drop across the resistor, not between the resistor terminal and ground), but in the end, everything checked out.
I picked up an OBi100 adapter for the space a few weeks ago, and have been hunting around for a phone that we can use with it.
I stopped by the local Goodwill on my way in to the workshop one morning, and picked up two phones for $1.99 each. One was a Lucent speakerphone that was missing a power adapter (I managed to dig a compatible one out of our giant box of wall warts in the electronics room). The other was a fantastic old GE Model 500 rotary dial phone. One of our members with a bit of experience in the area pegged the year of manufacture as 1965, with the last service in 1984. I cleaned it up with some rubbing alcohol, and we swapped the old phone number placard for a W88 circuit board mask:
It took about 10 minutes of googling to find the pinout on the 4-prong adapter so we could hook it up, and it was hooked up to our Google Voice phone number and ringing.
The alligator clips aren’t a great solution, so I started designing a box to plug it into. I used OpenSCAD to do the design. The source files are available in my GitHub repo, but here’s a couple quick screenshots of the render:
I measured for the holes on the top using a pair of digital calipers, and then did some quick trig to figure out the offsets from the center point of the box.
The pins on the plug are arranged in a trapezoidal fashion so you can’t insert the plug backwards. The bottom of the box is set up so that I can drop in a Radio Shack perfboard with a standard phone line connected to a couple of spring contacts on the wider pair of the two holes. The standoff holes in the perfboard line up with the blocks in the corner of the box, and I have a second 3D model for the bottom of the box that sits below the perfboard.
The most difficult part of designing the box was getting the Workshop 88 logo to come out right. I found this great tutorial on how to use InkScape to build 3D shapes in OpenSCAD and I used the source image for the same circuit board mask that we stuck on the phone. Once I had that in place, it wasn’t too difficult to use it in OpenSCAD. Check out the GitHub repo for details.
I did a couple of test prints on the MakerBot to make sure everything fit together, and it looks like it is working pretty well. I haven’t done another print with the logo, but judging from the generated STL, it is going to be much more involved than the basic prints.
When I added the logos, the STL went from about 300K to over 2MB. I’m hoping that the print itself will be stable enough that the logo won’t lose resolution and look bad. We’ve got a new stepper motor extruder ordered for our MakerBot, so that may help a little bit with the resolution.
The next project is to get this puppy to dial out. We’ve had a few suggestions, from converting the pulse dial to DTMF using an Arduino Teensy to hooking up a Blue Box with an acoustic coupler. Right now the easiest way to use it is to dial out on a different phone, and then pick up the handset. That really isn’t all that much fun. I’m leaning towards the acoustic coupler method, but early experiments with DTMF generators on our cell phones didn’t go too well, so we may have a bit more work cut out for us. The Wikipedia article says that blue boxes no longer work due to changes in the switching infrastucture, which… ahem… anecdotal evidence would tend to confirm.