Sunday, 8 February 2015

ZX Spectrum Pi2 USB Keyboards

I've designed two versions of the new PCB for the ZX Spectrum USB keyboard. This is the second version, one designed specifically to fit with a Raspberry Pi B+ or the new Pi 2 model B. Space is at a premium inside the Spectrum, so it becomes a bit of a 3D puzzle fitting it all in.
Here you can see the Raspberry Pi fixed to the bottom of the case, and the USB keyboard PCB, which is normally fixed to the lid of the case. There is a cutout for the Raspberry Pi USB sockets, and it just rests on the back of the LAN jack.
The new version of the board has a DC jack socket located where the original Spectrum power socket would have been. Power is taken from the DC jack to the micro USB socket on the Pi. So many of the problems people have with Pi's are due to cheap phone chargers or dodgy micro USB leads. The 2.1mm DC jack ones seem to fair a lot better. I usually wire this directly to the Pi, but I'm trying out a rewirable micro USB plug here.
It mounts to the underside of the lid as with my other USB keyboards. Here I'm using a new membrane with nice long tails, although like the standalone ZX Spectrum USB keyboards, it can cope with original membranes with damaged tails.
There is space where the TV modulator went for an HDMI socket to be mounted to the base. Ideally, I'd find (or make) something to direct the HDMI connector to be inline with the other sockets at the side of the board, but for the moment, I use a short extension lead. The recent versions of the Pi are easier to deal with as there are mounting holes, so it is fixed to the base was some coutnersunk M2.5 screws to match the existing screws.
I normally remove one of the double USB sockets and replace it with a single one and wire the USB keyboard into the other USB port. Power and USB data is send via the cable between the two halves.
The last build I did, the customer requested the option of being able to use it as a standalone keyboard as well as with the pi. This is the second time that has been requested, so I'll look at adding that as a standard option on the next version of the boards.
On this occasion, I used an offcut from one of the other USB keyboard PCBs and mounted a USB socket next to the Pi.
The power is now isolated from the USB keyboard, so it does not power the Pi when used as a standalone keyboard. To use it with the Pi, it needs a loopback cable into one of the USB ports.
To use it as a keyboard, disconnect all the other leads and just use a normal USB A-B lead in this new socket. The normal build doesn't have the loopback cable (I think the one below was a conversion of a customers own Spectrum, hence it is a little more battleworn that usual).
Of course, these need lots of testing with the Fuse Spectrum emulator running under Raspian.
These keyboards were reviewed in Micro Mart last year, and got the Editor's Choice award and a score of 9/10.
The ZX Spectrum USB keyboard with integrated Raspberry Pi is available from my Etsy store. Currently with either the Raspberry Pi B+ or as in this case, the new Raspeberry Pi 2 model B. The quad core processor and extra RAM make it faster, and should support Ubuntu and Windows 10 when released.
[Update: it seems to expectation of Ubuntu and Windows 10 is slightly exaggerated, both look to be non-gui versions for IoT devices etc., not full desktop operating systems. However Raspian is still there with a full desktop and runs very well on the Pi 2]