Showing posts with label diy. Show all posts
Showing posts with label diy. Show all posts

Monday, 20 January 2025

Kempston-USB adapter for The Spectrum

What's wrong, or right, in this picture?

After using it for a while, Retro Games' The Spectrum is a rather nice Speccy-tribute. But it's not an authentic hardware replica, and old 9-pin joysticks and peripherals won't work with it.

But what if... I was to purchase a vintage joystick adapter and disguise it as a Speccy peripheral? Delightfully devilish!

I already have an Arduino-based adapter for attaching classic 9-pin joysticks to USB, and it works with The Spectrum. An Arduino Micro or Leonardo can pretend to be a HID device, essentially becoming a gamepad without buttons. On Retro Games' The C64, I had problems possibly because it's a type of controller not "whitelisted" in the firmware.

The USB ports at the back of The Spectrum are where the edge connector is supposed to be. This got me thinking I could build an adapter to look more in line with The Spectrum's appearance.

I happened to have some Speccy joystick adapters, and one Timex Joystick-Sound Unit has had its guts removed already before. Not sure why, but at least I don't have to feel too bad about breaking one now.

Apologies to all Portuguese Spectrum fans to whom the sound unit is a matter of national pride. (Timex manufactured these units in Portugal, among other things).

All the parts

I started by fitting the Arduino Micro inside, using 3x1 protoboard as a replacement for the original circuit board.

There's more room inside than in my compact adapter, but because of how the board fits inside, it's not all in use. Also, I wanted the Arduino to sit on a socket, which eats up quite a lot of space.

But it all fits inside, I then soldered ready-tinned wires to connect everything. Maybe the Arduino would have fit better horizontally, but what's done is done.

The new problem was finding a short USB-cable or some kind of adapter, that would work as a connector and keep in place.

I did look for L-shaped adapters and cables, but there didn't seem to be a ready-made configuration for a USB-A in L-shape that would configure into a micro-USB.

So I just bluntly took the least useful Micro-USB cable I could find, cut it and soldered it into a really short USB-A-to-Micro cable. I found the space was not quite enough for the Micro end, so I whittled the rubber out to bare minimum to make it fit.

The Micro-end has been whittled bare.

I wanted to make the adapter so it could be meaningfully pulled apart, if I need the Arduino again in some distant future.

At this point I could test it already works and fits into its place. I uploaded the same Arduino sketch as with my earlier adapter, and soldered the cables same way. That's it.

The remaining problem was how to make the USB-A end stick to the box firmly enough and still be able to dismantle the whole thing. Of course I could just glue gun it all to oblivion, but it might be tricky to get apart.

The USB sticks into place

I fit a piece of MDF snugly and put two screws through. This looks like enough to keep the USB connector in place and it won't fall apart when I gently remove the adapter from The Spectrum.

Another dummy connector, or something in similar shape, could be added just to keep the unit more firmly in position. I'll do it if I'm in the mood for fine-tuning this box.

I already know the Arduino joystick adapter feels lagless enough, and in practice this unit doesn't add that much to the Speccy experience. The old adapter I built is more practical. But this was a fun project idea and at least The Spectrum has its own adapter.

One future idea is to implement the "sound unit" function promised on the tin. This is not too far-fetched, as I could pull the audio out of the HDMI->VGA adapter's audio splitter and add a tiny speaker with an amplifier circuit. This would add some value to the box, replicating all the glorious 5 octaves from a tinny speaker as it's supposed to be.

Tuesday, 19 November 2024

Parallel sawing with the Z-saw guides

A follow up to discussing the Z-saw guide. This time I'm doing parallel cuts.

Here I needed to saw 6mm MDF and I expected it to be quite easy. It was not entirely without difficulties. I picked the smaller Z-saw guide and the mini 175 saw.

After the cut.

Using similar-sized 450x800 MDF boards on top of another, I could make a fence for moving the guide smoothly and check the 90-degree by aligning the top board as close as possible. This works only if the boards have been cut accurately enough in the factory!

However, my first cut didn't really succeed. From the ends, the piece has the correct measure, but something happened near the middle, resulting in a long curve, deviating about half a millimeter.

I had a few ideas of why it happened. The third one is the important one.

Firstly, I may have pulled the guide against the fence with too much force. After all, the fence was only clamped from the ends. This couldn't really happen inwards, but perhaps vertically, just enough to disturb the guide.

Secondly, sawing ahead of the guide can result the blade veering just a little bit, and from that moment on the board itself can force the saw into misalignment that's neither easy to see or correct. If everything else is right, speed in itself shouldn't matter all that much.

Left: wrong. Right: right.

Thirdly, and most importantly, I sawed with a too steep angle. Using a lower angle should create more surface between the saw and the guide. This also makes the cut in the board act as a better guide. The saw point where the "decision" is made is closer to the guide midpoint.

For the later cuts, I tried to keep the angle low, adopted a routine for moving the guide, sawing as much as by ear as by eye. I tried to hold the guide in place, only pulling it gently and checking it is firmly against the fence.

It is important to have a good, comfortable position from where you can also see the saw alignment. The blade shouldn't bend at all against the guide.

The later cuts were about as perfect as I could hope for.

Measure and mark, use the dummy plane, dummy.

Repeats, as I've already observed, are not very simple to do with these guides.

Ideally, there would be a jig for making similar cuts without measuring each piece separately. But for that I'd have to build a rather large jig.

Fortunately I think it is enough for most cases to do an accurate marking and measurement, and use the dummy blade to simulate the cut. You have to choose how the dummy is placed in relation to the marked lines, and be consistent with this choice.

Errors might compound if pieces are sawed off from the same board, and the new measure is each time marked from the previous cut. The pieces could end up correct width but no longer precisely rectangular. This compounding should not happen if the fence can enforce the 90 degree angle for each cut.

Drawing all lines for all cuts beforehand isn't viable, as the blade thickness is difficult to factor in.

With these techniques I began to make a 38x220x89mm box using MDF slices from 800x450 boards I ordered. (The box is intended to fit a 19 inch standard rack, taking two rack units.)

Spot the mistake

The plan for sawing the material was made in Librecad. This doesn't take into account the saw thickness, so it is just an approximation of whether the material is enough for a box.

After the shaky start described above, the rest of the wall pieces were accurate.

I glued the box together using four Wolfcraft (that brand again) corner clamps and two Cocraft clamps. As the wood glue doesn't dry instantly, there's some time to adjust the corners. Much like with artists' oil paints, the slow drying is a feature, not a bug.

The corner clamps are more for keeping the pieces up and do not itself produce an accurate position.

Corner clamped

Although the Cocraft clamps only give a gentle pressure, without them the box would fall apart.

The bottom was then glued and held together with six small clamps.

I was initially well pleased with the box. But, considering the box was intended to fit a rack mount, I had made a crucial mistake.

For some reason what was meant to be the outer dimension (438) had become the inner dimension and the box ended up being 450mm wide instead of 438. This mistake was made early and I had ordered the MDF material already in wrong size.

Corner clamped and glued

What's even more unfortunate is that I'd already added reinforcing pieces to the inner corners of the box.

I pondered if I should simply build another box, but I couldn't foresee any use for the wrong sized one. The Z-saw guide and the saw came to the rescue. I cut away the ends from side and yanked them off using a clamp as leverage. Then I cut 3mm MDF to size and glued them to the ends.

The end result is not 438mm, and not as clean as the original box, but at least I can continue prototyping. Some day.

Saturday, 31 August 2024

Wolfcraft flip-bit system

The flip-bit attached

Sometimes I just see something and know that eventually I'm going to buy it. A flip-bit system for power drills. More toys.

The idea here is that you can attach two bits, drills and such to the flip-bit and then it should become handy to switch between the two. Two flip-bits can have four functions at hand. If this sounds a little silly, well, it kind of is and isn't. Read on...

Wolfcraft 3086

I confess I somehow thought the bits would flip magically while in place, but that would be far too magical. You yank the flip-bit out of the locking position, pull it out, turn around and turn to lock.

At first the flip-bit didn't seem fast and I felt I had paid for things I already owned.

Also, this is more for garden bench type tasks, perhaps for someone who doesn't have many tools to begin with.

For these reasons, my first impressions were not all that great, but after using the set a few times I started warming to it.

The flip-bit pieces, with bits attached

The bit that does a drill hole and the countersink hole in one pass, is already of some value in itself. The short drill bits act as they have a built-in depth limiter, and these have their uses too. 

Although I must also point out there are situations where the drills might not reach deep enough. Another downside is you're stuck with the 2,3 and 4 mm drills as normal drills are too long and can't be attached to the system.

The flip bit gimmick requires some more forethought than I usually do, but that can only be a good thing.

I have to figure out what I need for the task, for example attach the countersink+drill into the other flip-bit, tighten it, then insert the relevant screw driver bit to the other side.

Countersink tools and a bit for e.g. screw hooks.

The sides are not symmetric, so you can't attach two drills to the same flip-bit. The driver bits are attached magnetically, while the other side needs to be tightened using a hex key.

After drilling the holes I turn the flip-bit over and re-insert it.

This isn't so much about speed. You can learn to switch bits quickly by holding the drill chuck and using the motor to remove/attach them. At least I don't have to fear dropping and losing small parts.

The whole kit

Usually, a second power drill comes in handy when doing multi-step tasks such as countersinks. But the flip-bit largely removes this need, and there's less to carry around.

The positive sides outweigh the few constraints. The flip action isn't perhaps all that great in and of itself, but the set brings together some order and intelligence. It would be wise to keep these trinkets together in the box they came in and not mix them with other gear.

Sunday, 7 July 2024

Z-Saw guide "Best"

Saw, guide and clamped piece in place. Angle ruler just for scale.

Quick on the heels of the Z-saw guide "F" I also got this simpler guide, intended for 90-degree and 45-degree cuts. It also promises to help with parallel sawing.

This is smaller, but it's still quite heavy and the instant appearance is that of robustness and high definition.

It's not simple to claim 90-degree accuracy, and I'm not sure if I can ever expect perfection from something like this. For example, there are more expensive try squares that do little else than verify an angle.

Here the removable guide part is more clearly positioned to the the side of the tool than it was with the "F" guide. I feel more confident about that detail. 

Small but effective.

The guide part itself is smaller and thinner, and I'm not certain it wouldn't sway under the forces hand sawing can produce. It's only secured from the top with two adjustment screws.

Even the first time I could more easily do a 90-degree cut. But I also saw ever-so-slightly lopsided result with a 21x45 profile board – better results may require some experience and the right "touch". But at least while sawing 21x21mm profiled rods, I encountered no problems.

There are two blade thicknesses, and switching between the two means altering between two guide parts, which can be hand-screwed loose and re-inserted in desired order.

The other thickness is the same as with the "F" guide so I could use the saw supplied with that guide and attach the smaller blade with the grip that came with this guide.

The guide plate in place, the angle ruler just for scale.

From the manual it looks like I could just press the device against a wood piece and cut. Hence the rounded "handle". I much prefer to use clamps.

It's actually possible to remove the handle part, giving a more straight surface for clamping, but as it doesn't make a huge difference I left it on. Who knows, the pressure might be better distributed when it's on.

Again, doing repeats has to be figured out by other means.

I set a reference rod side by side with the work piece using a try square, while clamping them together. Then I inserted the dummy blade to the saw guide, pulled it down against the reference and clamped it to position. This needs to be done carefully as the dummy blade bends easily.

Pulling the guide dummy blade against the reference rod end.

This way I could get the length to the territory of less than 1/10th of a millimeter accuracy compared to the reference piece. This doesn't sound that bad but actually is rather annoying if you really need the pieces to be of the same length.

For my practical case this was ok, as gluing and clamping resulted in more inaccuracies than my sawing...

But I could do better by using a dedicated stopper. Also, it might be better to rely on something else than the dummy blade.

For the modest gate-like object I'm making, I needed to have 9 equally long rods with preferably no deviation from the 90 degrees. The method I used, this tolerance was bearable and I was pleased enough with the result. Especially the angles appeared to be smooth.

Another way might have been to clamp together multiple rods at once and attempt parallel sawing. Perhaps another time!

The Best saw guide is easier to use for this task than the "F" guide. I'll look into doing the 45 degree cuts later. Is it exaggeration to have both? Perhaps not, as I have no other silent options for making cuts.

Nice enough!

Friday, 28 June 2024

Tool Time: Z-saw precision saw guide F

Piece clamped into position, the saw in place.

Decades ago, as a naive young man, I bought the cheapest possible plastic mitre box and assumed I could easily create wooden frames for paintings. Didn't happen.

Decades passed.

Now, Facebook ads, of all things, pushed this device that might be the ultimate compact hand-sawing assist. It's not one of those space-eating mitre saw contraptions, here the saw blade passes through between aligned metal plates. It's fairly small and should also help in longer parallel cuts.

Apart from that the guide does any angle, compound angles, it's quite easy to apply and the cut is precise and even.

The dual adjustment for vertical angle.

Adjusting the device is a little trickier. Although it's heavy and sturdy, there's no immediate "lock" for accurate 90 degree position. Sure, there are markers but these are far from the kind of definition you'd find in a vernier caliper, for example. For the vertical alignment, two adjustments are needed. 

Just eyeballing the markers isn't enough to ensure proper angle. Either you use the scribe-dummy plane-cut method as described in the manual, or you calibrate the angle against a smooth surface with a really good try square.

The device is somewhat lacking in surfaces for doing such a calibration. The vertical is easy to set, as there's a lot of surface to put a try square against. The sticker is somewhat in the way, and this is a good reason to remove it.

Calibrating the guide vertically. Here still trying to avoid the sticker.

The horizontal is harder to set, as there's even less surface to work with. But it's possible to lower the guide portion below the table surface level, and "pull" the backside of the guide against a corner of a piece that's known to be 90-degree accurate. (Easier said than found...)

All in all, I believe the guide is meant to support the scribing method described in the manual. So, everything needs to be checked before committing to a cut. The process can be either meditative and interesting, or just frustrating.

Calibrating horizontally against a corner.

Two additional items were included in the set, intended to help identify the correct angle. One is an angle protractor. It is a minimalist item, but testing it against a try square it does produce accurate angles.

The second item is a "dummy plane", a .6 millimeter thick bladeless plane for verifying the marked line and adjusting the guide into place.

The whole circular guide element can be moved vertically, by releasing the knob. This is more essential for the angled cuts, but even with a straight cut it can be useful to drop the guide against the piece as the sawing proceeds.

Some of the extras. The 90-degree guide is attached.

There are also a couple of attachments, a removable handle and two guides. One guide helps with parallel sawing, the other is for cuts. With long parallel cuts, it's expected the saw guide moves with the saw as the cut advances.

I'm not super confident about the guides, as their placement appears slightly less than absolute. I'd also recommend using two clamps rather than one, when attaching to a piece.

A variant of a kataba-type saw (backless, thick, general purpose) is included with the set, and as is with these Japanese saws, it operates by pulling rather than pushing. With the way the guide works, a backless saw is a necessity.

The grip is removable and can be attached upside down too.

Another angle, showing the adjustment key at its home.

A sore point here are repeats, which the device cannot really solve on its own. You'd need a fairly extensive jig/guide to be able to do both adjustable and repeated parallel cuts.

There are nice details, the T-shaped allen/hex type adjusting key has a home inside the guide, and it's best kept there when not needed.

Like I said the ground plane of the guide is sturdy, in addition it is easy to attach to tables and other pieces using clamps, especially after removing the handle (not pictured) out of the way. The plane also has enough holes to attach it semi-permanently to a jig.

Result.

A good try square is needed to test if the result is properly 90 degrees.

I won't pass a full verdict now, as the pieces I've worked with are not that precise to begin with. But it does seem some attention is needed to get best results. I could find some lopsidedness in one corner, but for most practical purposes, the wood end is as good as perpendicular.

All in all, I'm more positive about this device as I gain practice. For anyone who has access to electric saw, it might seem slow, but it's better and faster for the job than anything I've had before.

I likely wouldn't recommend this guide on very thick pieces, and some reviews seem to suggest as much. It's logical, the more the saw comes out from the guide, the more potential there is for drifting. 

For my purposes a guide with a rigid 90 degree angle might have been more useful... and I did actually get another, simpler guide. It's early days, but both seem to have pros and cons. More about that in another post.

Tuesday, 18 June 2024

Tool time: Incra rulers

The Incra set (they have many more models)

Marking/scribing rulers have come some way since I last checked. These are laser-cut, laser-engraved, with built-in templates accurate to sub-millimeters. Although not cheap, they are not dirty expensive.

The straight ruler is the most boring one, and I can imagine only very few necessary uses for it, so I won't focus on that as much. As a part of the set it has a purpose so I don't mind.

The bend ruler markings are only accurate to a millimeter, but the other rulers have a 1/4mm granularity, achieved with rows and rows of offset tiny holes. Here the bend ruler can be complemented with the straight ruler, should more precision be needed.

Bend ruler

The bend ruler, which could be called a saddle ruler, is useful for marking around the corner of a small piece. The end part also helps in scribing parallel to the piece, and finding the centre.

The bend is not in perfect 90-degree alignment, and you have to push it rather firmly against the piece to get results.

The T-square is the most interesting of the lot, and perhaps most versatile. Obviously a straight edge is needed to begin with.

T-Square with some blemishes from my sweaty fingers

The T-square had to be assembled, which made me worry it wouldn't be accurate. However, the parts connect firmly enough. 

Testing the angle wasn't as easy as with a normal try square, as this doesn't work when flipped around. A rudimentary test with marking lines from opposite edges of a machined chipboard looked it would be precise at least in these distances.

To find a centre, it's better to trace from both sides rather than trust a direct reading. This is very simple to do with the Incra T-Square.

Finding the centre from two directions, using the 10mm slot.

A suitable pencil was supplied with two of the rulers. It's worth noting that scribing and marks require some composure and practice, it's not entirely automatic. The pencil tip might be uneven and result in slight inaccuracies.

It may be helpful to decide which side of the hole you press the pencil against, to have more uniform results. I didn't get any problems really.

Some of the ruler positions have slightly diamond-shaped holes, which I guess would help in making the trace more accurately.

The macro lens adds some fish-eye here, the ruler is obviously straight as a rail.

Although these rulers are probably mostly intended for high-precision woodworking joinery. I make rather modest boxes, as can be witnessed from my blog. Even then the added accuracy can help, so they are not going to remain unused.

These rulers are metric, but for through-hole electronics related tasks an imperial set might make sense.

For just doodling around the set would be somewhat expensive, but not as expensive as Woodpecker T-squares. Although I have my eye on some of them too.

Another macro shot, detailing the pencil head connecting with the ruler.

In woodworking it's often more desirable to use repeatable settings and jigs, rather than following markings one by one. Drawing the intended cut and then cutting it, can result in a poor procedure. With hand tools you might not have a choice, though.

Oh, and a ruler can be called a "rule", giving rise to the "Incra rules" pun on the rulers... but perhaps they do?

Tuesday, 30 April 2024

My Joystick

I had a few arcade-style joystick parts lying around, cannibalized from the iCade gimmick for the early iPad. I felt it was time to finally build an Atari/C64/Kempston joystick.

As usual, every new project needs some more tools or parts I didn't have before.


First experiments

I took some hobby-shop 3mm chipboard and simply began fitting the parts together.

This board was mushy, and when drilling it felt closer to cardboard than chipboard or wood. Besides the messiness, it worked well enough.

Some of the parts

I drew a rough 8cm x 10cm area for the joystick as a sort of minimum estimated fit for the parts inside. At this point I'm not sure how big it is going to be.

Protip: Do the central hole for the joystick shaft first, it will be easier to do the holes for the screws afterwards. Or just be more careful with the pilot hole drilling.

The joystick part has a kind of extrusion at the root of the shaft, which would require a 21mm hole. This caused some woes at later stage.

Here I'm still searching for the fire button positions, not following any existing measures.

Drilling with the 24mm flat head (wrong size)

 Arcade buttons are like icebergs, there's a lot more of them under the surface. So I have to put healthy space between the joystick shaft and the button. This can also make the case very tall.

After drilling the hole for the fire button, I found out I could not fit the part!

It turned out I need a 28mm drill and not 24mm. Not sure why I thought I owned a correct size.

This was the time to throw away the first test piece, I won't even dignify it with the name "prototype". Tiny problems and mistakes accumulated and there's no way I'm going to re-drill an existing 24mm hole into a 28 one.

Second attempt

As I would almost definitely need the 28mm drill, I thought I should get a 21mm too for the joystick shaft fitting. After the purchases I of course found at I did really already had a 28mm drill...

A 21mm flat drill isn't really a common category. 21mm fluted drills are more common, but I somehow suspect I'd be better off with a flat drill here.

A hole saw is a possibility, but the set I used for making my chess pieces doesn't have the correct sizes and I suspect they aren't accurate enough. 

I have no experience of the more robust looking hole saws, but I tend to think these are for rougher work anyway, such as making holes into drywalls.

Adjustable flat drills look a little shoddy as a concept. I felt it might be enough for the few shallow cuts I need, so I ordered one.

The first impression was that it is a rather crude instrument.

A clunky but perhaps necessary tool

I didn't get how to use it at first, the bite was unnecessarily hard, and it is difficult to use the power drill to get anything done.

After breathing in and out a few times, I properly sandwiched the board with a piece of wood, clamped the whole thing and had another go. It's one of those tools that requires a little patience and just the tiniest amount of skill.

First I drilled a normal 6mm hole through the sandwich so the drill/screw part in the contraption itself doesn't get stuck. 

This worked, the only remaining problem was adjusting the blade to 20.5-21mm. The markings on the blade are not especially useful.

It shouldn't matter too much, if the extrusion doesn't fit 100% snugly, but through trial and error I reached a fairly accurate result, after which I don't need to change the adjustment.

It's worth checking the blade really goes through the board and cuts the underlying wood fully, otherwise there's the tedious task of removing and filing away remnants.

The blade and the drill hole need to be constantly cleaned of fluff and dust.

This material is crap for drilling

The result is clean enough, any inaccuracies and muddiness is probably due to the board material rather than any problem with the adjustable flat drill. Still, I suspect there might be better variable drills.

The problem with the arcade buttons is the height they give to the box. They were meant to be installed to the arcade cabinet, after all.

I already became a little tired with the project, and continued when I got better parts and materials.

Some time passes: 3rd attempt

Here I switched to 3mm MDF board, which results in far more accurate cuts and less "fluff".

The 21mm hole was still a dirty process with the clumsy device.

Ahh, nice and smooth MDF

The 28mm blade was excellent, the bite was just perfect and it didn't take long to push through the 3mm thickness, using a 6mm pilot hole.

It's easy to overestimate how things fit in a small space, so I headed for a larger rather than smaller box. I can make a new box some other time, if necessary.

I ordered shorter arcade buttons, so these no longer determine the height of the box. The stick mechanism is now the tallest piece inside.

I ended up making a 151 x 115 x 42 box.

Putting the box together is a little tricky at first

The 4 screws next to the joystick are 3mm machine screws, there are also two more connection points that can be used.

I glued the outer walls together carefully, without applying too much clamp pressure. This is a precarious moment in this method, but it's also easy to move the parts as the glue isn't too quick to dry.

I don't favor superglue/glue gun approaches as I feel the results are either brittle or messy.

Another layer is added, at the same time giving a sort of rebate for positioning the case bottom. I used some more clamp pressure here.

The project is moving forward

Small slices were added to the corners, giving some substance for screw holes. Again, these slices are clamped together using glue, so the overall package should be quite sturdy. I still suspect the box might give up if it fell from a table at a vicious angle.

The 9-pin cable is from a dead Tac-2 (and believe me it is dead). I'd prefer to create the cable from new parts but this will have to wait for another time. At least the joystick cable has the nooks to keep it firmly attached.

I added a tiny protoboard piece with the necessary soldering for a "ground rail" and a pin strip for continuing the U-D-L-R cabling.

This way I can still alter the configuration.

No matter how simple the project, all elements ought to be have some planning beforehand. The cabling is a little messy but with some luck everything fell into place well enough. 

The box is then shut with the cover, using four small countersunk screws. This solution doesn't use machine screws and bolts, I don't expect to open and shut it many times.

After some minimal sanding and filing of the sharpest corners, it's off to testing.

Some of the tools used.

First games

I took the stick over to my Arduino USB adapter and played a few games on the C64 emulator and Mame. At first I held the joystick on my lap, as the box didn't have rubber feet.

Instantly I can feel the iCade-sourced joystick isn't that great (it wasn't back then). Despite the microswitches there is something ambiguous about it, and it occasionally feels like gears grinding each other. (Edit: Some WD-40 improved it a little.)

In addition, at least to me proper arcade sticks don't work as well with Commodore 64 games, where I'm used to the Tac-2. I'm again looking at games with crisp controls, The Great Giana Sisters and Buck Rogers. After playing some more I can get used to it.

Things felt better with ZX Spectrum evergreens Bruce Lee and Saboteur. Many Spectrum games are a little sluggish and more lenient to begin with. Simulator-type games, such as Elite, are even slower, but for other reasons these are often better played on a keyboard.

Moving over to arcades, Mr Do's Castle and Commando (mind you no grenades) on Mame already felt a little better. It's closer to how it's supposed to feel, if only the joystick part was better.

The final touch for now.

The box makes the microswitches sound quite loud, but that might be another failing of the stick part type. The buttons are more silent.

It remains to be seen whether I need to make another, "final" prototype, or if this is enough after adjustments. I can look at making it more gentle on the hands, and maybe damp the sound somewhat.

Friday, 8 September 2023

The Raspberry-based Z88-wannabe

After playing with the portable Cambridge Z88 computer and reading little more about devices such as Amstrad NC-100, Epson HC-20, Husky Hunter/Hawk and the Tandy TRS-80 Model 100 (Kyotronic KC-85), I began to wonder if anything exists currently in the same form factor.

There are a few keyboard-display hybrids. There's the Ficihp K2 keyboard with an integrated display.  Another is a BQAA RGB keyboard, which looks larger with keypad included, and something called Kwumsy, a very similar concept.

These hybrids do not contain a computer. Expensive, and apparently geared more as an add-on for gamers and such, I passed these opportunities as something that wouldn't work for me and not easy to hack into a full portable computer.

But it became clear that mass-produced screens must exist for such devices, and I started planning my own version.

*** Some of the details are left vague on purpose – for inspiration only! I'm not responsible for destroyed Raspberries, lost data and house fires other than my own. ***


Model 100 or Z88?

Exactly ten years after building a wooden prototype to house a Raspberry Pi, I felt I could hodge-podge something together without going too deep into electronics or software development.

And yes, many have hacked Tandy Model 100-inspired cases for Raspberry, or even used an original case. Model 100 was far more widespread and better known than the Z88, especially in the US.

Hobbyists and crowdfunders have built some Model-100 successors, such as the Clockwork DevTerm, and the Ready! Model 100. Just looking a these makes me feel I don't want all that clutter.

My concept:

A no-nonsense slab computer inspired by Cambridge Z88, mostly for writing.

-Large-font terminal for focused text editing etc.
-No GUI/Desktop/Browser
-No mouse, no trackpad, no nothing
-No connectors
-Flat rubber keyboard if possible!
-Wifi is still needed there to install software and easy transfer of files

I would not break my Z88, and my project is not about building a computer inside that case. I probably couldn't get the parts to fit there anyway.

Well, off to hacking.


The screen

I started by hunting for a suitable display. The Z88 original design depended greatly on the availability of a particular LCD display, and I have a very similar design constraint here.

I would have liked to use an e-Ink display just for the added weirdness, because I've seen videos of people connecting them to Rpi. But I couldn't find anything close in the aspect ratio and size range I'd need. It's either book page territory or tiny electronic price badges.

Some of the first tests with the display, running Raspberry OS

Eventually I decided on a Waveshare 10.9 inch HDMI display with 320x1480 resolution. Another option might have been an 8.8 inch screen with 480x1920 resolution, but the proportions didn't look that inviting. And yes, the 320 is the default horizontal resolution!

It's a touchscreen, but I'm not going to use that feature.

I ordered the Waveshare from berrybase on ebay and received it soon enough. The package included the screen, HDMI cable, USB power cable, and an assortment of screws, stands and USB adapters for different Raspberry models. There's also a cloth for wiping the display clean.

Just connecting the HDMI to any old output of a computer doesn't work, the computer needs to have drivers. And fortunately the Raspberry Pi OS has that, and the product is clearly intended to work together with a Pi. 

It is a good idea to do the initial tests with the basic OS without jumping into the Lite OS or some other build.

The configuration is clean, but a little tall for my purposes.

A fresh desktop is a little annoying as the initial dialogues do not fit the narrow screen. Remember, the screen is horizontal in the 320-dimension. But after getting through this, it's possible to use the OS screen/display functions to rotate the screen.

A better way to do this is to adjust the config.txt and the display parameters prior to booting up.

With some more fooling about, I had a correctly rotated terminal screen using a 16x32 font (sudo dpkg-reconfigure console-setup). This gave me a chunky-looking 93x10 character display, inspired by the 8-line Cambridge Z88 display. After that I began to think of installing the OS lite version without desktop on a separate card. More about that below.

I feel the shape of the screen is quite close to what I want, and the product connects and displays the Pi screen with no big hassle. All in all this stage was a lot easier than I thought.

Battery

I did the initial tests with PSUs, but I was eager to start planning and building the case itself.

A thin battery would be desirable. There are really small products that cater mostly for no-display, low power operations. The JuicePi hats look a little daunting, eating all that space would be a little counterproductive.

A battery should run the Raspberry for many hours and the screen is likely to eat up power. So I tried to look for something sturdy, such as a power bank.

I bought an Insmat Exclusive PD3.0 Super Mini 10000mAh power bank, because it happened to be on the shop shelf and had promising enough parameters. It's about 18mm thick with 2 USB-A output sockets. This made it possible to power both the screen and the Raspberry instantly without any modifications.

10000mAh sounded like a minimum, a ballpark estimate says I might be able to run the Pi and the screen for a couple of hours.

I wish there were more flexible backlight options on the Waveshare, I could live with a relatively dim screen in this context. A similar display with ISP technology seems to have more options in this regard. Here, even the lowest setting is quite bright. Only in a very bright office environment it begins to look dimmer in comparison to other displays.

The power switch

There are a lot of tutorials on how to build a safe power on/standby switch, but nothing very reassuring about cutting the power physically. I think it should be safe to cut the power after I've issued the shutdown command, just as I have to do anyway when I pull off the cable.

I tried powering the screen from the Raspberry 5V out, using only one USB out from the power bank. This should be the same as sharing the input of the MicroUSB. But although initially promising, this seemed to cause problems and undervoltage, so I reverted back to using the both USB power outs separately, as it appeared to work better. Fortunately I have a switch that controls two separate power lines.

I'll discuss the undervoltage problems further below, it's not certain that powering the screen from Pi was to blame.

Keyboard

The first keyboard connected was a quality Apple Mac mini keyboard. This was all well until I noticed I had trouble getting <|> keys from where I'd expect. Changing the settings from raspi-config seemed to do nothing. Oh well.

I'm not going to mutilate the Apple keyboard for this project anyway, so I went for my old Deltaco TB-5V. Which, incidentally, mapped correctly.

This mediocre mini keyboard was cannibalized already before and it'll live again for this prototype. It's not quite as wide as the screen, which is fine. The keyboard model is rather good for repurposing, as the controller is still a simple separate through-hole board and the connections are easy to understand. I de-soldered the LED lights as I have no room for them.

I did look into the idea of using a laptop-specific keyboards, but getting them to work on a Raspberry is not as simple as plugging in.

First attempt, will everything fit?

For a more Z88-like experience, I wanted to use rubber keyboards.

Aliexpress does sell the aptly named 85Keys Foldable Soft Silicone Mute USB Wired Mini Keyboard Computer folding keyboard Accessory, but this has an annoying lump at the left side so it's a no-no.

Having that lump appears to be a common feature in rubber keyboards. Wetkeys sells soft-comfort rubber keyboards without a lump, but they also have a numeric keypad which makes them far too wide.

I'll forget about this angle at least for now.


Raspberry Pi : Putting it all together

From my loose assortment of Raspberries, I have a choice of 1/2/3. As I'm going to run a Linux terminal there with no graphics, I could even use some of my older Pis.

Explosion. The screen is still "upside down" compared to the final arrangement.

I settled with 3B+ for the moment as the Waveshare promises to work with it. I need to mod the Pi so I'd prefer not to alter the earlier models which might become museum items.

Admittedly, the 3B+ uses more power than many other models, and in the future it might be wise to consider Pi Zero W model for such a modest purpose.

The logic of getting the screen to work and rotate correctly may be a little different depending on the Pi model.

The Waveshare product included the screws and stands to fit the Raspberry below the screen, and at first I did just that. The HDMI-HDMI connector dongle is a neat addition which removes the need for a bulky, inflexible cable. The power cables however stick out from an unfortunate angle, which can't be helped now.

The HDMI-to-HDMI is neat, but the power cables are still in the way. Keyboard controller at right.

The Waveshare concept pointed to overall device thickness in the 40mm territory, which was a little too tall for me. I looked into how to either reposition the Raspberry or remove the tall USB connectors and the ethernet connector, and using lower stands.

Trying out various loose configurations, I kept coming back to the way Waveshare intended: Raspberry screwed together under the display. To get at 30mm thick device, I changed the 25mm stands to 15mm and removed the bulkier elements from the Raspberry board.

It might have been better to get a Raspberry 3A+, which is thinner, but I was a little impatient and some Raspberrys can still be a little hard to find.

Smashing away the USB connectors.

Removing the Ethernet connector with heated pump and soldering iron was almost possible to do cleanly. But for the USB it was far easier to just peel it open with pliers, cut and crush the parts inside. Then cut the wires and solder wires on the remaining "pins".

Sadly this means breaking and throwing away perfectly good parts. But now at least I could fit the display on 15mm stands, bringing the overall thickness to 32mm (The MDF board is 3mm thick).

Ultimately the battery height of 18mm under the keyboard decides the height of the computer, so there's no benefit in getting the screen any lower.

So, it's rather bulky compared to the Cambridge Z88. As a minor consolation, at 292x190x32mm the depth of the computer is at least less than the Z88. The chunky chipboard appearance is rather nice.

Figuring out dimensions in a LibreCAD section.

As mentioned, I eventually got electrical problems, at least the Raspberry was eager to show the "undervoltage" warning occasionally.

I really started to get these only after packaging the whole thing and connecting the power switch. So, this might be due to bad cables, connectors, soldering, or whatever.

But it might also be that this particular power bank doesn't give power evenly, and the display is such a power hog the intake will easily drop below the minimum. I don't have very clear specifications about how many amperes the display would like, Waveshare site suggests 3A and that's also the power bank nominal output.

The power bank specs are unclear about whether the separate outputs supply 3A at the same time, so I assume it the value is for the total.

The 3B+ Pi model is apparently a little finicky about the power input, whereas an earlier model might complain less. However the 2B doesn't have wifi, which would be a little too limiting. And besides, it might be a good idea to actually have these warnings so I know it is an area to be improved.

After I fiddled with the connectors and the wires, and gave the power bank a good recharge, I stopped seeing the undervoltage warnings. But the wiring inside is still a problem area and I'm not going to show that mess now.

The below image sketches out the basic case shape and especially the keyboard holder, but it's not a precise indication of how it was built and what kind of parts were used. I used clamps and wood glue to pile together 3mm cardboard and MDF pieces.

This Blender model was made after building.

OS and Software

Although the Cambridge Z88 served as a point of departure for this computer collage, I'm not looking for actual Z88 simulation here.

But just for fun I looked at software that could create a somewhat comparable experience, using the 93x10 character terminal as a tribute to the 8-line display of the Z88.

So, goodbye mouse and x, I use terminal-based Linux to boot into the command line, and launch Nano the text editor for productivity.

I installed the Raspi OS Lite on a new card, and adjusted the config.txt to accommodate the display format before even booting it the first time.

sc-im on

There's less hand-holding than with the full OS, but it's not difficult because almost everything can be handled using the raspi-config. (sudo raspi-config) I am glad I am somewhat more experienced with Linux and Raspberries than ten years ago.

First it's necessary to set the wifi country, the wifi SSID and passphrase itself. Again, using raspi-config. Only after that the network is accessible. Or use ethernet, unless someone has pried it off(!)

It's also useful to set the timezone.

There are some tricks to whittle away boot time, such as removing boot delay and the splash screen. Some services, such as the network, could be shut down – if the intention is to lose the internet. 

Reducing processor speed could also decrease power need, but perhaps not in total as the tasks will take more time to achieve.

The font and font size are best handled through sudo nano /etc/default/console-setup

Some initial software ideas:

Nano ought to be launched without the space-eating shortcut display. I would also show line numbers, as there's no other simple way to show where I currently am in the document.

nano -x --linenumbers --softwrap testnano.txt

-x disables the list of shortcuts at the bottom of the screen.

The --softwrap in the command line activates soft line wrapping, so the text contents of a line are always seen on screen, which depending on preference might be desirable or not.

Nano reconfigured. (Linux Mint screencapture)

I could try to add some of the Z88-feel by running the PipeDream hybrid spreadsheet/text editor software that was central to the Cambridge computer. After all it was available for multiple platforms, including DOS and Windows.

DosBox could run Pipedream DOS version and Rakewell offers a download for free.

Using emu2 I can run DOS text-based apps via terminal, which sounds interesting. After installing git, I could clone the repository and compile it.

https://github.com/dmsc/emu2

PipeDream on emu2. (Linux Mint screencapture)

PipeDream is far too troublesome to run in the limited terminal screen I prefer, as in the DOS way the screen is assumed to be of a fixed size. Troubles begin when you have to scroll the screen. From the little time I used that software on the Z88, I found it fine for that computer but have no great desire to see it running here. So I'll pass.

For a terminal-friendly spreadsheet, I installed sc-im the terminal-based spreadsheet. This requires some more compiling and fiddling with git repos, but it was do-able. The software isn't very simple, though.

https://github.com/andmarti1424/sc-im/wiki/Ubuntu-with-XLSX-import-&-export

sc-im (Linux Mint screencapture)

From apt I could directly install calc for calculator, or just use bc. These aren't particularly visual, though.

Calc is not to be confused with cal, which simply shows the month calendar. Which is, logically enough, installed through sudo apt install ncal

Again, hexcurse for hex editor, or hexyl for just viewing hex.

I tried Ranger for file listing. It can actually work as a kind of launcher for other apps, but I also found it to be bit slow to init on the Raspberry and maybe not that useful at this point.

Tmux the terminal multiplexer can enable complex task switching, splitting of the terminal screen and generally toying around. Obviously using ALT-F1, F2 ... etc it's possible to switch between logins and it might be enough, but with tmux I could have a text editor running on the left side of the screen and a terminal prompt on the other side.

The OS Lite has Python already installed for programming tasks, and the Raspberry GPIO pins can be controlled from there. Obviously the GPIO pins are not very accessible here.

Browsing could be a possibility, by using lynx or w3m.

For games, I installed Gnuchess. In my preferred 10-line terminal, the program doesn't display the game well. If it wasn't for the pesky "Thinking..." text, the board would fit. Using "show board" after each computer move works, though.

With the smaller font I could play roguelikes and...

But this wasn't supposed to be a web-browsing and gaming platform. I've installed so much junk already, the idea of a very focused computer is beginning to get muddled!


Some notes

What about emulating Z88 itself?

I would have liked to try this, but I couldn't get ozvm to compile easily even on a full desktop Linux Mint, and I have my doubts about getting it to work on a Raspberry OS. I gave up on that angle at least for now. Using the Circle environment, it might be possible to create a comparatively "bare metal" Raspberry Pi emulation of the Z88 computer, as people have done with ZX Spectrum. Someone would need to do that hard work first.

If the aim is to create something that fits inside the original Z88 case, this is not the solution as the screen itself is already too large.

I'm already somewhat through my "Z88 phase", and having a Linux terminal is really just more powerful and flexible. In the future I could look into reducing the boot time, which is still something where the Z88 really excels at. Oh, and also the Z88 battery life is much longer, but at least I can recharge the power bank.

Boot time is more than 20 seconds

If I have ever learned something about building stuff is that a detail not taken seriously during the design process is likely to end up haunting in the build. For this box, things like how to recharge the power bank, or how to change the SD card, were not really thought about that well. Therefore they ended up relatively unresolved. To recharge, I currently remove the keyboard and pull out the bank. For the SD card, fortunately I might not even need to change it.

As far as casing projects go, this was in some ways one of the simpler ones, as the display and keyboard are dropped in and there are no ports to consider. Perhaps I should have made 25mm thickness into a hard constraint in the beginning, but 32mm isn't really that bad.

Like I mentioned, the problems are more in the electronics side of things, and I haven't yet reached a conclusion. I have already seen the power bank last for the 2 hours I hoped for, although it looks that the undervoltage issues increase in proportion as the bank depletes. I may report back once the power bank has seen a few more recharge cycles.