Jump to content
IGNORED

Mechanical Keyboard Pi Emulator


Markeno

Recommended Posts

I picked up a Pi400 in hopes to use it for some Emulation.  It has the power, the keyboard is ok.  I want a few more things, more of an all in one, and prefer a little better keyboard.  I don't care for the USB C power, the micro hdmi, the sdcard.  I have had several sd cards fail over the last year and a half, sure either defective or cheap cards, so be it the best card won't be a SSD or NVME drive for reliability.

 

I am not that skilled at 3d modeling, but I decided it is a project I was going to look into.  I found a post of an Amiga inspired Pi400 3d printed case.  I can't find the files or similar files available for download.  I decided if I am going to have to start over, that I was going to go with a mechanical keyboard.  Using a Pi400 would be a nice shortcut and simplify some things, still I think the end result will look and feel better with a different keyboard.

The keyboard is reasonable to reuse, it was cheap, it is nothing special.  I worked to recreate the lower frame that the keyboard screws into.  I have 3 posts to work on, and they are currently a bit to short.

I should be able to fit in the 4port USB3 Hub, RJ45 Keystone jack for ethernet, safe shutdown button, internal Meanwell 5V 5A powersupply, 40mm fan, dual full size HDMI ports, 3 DB9 Joystick ports. Possibly putting in Composite Video as well as Audio out since that is an option.  I am also going with a 2.5" 240gb SSD for the OS.

Currently the shape and size is quite similar to the Atari 800xl, the look is also similar to a TI99/4a maybe because the keyboard is missing.  Certainly there is not much style there in the design.  I need to work in the ports, work out how to split it for taking the top off as well as securing it.  It is also too wide to be able to fit on my printer as one piece. 

If someone knows of a similar project that I could just print and go, then great I would love to find that out.  I wouldn't expect it to be exactly like what I am going for. 

I think now that I have basic shape down, I need to fix the keyboard posts.  Then the next real bit is working out the top cover mounting and removal.  I also need to work out how this can be printed and all the considerations that need to be taken into account based on that.  I am actually thinking of removal of the keyboard tray as a separate part.  That would make printing the lower section easy, as well as the top cover.  The remaining bit then would be how to split and join the panels as well as the keyboard tray.  Separating the keyboard tray would also give me the easy option to make it overhang the edges and narrow lower case and back a bit. 

Once that is worked out I need to work out part placement inside, and mounting.  Work out all the openings in the case as well.  When that is done, or nearly so it needs a bit more style than a flat square box.  I probably won't get too fancy though.

In the end this can run Retropi and be setup to emulate many different computers.  I have a number of now retro computers, but I decided I am running out of space. I don't want to keep collecting them all and not be able to use them.  I figure if I go with this type of setup I can have it setup and use it in place of various systems rather than unplugging one to connect up another any time I want to use a different system.  Doing that causes me to not really do anything with most of them.  I like working on them, I like figuring them out and I won't get rid of them. I will probably collect some others as time goes on, but most are getting rather pricey and getting outside what I am prepared to invest in them.  I want a few systems that I really don't see myself getting due to cost these days even beyond the space concerns.  The Pi400 would be ok, but it is so small, has all those fiddly wires off the back and while sleek it looks way to modern.

I guess a post like this is ok here, and that is not why I am not seeing similar projects anywhere.  The intention is to work this up to a point that I can post the design files for it if someone else wants to make one.  I think the main concern there is the keyboard, I am using a specific keyboard, and I doubt many will fit the footprint properly.  That may be a good reason to make the keyboard tray a separate part as someone would only have to rework that section. There may be issues with various usb hubs, or some other bits, but I am looking to make it as universal as possible.

2021-10-17.png

2021-10-17 (1).png

2021-10-17 (2).png

Edited by Markeno
  • Like 2
Link to comment
Share on other sites

On 10/17/2021 at 10:10 PM, Markeno said:

I picked up a Pi400 in hopes to use it for some Emulation.  It has the power, the keyboard is ok.  I want a few more things, more of an all in one, and prefer a little better keyboard.  I don't care for the USB C power, the micro hdmi, the sdcard.  I have had several sd cards fail over the last year and a half, sure either defective or cheap cards, so be it the best card won't be a SSD or NVME drive for reliability.

Well sure. SD & microSD cards are not designed to act as any sort of hard disk, for any sort of OS. Their wear level algorithms are not tailored for such applications. Standard SSDs fare much better, and NVME even more so.

Link to comment
Share on other sites

The pi400 would be a fair bit nicer if it had included the option to install a SSD or NVMe drive internally.  I still wouldn't like the usbc and microhdmi connections long term.  They are fine connectors, but a keyboard will be slid around a fair bit and I don't trust them to be robust enough for the way they are used.  The Pis are made for a price point, and they are great for what they are, but it does leave them lacking in some areas.  They don't cost the kind of money those C65s.

I split off the keyboard area as its own part.  The keyboard standoffs should be corrected.  Then I narrowed the back section.  I can print the bottom, as well as the sides/walls as a single piece on my larger printer. The top will basically be the a flat piece which will be screwed on.  I guess I could print it will tall support screw standoffs with screws up from the bottom, but I find that such parts often crack or sheer off a 3d printed part.  The keyboard frame area will still be to large for the printer to do as one piece.  That is unless I wanted to stand it up, which I don't.  Everything should fit fine, but I know all the somewhat bulky cables are going to take up a lot of space.

I'll be working on how to secure the top plate and keyboard tray area to the bottom.  Then I guess I'll move on to component placement, standoffs/mounting holes and case openings.
 

Link to comment
Share on other sites

It may almost be workable.  The 2.5mm SSD doesn't fit well.  It will be attached to the top cover plate I guess.  A NVME based usb adapter would probably fit better depending on the length and the cable etc.  The keyboard tray is split to fit on my printer, but it needs modified to print in a manner that will be properly supported.  I have all the ports cut in, the mounting holes in for the Meanwell supply, the Pi4b (but the tops are wrong on those posts), and the 4 Port USB 3 hub.  I am doing a test print of the base, it it all fits I can possibly use it, but it is such a tight fit on the printer that I am sure part of the left side is not printing.  I think enough will be there for the wall to be solid, I am not sure if it is my offsets in the printer costing me a little space.  It slices fine, but cuts off the edge while printing and it is not to the edge of the bed..

The colored parts below are placeholders for the Meanwell power supply, the 2.5" ssd and the Pi. The keyboard base post layout was in Designspark Mechanical which was reasonable to do in it. I just barely know anything in there having only worked with it to modify some existing models at one point for another project.  The rest is in Tinkercad with the fan grill modified from a file on Tinkercad, the DB9 is a Trapezoid also downloaded from Tinkercad cheated into about the correct shape (I'll see if it fits if the print doesn't fail), the Keystone Jack mount was downloaded from Thingiverse.  Last night I tested the fit of some of the backplate openings.  The IEC Power opening, the fuse holder opening, the single usb port, the reset button and the Keystone jack (for Ethernet).  The hole for the Reset Button was too small.  Provided the print goes well, I will know if the Reset button fits now, if the HDMI Ports, the Fan Grill and holes, the RCA Jacks, the DB9 Joystick ports, and the USB 3 hub are placed properly.  I am not sure, I tried to be careful.  I don't like Tinkercad, but I don't know how to work with Designspark Mechanical enough.  I didn't want to take a month or two learning it or something in my free time.  I did try Freecad, but I didn't like that, and seemed it would take as long to have a chance working with it.

I am missing a Power LED and Drive Activity LED.  Certainly a power light is easy.  I was wanting a drive activity light though, that seems practical if your using the MicroSDCard, but for a USB based solution not so much.  I think I will tinker with that later, I just don't know if what I found on it is compatible with RetroPie and or other things I may use with it.  The LEDs will go in the top cover plate, I figure I will use rectangle LEDs.  It may only be the power LED though.  There is no power switch, for one there is barely any room for one, and it risks someone thinking it is a good idea to just flip the switch without doing a safe shutdown of the Pi.  I haven't gathered if safe shutdown is required for SSD and NVME or other USB attached boot devices.

I think I can get the base part to fit on the print bed, I don't want to rework it all to be 2mm narrower.  It is exactly 300mm wide which my printer is 310x310 so I figured I had 10mm of space to work with, it does seem I can't get to 310 as it sits though.  I did get the 300mm wide print out of it in the other orientation, but the corner lifted early in the print so the way it is now I can better see what is going on with the print on the camera.  I think it is because I adjusted my offsets to miss my bed clips, still I can squeeze a couple more mm out front to back on the bed and be safe still.  If this base works out, then I'll finish the keyboard tray with that one correction and do it next.  The top cover will be last as it is simple short of knowing if I am doing 2 LEDs or just one, maybe some decoration on it.  It is going to be ugly inside with all the connecting wires.  2 hdmi cables, the USB 3 cable the awful oversized 2.5" drive to usb adapter...  At least there is a little room under the keyboard area, I hope to be able to tuck some of the wires into there.
  

 

2021-10-23.thumb.png.1cc69b224a3a8fe46d3951e22f215111.png730921275_2021-10-23(2).thumb.png.44d797a1cb343fb820debb94072267fc.png275903781_2021-10-23(1).thumb.png.54492c5872d725311f32daa1490f2bdd.png1926881755_2021-10-23(3).thumb.png.fbc035e24d25a11586a27926539ae182.png

Edited by Markeno
Link to comment
Share on other sites

  • 2 weeks later...

I have been doing some more work on the design.  I did some test prints of the prototype parts, as well as some small sectional test parts to check various fit and alignment issues.  The top cover is easy, and may work out without a reprint, unless I find I need improved ventilation.  The two parts of the keyboard tray each have some mistakes in the posts, but I believe they can be made to work without printing new parts.  I am making the corrections to the keyboard tray parts, I just may not have to reprint them.  The test of the main case part had many issues and I will certainly have to print the revised model.  I hope to get it together in the next week or two, the main case body takes my printer about a day to print, and I am not quite ready to start reprinting it yet.  I made a compromise on the two LEDs, one will be a Power LED as I planned, the other is an activity LED, but not drive activity, as I am using a USB connected SSD drive, that doesn't seem natively supported to gpio.  It seems SD Card activity can be moved to the GPIO reasonably, although I couldn't verify that operation.  I will be making the status LED a CPU Activity light, it will look similar to Harddrive/disk access when in use.  I don't know why but I am having issues with the safe shutdown button as well, all other Pi3 and Pi4 projects I have build I have used the same process for safe shutdown buttons and it just won't trigger on this one.  It is the first I have used a SSD Drive, maybe it is something with the current build, or some feature that has installed.  If i2c is on it won't work on the default pin, but it would still work on other pins and I can't get it to work on any pin.  I don't know if it is related to the Pi4 I am using, it is my spare Pi4b and was replaced due to suspected issues with it.  I didn't have good evidence that it was the fault though.  Now Pi4bs are in short supply to get a replacement..  I am sure I will get another at some point.  I figure I will take and put one of my SD Cards into it and see if the button works then, and also possibly take the SSD and connect to my Pi400 and see how that behaves..

I recently found a Pi400 case project posted in another area of the forum which is very interesting.  I became interested in creating this project due to seeing a Pi400 Amiga inspired case project.  I was disappointed nothing similar was available for me to make my own case.  I was first thinking of doing a Pi400 based case, but I felt working out a good fit in the case for the Pi400's rounded shapes would be much more difficult for me.  Maybe such a project would be more useful for the general public, not having to source a specific keyboard to use as the 400 already includes one.  I do intend to release the files for public use, once they are pulled from Tinkercad they won't be as easy to modify though, but it may be of some interest to someone.  The Pi400 case I saw recently, seems won't likely be a public release file either, a pity.  I like it, but it is not exactly what I would have been looking for, I wanted a fully closed case so it is sturdy and safe to move/carry around.  So for this one it is intended to be useful for emulation of various 80s and 90s era computers, it could also be used just to run a Pi4b with Linux or whatever else you want to run on it.  The only specific feature for emulation vs just an All-in-One Pi4b case is the addition of the two DB9 ports that I am going to wire to the gpio for using Atari type Joysticks.  I don't think I can do Paddle emulation though through GPIO with the old Atari 2600 Paddles, I think that would take a ADC of some type or something which is not built into the Pi itself, and I don't know if there is actually built in support for that even with additional hardware.  There are options for various other input devices of that can do what the old Atari 2600 Paddles did, I was just thinking it would be cool to direct wire in for the 80s era paddles.  If anyone knows a way to do that, it would be great to hear about and I can see if I could include that into the build.


I expect there won't be a lot of free space in this case once it is packed with the parts, and actually the cabling will likely fill it up quite a bit.  I have made up some special short USB cables, the Ethernet cable will be a little short one, the HDMI cables are going to be some slim 1' cables.  I hope it won't be too bad.  It is going to be hard to tell until I finally print the revised lower case, the Pi is not in the correct position in the current test print, the usb hub won't fit, the DB9s won't fit, once I solder up the power jack and fuse etc they won't be removable, so that will all wait until the revised part is finished.  When I first started putting it together, I was afraid it would be badly balanced with the Meanwell power supply on the side, but it does feel much better once the keyboard is installed, that is the heaviest part as it has a rather thick steel plate in it not aluminum like many mechanical keyboards have.  The top cover rests on a lip on the back of the keyboard tray, I am not sure it won't flex around a bit as there are no screw points along it, but if it does go down in place it can't push down, it may flex upward.  The two parts of the keyboard tray are locked together quite well, I left 0 tolerance there, I did a very minor shave on the keyed part then they slid together, there is no lip or anything for them to interlock, I may glue them together for a little more hold at some point.  Once the keyboard is screwed into the standoffs, and all 8 m2.5s are installed the parts won't likely move around anyways.  The keyboard tray is held on to the main case with 8 m2.5 screws into brass inserts.  The top cover will be held on with m3 screws into brass inserts.  I felt m3 screws were excessive on the keyboard tray, but the m3 allen head screws look better to me when exposed, so I went with m3 on the top cover (the picture shows philips screws in for the fit testing though).

For me I hope this can be used for emulation of various 80s and 90s era computers.  Mostly ones I don't have original hardware for.  I love working with original hardware, and would go for having all of the old systems and have them in working order.  I found that will get quite expensive and will take up far more space than I have right now.  There is also the situation as these are old systems, with proprietary parts that are not made anymore.  I have 2 C64s, a C128, Timex Sinclair 1000, two TI99/4as (one needs a keyboard, which is project I was thinking of tackling at some point), an Atari 800xl, and a complete Packard Bell Pentium 75mhz.  That is enough for me at this point, I have worked on all of them with various amounts of repairs and maintenance needed on each and short of that one rather bad 99/4a keyboard all are fully working to my knowledge.  I really enjoy doing the maintenance on the systems, it just adds up in time and money to keep doing it.  Still I will keep an eye out for any systems I don't have at a price I am willing to invest.  I figure this project though will give me options for getting into trying out some things I haven't had the chance to, to also experience some systems I used so many years ago and haven't come across one I can pickup for myself so far.

 

PICT0571c.jpg

PICT0565c.jpg

PICT0551c.jpg

inside.jpg

Link to comment
Share on other sites

I can tell you that a proper emulation set-up is golden. It even approaches godhood if configured with love and care.

 

Years and years ago I had a variety of 8-bit consoles from the original VCS in 1977 on up through the Sega Master System and slightly beyond. Including hundreds or thousands of carts and disks and tapes. But I was losing interest in consoles around NES/SNES/PS1. Cost was becoming a factor at the time, as well as time itself.

 

I got into the PC with a 486 and stuck with the ecosphere ever since. I can't see myself messing with the old hardware and re-collecting it all again today. Way too much time and tedious maintenance. Custom parts. Controller cleaning. Video modding and matching to modern screens. General DB9 and cartridge contact cleaning. Recapping. Power supply verification. Disk drive adjusting and cleanings. The time. The physical space. And that doesn't even touch on the original arcade cabs either.

 

No. Too much to bring everything up to the convenience, versatility, reliability, portability, and elegance that emulation offers. If I want to sit down and play Star Raiders I can do that with complete confidence it will work. As it did in 1979, today, and for decades to come.

 

But I did keep my original childhood Apple II material. And that is enough vintage paraphernalia for me!

Link to comment
Share on other sites

I printed the revised the main case part.  Everything fits.  I have stayed up way to long tonight getting it mostly assembled.  The main case part turned out to be pretty good.  I now have it assembled but a few of the items need wired up and finalized.  The DB9 Joystick ports, and the RCA jacks are not wired up yet.  The Fan is also not yet connected.  The SSD is just sitting on top of the Pi.  I'll post more pictures of it assembled probably tomorrow if I get around to working on it a bit more.  I am one hdmi cable short, but I don't need dual displays to start with on it, I'll pickup another cable sometime and add that.

The keyboard tray needs some revision, the holes for the screws are way to small.  I then drilled them out, but even so over half of the standoffs that get screws snapped off while I put the screws in.  I need to get the hole size correct, and then I will also probably make them larger toward the base to give them more integrity and make them less likely to twist off.  I had similar issues in the base, but in the revised base I made the standoffs into cones giving them more area where they meet the bottom plate.  That worked well with them, so hopefully it will work with the keyboard tray.

Once it is finished and I get the fan wired in I'll do some testing and see if it needs vents in the top cover or not. 

20211103_185539c.thumb.jpg.9841ada23914d56262649f075fcc8a7c.jpg

PICT0573c.jpg

PICT0574c.jpg

PICT0586c.jpg

Link to comment
Share on other sites

I finished making up the cable for the Composite Video and the audio jacks on the back. 

 

I also wired up the DB9 joystick ports, but there are issues with them as you need more than 1 button to be able to map a controller..  I am still working out how I may handle that, I could cheat and add some buttons to the case wired to gpio..  I could temporarily wire in some extra buttons as after setting the controller up the extra buttons won't matter as the controllers will only be used for something such as Atari 2600 games that only need one button.  Start and Select etc are available on the keyboard.  There is the possibility of making use of the "Paddle" inputs as buttons, that could let me make 3 button controllers like apparently was done in some cases, but these tie to the 5Volt line not Ground then... The Pi won't like that, So how to make a way that controllers wired as say a 2 or 3 button Commodore 64 input would work with the Pi's ports..  I want to have the 5V on the connector so as to include power for rapid fire circuits.  One of my past projects was a gamepad setup for my Commodore 64, styled like the Super Nintendo controller but wired up so it can use one of the paddles for Button 2 mode, it is to have rapid fire in it as well, I just never got around to finishing the rapid fire.  This will I guess give me something to think about, I want a proper original controller to work and those variation controlers that support two or three buttons (I have two two button C64 games that I am aware of that make use of the second button).

I wired in the 30mm 5V case fan, it is wired to a small buck converter (to the left of the HDMI port in the picture).  The fan is a bit loud at 5Volts, so I backed it down to more like 3.2V, it runs fine and moves a fair bit of air still.  I was thinking of just connecting it to the Pi's 3.3V GPIO pin, which it seems could have handled it. I was also thinking of making it temperature controlled, so that the Pi would turn it on once it reached a certain temperature.  I may or may not make changes to it.  Ventilation is a question as far as running it for longer periods.  I'll setup to watch the temps on it and see.  Vents could make the top cover more interesting.  I think some label of some sort. Much of the simplicity is to make it an easy print, the top plate prints face down on the print bed.  The case is 4 parts to print and as is it requires a printer capable of printing 300mm, which is the width of the main case and top plate.  I was chopping the keyboard tray in two so that it may have fit on an Ender 3 or such 220ish mm printer, but I think when I added the notch it over extended that.  I could go back and rework the case, and I will be looking at a couple things.  The 3.5mm jack is just a bit too close to the under keyboard support rail, so while I got it plugged in, I had to remove the "cover" and just have the bare jack in there.  I can fix that by moving the pi to the left enough to get clearance there.  The keyboard tray still needs the placement of the two standoffs corrected and the hole size in the standoffs corrected, as well as I do plan to make them tapered for greater strength.

cPICT0601.jpg

cPICT0609.jpg

cPICT0610.jpg

cPICT0615.jpg

Link to comment
Share on other sites

  • 2 weeks later...

I have not yet gotten the interest into correcting the keyboard.  I plan to, but it is not critical unless someone else wanted the files and to have it corrected to use the exact keyboard I have used.  That is unless I decide to build a second unit but I don't care to right now.

 

The change to this point is the wiring for the DB9 joystick ports.  I wanted to use Atari 2600 type, or rather Commodore 64 2/3 fire button controllers.  I was going to use GPIOnext, which I have used in the past.  It turns out that will not work with some other features I am using, either the GPIO wired status leds, or the GPIO wired shutdown button.  I went with db9_gpio_rpi instead, that requires specific wiring.  I also for now at least have it wired up for Sega Genesis 6 Button Controllers.  There is a problem with that though, it is having timing issues with the timing making fault presses of X and Y, probably Z as well and maybe Mode.  I tried cheap knockoff gamepads and thought maybe it was them, but then I purchased the modern "official" Genesis 6 button gamepad.  It has the same issues.  This may be due to the 3.3V power.  I am going to try level shifters and powering the gamepad from 5V.    I would still really like to use the C64 3 button setup, but the wiring is incompatible with the Genesis pad wiring..  I don't want to put a switch or something in, as if it was in the wrong position it would be a bad situation.  I am still thinking it over, but could be happy with the Genesis 6 button pads I guess.  Has anyone had experience using db9_gpio_rpi and the Genesis 6 button pads?  

I'll be swapping in a new 4gb Pi4b, and putting in the second HDMI cable at some point.  Probably when I try the logic level shifter for the Genesis pad.

I have not ran the system for all that long, or under heavy load yet.  It has remained cool with the 5V fan running off of about 3.1Volts.  The fan is quiet enough so far at that, it is a bit too loud at 5V though. I guess with overclocking it could have a temperature problem.  With the fan off heat does buildup, but it worked fine for short testing like that.

I bought AmigaForever and I am looking forward to getting acquainted with it as I have never used any Amigas.  It was a bit more trouble to get working than I expected, but came with Workbench and a number of games.  The Amigas are why I wanted to make this project.  I wanted to see a bit how they were back in the day, but I am not up for tracking down one and paying the going prices for it, and getting it or keeping it working properly.  I guess I need to learn how to play Petscii Robots too as I have the Atari 800 and Commodore 64 versions and I can run them on the pi system.  I have started up Petscii Robots on my Atari 800xl as well as in Retropie, but I haven't started up the C64 or Retropie with it at all yet.  The systems are there, and I can, but I just don't find myself connecting them up and turning them on.

 

Another little issue has been running Emulation Station and the regular GUI interface.  The system starts into the Raspbian desktop, then opens Emulation Station automatically.  When launching games it pops out to a terminal window.  Also keystrokes pressed while in Emulation Station are received back in Raspbian desktop, causing it to type and even open programs and such.   Getting out of the Raspbian desktop gui is not strait forward.  You can break to the terminal then make it active, then exit and it goes to Emulation Station now without the Raspbian desktop behind it.  Also launching Emulation Station can't be done directly with a normal shortcut, if done the standard way, the menus in Emulation Station work but emulators fail to launch. It has to be setup to run in a terminal window, again then with the terminal window popping and showing the desktop between switching from Emulation Station menus into the emulators.  I don't know if the keystrokes then getting out to the desktop.  Also running the desktop and Emulation Station hurts performance of the emulators from what I am seeing.  I don't want this system to not be able to use the Raspbian desktop, as that is another part of what I plan to use this system to do.  I still like this project, and look forward to hopefully using it a fair bit.  If anyone has tips for using Raspbian Desktop gui and Emulation Station let me know.  I have it mostly worked out now, but it would be great if there are some ways to fix the issues such as the keystokes and such happening in Raspbian and not being kept in Emulation Station or the Emulators..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...