Making Tiny Apple Pi: Mini VMac for Raspberry Pi Zero

Well, I recently learned about the existence of Tiny Mac. (It’s late)

I was inspired by cgenco and John‘s web pages. Thank you for creating such a Tiny Mac.

Yes, I started wanting a Tiny Mac. So, I got Raspberry Pi immediately and started preparations. I changed my approach a bit and decided to go with the CLI instead of the GUI. Basically, I installed a minimal Xwindow related environment on Raspberry Pi Lite so that Mini vMac starts when I log in.

At this time I thought about the project again.

Since I am going to produce something a little different from them, I want to have a name for it…hmmm, Tiny Mac exists, Apple Pi exists…well, how about “Tiny Apple Pi”? You like Pi(e), don’t you?

Excuse me, back on topic…

Next, prepare GPIO display and GPIO sound card.Both were selected to be connectable with GPIO, and we aimed to fit them compactly in the housing.

However, a problem occurred at this timing. (If I had the knowledge, I could have prevented it)

It turns out that these GPIO-based displays and sound cards cannot be used at the same time due to conflicting pin header signals. (I contacted the manufacturer and understood)

So I changed the plan. I decided to discard the GPIO sound card and use the USB sound card.

There was a problem with the GPIO display, so I contacted the manufacturer again, but it was a simple problem, so I solved it immediately.

Now the basic elements are in place. Of course, we prepared various cables one by one. Oh yeah. I also decided to build in a speaker. (I’ll explain later, it’s a 5 watt LR speaker.)

And the housing.

I wanted to have a built-in USB sound card and LR speakers, so I decided to design it from the beginning. This is my first time to use a CAD application. (Although I have used 3DCG applications in my previous job)

It took some time to get used to it, but I managed to complete the basic form.

“What should I do with the output of the housing?”

I thought about using a print service, but I wanted to make it myself, so I checked the 3D printer again. Recent 3D printers are cheap, aren’t they? Therefore, I chose the minimum size 3D printer (120x120x115mm) required for this plan. It’s less than $ 100 !? The manufacturer’s direct sales were sold out, so I bought it at Amazon.co.jp.However, the time comes when this choice becomes a problem.

Now print out.

Yes, the trial and error you all know continues. To minimize plastic surgery. Also, the dimensions are just barely enough, and I have to go back to the CAD application again.

Even so, I made too many details. It seems that I will be troubled by the shaping work after this.

Therefore, wise people should think carefully about this process and start planning.

After shaping and painting, it’s finally time to assemble.

Well, I’ve been doing a lot of trial and error, so the assembly was easier than I expected.

* CLI settings rely on old memories, so please point out if you make a mistake.

** Since GPIO display is used, HDMI cannot be used. In this setting.

Supplies

This is the place of purchase that I used. It is an overseas site including Japan.

Also, processing may be required depending on the shape and size of the cable terminal.

others:

  • Glue gun or glue or Epoxy putty (for fixing external access cables or USB hubs)
  • When shaping and painting, please prepare the necessary tools.
  • A little keyboard and mouse if needed.
  • Also, prepare an appropriate amount of decals according to your preference.

Step 1: Environmental Preparation for Raspberry Pi OS Lite

Basic process:

  1. Install CLI “Raspberry Pi OS Lite”
  2. OS upgrade
  3. X window related installation
  4. Auto login settings

* The GPIO display will be installed and set at the end. The settings do not need to be done on a small screen.

(1) Install CLI “Raspberry Pi OS Lite”

Use Raspberry Pi Imager for installation. Install “Raspberry Pi OS Lite”.

* At that time, set the network and SSH with “Ctrl + Shit + X”. Since various settings are troublesome with CLI, to shortcut the work. (Personal opinion)

(2) OS upgrade

After inserting the Micro SD card into the Raspberry Pi and booting, let’s upgrade the OS first.

$ sudo apt-get update
$ sudo apt-get full-upgrade

(3) X window related installation

Install the minimum Xwindow related required to boot a Mini vMac over the CLI.

$ sudo apt-get install xserver-xorg
$ sudo apt-get install xinit

(4) Auto login settings

Enable “Console Autologin” in the familiar “raspi-config”.

* The reason is that my approach may not be good, but I tried rc.local, Systemd, and cron, but it didn’t work, and in conclusion, I wrote it in “.bashrc”. There is a circumstances.

** Please lend me some wisdom.

Once these are ready, the Mini vMac will be ready for acceptance.

Step 2: Preparation for Mini VMac

See Mini vMac a miniature early Macintosh emulator” in the Gryphel Project for more information on this stage.

For how to create a disk image, it would be better to refer to “Making a Tiny Mac From a Raspberry Pi Zero” by cgenco.

My compile options are:

-t larm -hres 640 -vres 480 -depth 0 -var-fullscreen 0 -fullscreen 1 -mf 1 -sound 1 -speed z
  • Screen size: 640 * 480px
  • Screen Depth: Black and White
  • Full Screen Mode: On
  • Full Screen Mode: Constant
  • Magnify: Start with Magnify Mode off
  • Sound: Emulate sound
  • Speed: 1x * I want to experience the speed at that time.

Please compile it according to your preference.

The above binary file I’m using can be downloaded from this link. (However, if it conflicts with any regulation, it will be deleted.)

Step 3: Copy Mini VMac to Raspberry Pi

Copy your Mini vMac application to any hierarchy on your Raspberry Pi. Of course, don’t forget “vMac.ROM” and “disk1.dsk”. Here, for the sake of explanation, I will put three files in my home directory. (I stored it in a directory named “apple_pi”)

Start the Mini vMac test once.

Execute the following command.

Don’t forget to give the Mini vMac program execute permission. (Example: chmod 755 filename)

$ startx ~/minivmac_640x480 -r ~/vMac.ROM -display :0.0 ~/disk1.dsk

After the Mini vMac boots successfully, quit the Mini vMac. Press the keys in the order “hold down the control> h> q> y” to quit the Mini vMac.

Step 4: Mini VMac Autostart Settings

After exiting the Mini vMac, add the above command to “.bashrc”.

startx ~/minivmac_640x480 -r ~/vMac.ROM -display :0.0 ~/disk1.dsk

Now, when you log out or reboot, you will be automatically logged in and MinivMac will start automatically. (Every time !?)

* As mentioned earlier, rc.local, Systemd, and cron didn’t work, so I typed them into .bashrc. The downside of this is that the MinivMac boots every time you log in, instead of booting only once when you launch the Raspberry Pi.

** Please let me know if there is a better way. (This is the limit of my knowledge)

Step 5: USB Sound Card Settings

If there is no sound after installing the WAVESHARE USB sound card, you need to set it. The cause is when there is audio output other than the USB sound card. For example, when HDMI is connected, the onboard chip of Raspberry Pi has priority, and there is a symptom that it is not output from the USB sound card. Of course, if you only use a USB sound card, the following settings are not required.

First, install the USB sound card and check if it is recognized. At that time, please turn on the power of Raspberry Pi after installing the USB sound card with the power of Raspberry Pi turned off. The USB device itself is plug and play. However, since the power consumption of the USB sound card is large, if you insert the USB sound card with the power of the Raspberry Pi turned on, the power of the Raspberry Pi may turn off due to insufficient power depending on the power supply status.

After inserting the USB sound card, turning on the power of the Raspberry Pi and booting it, execute the following command to check if the OS recognizes the USB sound card.

$ lsusb

Look for the line “JMTek, LLC. USB PnP Audio Device”. If you see that line, your Raspberry Pi is recognizing your USB sound card. (If the sound chip is different, look for another name)

Next, check the priority of the sound output. Execute the following command.

$ cat /proc/asound/modules
 0 snd_bcm2835
 1 snd_usb_audio

In this state, the Raspberry Pi’s onboard sound chip has priority, and there is no audio output from the USB sound card. So change this priority. Execute the following command, but “alsa-base.conf” does not exist in the initial state, so if it does not exist, you will have to create a new one. (If it doesn’t exist, run the following command to create a new file.)

$ sudo nano /etc/modprobe.d/alsa-base.conf

Write the following three lines in the “alsa-base.conf”.

options snd slots=snd_usb_audio,snd_bcm2835
options snd_usb_audio index=0
options snd_bcm2835 index=1

After editing, save “alsa-base.conf” and restart the Raspberry Pi. (The priority of audio output does not change unless it is restarted.)

$ reboot

After rebooting, check the audio output priority.

$ cat /proc/asound/modules 
 0 snd_usb_audio
 1 snd_bcm2835

If the output content of the command is as above, the audio will be output from the USB sound card. Try to output any audio file. Alternatively, run the Mini vMac and you should hear the startup sound coming out of your speaker.

* As I wrote in the introduction, the GPIO sound card prepared at the beginning could not be used because the signal of the GPIO pin header conflicts. To be honest, it was good that it fits compactly… The GPIO sound (It’s two) card is no longer needed and is in storage.

Step 6: GPIO Display Settings

At this stage, I think it’s okay to install a GPIO display.

See the WAVESHARE “2.8inch DPI LCD” Wiki for details.

However, there are some points that are not described in this Wiki. I contacted WAVESHARE and learned about it. You need to comment out part of /boot/config.txt.

dtoverlay = vc4-kms-v3d

Comment out the above line. (#dtoverlay = vc4-kms-v3d)

Commenting out this line will disconnect the HDMI output. If you need HDMI output, comment out the contents of the Wiki again and uncomment this line.

* Also, be careful when connecting the LDC display. If the GPIO pin header is connected incorrectly, the circuit on the LCD display side will burn out. For some reason, I made a mistake twice in a row and broke two LCD displays. (I was very sad)

Step 7: Retro Mac-like Housing Design

I was wondering whether to go through this step with a full scratch like John, let me use cgenco‘s data, or create it from scratch with a CAD application. In conclusion, considering the final cost, I decided to create from scratch with a CAD application, referring to their ideas.

The problem was that I wanted to incorporate a sound card and LR speakers inside the housing.

As a result, we found suitable parts, so we wereted less parts. The small 1w speaker was totally lacking in volume. For another reason, the GPIO sound card was forced to change to a USB sound card.

The point I was particular about was to provide an LR slit that outputs the sound of the speaker. Also, it was to provide a slit to dissipate heat even a little. Well, in the end, I wanted to make it the same as the original Mac.

At this point, I didn’t understand the resolution of the 3D printer, and I created the details = slits. Therefore, you will have a hard time at the printing stage. (Ignorance is horrifying)

Also, I didn’t know how much space was needed between the housing and the parts, so I had to redo step 7 and step 6 several times.I think that the position of the board was also redesigned about three times.

Anyway, it settled down in this shape.

Step 8: Now to 3D Printing: But …

As you know, this is a process with a long latency in a sense.

Trial and error with the board layout. Trial and error in the gap between the housing and parts. Trial and error on the size of the slit.

That’s right, I made too many details.

There was a limit to the reproduction with the 3D printer I got. Perhaps a good 3D printer can reproduce every detail. It was a little disappointing.

In particular, the rear parts were distorted when I tried to print them in one piece, and no matter how many trials and errors I made, I couldn’t succeed.

At some point, when I made minor corrections to the front parts and tried to print out, for some reason the last part was not printed normally. I wondered “why?” And tried it again, and the one in even worse condition was printed out. I thought “Hmm?” And tried again. This time, even the filament does not come out. No matter how many times I try, the filament does not come out. About 10 days after purchase. I thought, “Isn’t this condition treated as an initial defect?”, So I immediately contacted Amazon.co.jp, the place of purchase, by chat. As a result, I returned the item and received a refund.

That’s right, the production of the FDM version with a 3D printer is now complete.

* I thought about replacing the nozzle, but I was in trouble if I couldn’t return it, so I chose to return it obediently.

Step 9: Now to 3D Printing: Again

Having completed the return arrangement, I thought, staring at the wreckage of the FDM print. “Should I change my approach …”. Considering the details of CAD data, there is a limit to FDM printing.

I started looking into 3D printers again. It costs more, but yes, it’s tempting to switch to a stereolithographic 3D printer.

Immediately, I started to select printers and resins. Of course, we also wanted to keep costs down, so we selected a small Stereolithography Apparatus that can print out the housing size. (The experience of FDM failure also ran through my mind)

For the resin, I selected a gray water washable photopolymer resin. I will paint it later.

After completing these preparations and receiving the SLA 3D printer, I made various settings.

Like the FDM printer mentioned above, this is the first time for SLA.

I was wondering, “Now, will we get closer to the ideal?”, First of all, I tried to output a 50% model of the miniature as a test print.

I’ve done it, the ideal shape has been created!

However, the front part fell and stuck to the FEP film on the screen. But, it is certain that the rear parts that were safe had the ideal accuracy. Hooray!

By the way, I used the attached slicer to generate the support, but it slightly protruded from the print area and could not be printed. However, if you generate support with other software and import it into the attached application, the problem of print area seems to be solved.

* I thought about ordering for printing service, but I chose the SLA 3D printer because there is no difference in the initial installation cost.

Step 10: Now to 3D Printing: Finally Time for Production Printing

SLA with production data.

The XY side of the print area is full with this data size. When I generate a support, it’s a little out of the print area, but I think I can print it out somehow.

First of all, from the front parts. Then the rear parts. At this stage, the stacking accuracy is set to 0.05 mm. If the printout is successful, we plan to improve the stacking accuracy. It would be ideal if the stacking accuracy could be increased to 0.01 mm, but I will do it after considering whether it is really necessary.

As you can see in the picture, the ideal printout was completed. SLA, the highest grade excellent.

Anyway, I feel great!

Secondary curing. At first, it was secondarily cured with natural light, but it was not efficient, so I switched to UV light. Due to the limited frequency of use, I bought only an inexpensive UV light and put aluminum foil on the inside of the small box for secondary curing. Although the curing effect was obtained, the amount of UV light was low and it took a long time to cure. So, when I switched to a full-fledged curing device, I was able to obtain the curing effect in a short time. (Of course, I returned the cheap UV light)

* There are some points to note. The resin used in the initial stage gave good results, but the other resin purchased after that had low reproducibility and was fragile, so the joints such as dowels were chipped.

* *Also, even with the resin of the manufacturer that obtained good results, the reproducibility was completely different when using different colors of resin.

Step 11: Shaping & Painting

Perform this step as needed.

You don’t need it if you are using colored resin. However, although it had a flesh color, as far as I know, there was no resin with a suitable color for Tiny Apple Pi. I remember hearing that there is a way to mix acrylic paints, but I’m not confident, so I decided to paint normally this time.

*For me, the basic procedure was “Sanding > Filling the scratches with putty > Sanding > Surfacer > Color paint > Transparent matte paint”.

** It was a series of failures, and painting is difficult no matter how many times it is done.

Step 12: Problem Occurred at This Stage …

I received a replacement for a burnt display. That’s why I temporarily assembled the display.

I measured each part and designed the housing, and also checked the manufacturer’s specifications. However, when I displayed it on the display, it turned out that the top and bottom and the left and right were slightly out of alignment. In situations where neither the measured value nor the spec value can be relied on, the only way is to make steady adjustments. I modified the CAD data several times, printed it out with a 3D printer several times, and tried and errored the temporary assembly.

Also, the clearance between the dowels and the receiving holes that help connect the front and rear parts changed slightly from print to print, requiring several printouts to find the right combination.

I found out why I was invited to the labyrinth. Apparently the cause was a change in the resin manufacturer. Since the resin of the desired color (gray) was sold out, I easily prioritized the color and changed the resin manufacturer. The output result of the resin of the manufacturer after the change was not good, and the finish of the resin itself was very hard and inflexible. Therefore, it seems that the clearance between the housing parts, which was okay with the resin used first, could not withstand the specifications with the changed resin. After all, I got the different color resin of the manufacturer that I used at the beginning again, and after that, it went smoothly. (Because gray was not restocked)

When you work on it, please select the resin with an emphasis on the reproducibility and high toughness of each resin.

But that wasn’t the only problem. The GPIO flat cable connector shape = height was not taken into account, and I had to go back to CAD. If you have a good intuition, you may have noticed that, yes, the housing parts that have been output so far are almost useless. After a little thought, I found that I could avoid it by changing the design of only the front parts, so I decided to compromise.

Still, there were some housing parts that were lost due to the issues mentioned above and this issue. It’s mainly the front parts, but …

If I verified the temporary assembly earlier, I would not lose time and materials, but it was a pity that it took time to burn out and re-obtain the main parts. Also, while I was waiting for that, I think I was uplifted by getting a 3D printer in parallel. I have printed out more and more. Without knowing that the dimensions don’t match …

Everyone, please be careful.

* If the dimensions are incorrect, I attached a dummy black plate to the display part to make it look like an empty Tiny Apple Pi without Raspberry Pi installed. In my case this time, I created a fake Tiny Apple Pi with 12 units + wreckage. Of course, against my will. In addition, there are other failed parts that did not become a housing. Do you know how much resin I have consumed?

Step 13: Finally the Built-In Work: Part 1

Now that all the ingredients are ready, it’s time to assemble.

Since I have made the housing by repeating fine adjustments so far, I can attach the parts I got, but it is not a housing that can be completely fixed. There are places where screws are used, but I have designed it from the beginning on the assumption that glue guns and adhesives will be used. This is because it was supposed that someone, including myself, would modify it. (Because it is considered that the parts procurement does not match perfectly)

So, please prepare a glue gun and adhesive and proceed. There are some places where the screws and the board come into contact, so you may also be convenient to use epoxy putty.

The following is the procedure I proceeded, so please proceed according to each part.

Next, glue the Micro SD card reader extension adapter to the front part to the location of the floppy disk drive on your original Mac. At that time, disassemble and remove the outside of the Micro SD card reader extension adapter. For fixing, it is better to use superglue because the adhesive surface needs to be as thin as possible.

Then place the display on the front part. I designed the housing with the intention of fixing it with screws (M3 8mm), but screws cannot be used depending on the connector shape of the flat cable, so in that case, fix it with a glue gun or epoxy putty.

Finally, insert the M3 hex nut, which is necessary for connecting to the rear part, into the hex hole at the bottom of the front part and fix it with adhesive.

This completes the installation on the front part.

Step 14: Finally the Built-In Work: Part 2

Next is the attachment to the rear parts.

First, attach and fix the USB hub. I have no plans to remove the USB hub, so I fixed it with instant adhesive. Although it is a USB hub, it may interfere with the flat cable for the display. In that case, please scrape the case of the USB hub as shown in the picture.

After fixing the USB hub, install speakers on the left and right. At that time, check the LR before fixing. I used to check the sound source so that I could check the left and right in advance.

Next, install the Micro USB cable for power extension. If the shape does not fit, scrape a part of the housing to attach it.

At this step, attach the USB Sound Card to the top of the USB hub. Of course, I think it’s okay to wire the speakers.

Finally, install your favorite Raspberry Pi. Place the Raspberry Pi at the position of the dowel in the rear part and fix it with an O-ring so that the board will not come off.

Depending on the accuracy of the 3D printer, the dowel position may not match. In that case, try scraping the dowels and fixing the Raspberry Pi with a glue gun or epoxy putty.

When fixing the Raspberry Pi, please attach the Flat cable and Micro SD card reader extension adapter. It is difficult to insert the cable later because the space is small.

Anyway, this completes the assembly into the rear parts.

Step 15: Finally the Built-In Work: Part 3

Now, we will wire and assemble the front part and the rear part, but we will check the wiring of the rear part.

  • USB Sound Card and speaker wiring
  • Wire the Micro USB cable for power extension to the Raspberry Pi
  • Wire the 3-port USB hub to the Raspberry Pi

If there is no problem with the above, it is the wiring of the front part and the rear part.

  • If you haven’t already connected the flat cable, wire the flat cable for that GPIO 40 pin to the Raspberry Pi. Connect the other side to the display.
  • Then wire the MicroSD card reader expansion adapter to the MicroSD card slot on your Raspberry Pi. (In some situations, you may need to remove the Raspberry Pi)

The Flat cable for GPIO 40 pins is bulky, so bend it lightly and store it. Also, as I wrote above, please check the wiring thoroughly. You guys shouldn’t follow the same rut, as I made a mistake and burned the two displays.

Also, depending on the height and shape of the micro USB you insert into your Raspberry Pi, you’ll need to adjust its height and shape. I didn’t calculate the size of the flat cable terminal at the design stage, and it interfered with the Micro USB terminal, and the front parts did not close. So I tried to disassemble the Micro USB terminal, but I made two mistakes in a row. So, in the end, I used a heat gun to forcibly bend the terminals to avoid interference between the terminals. The USB hub worked fine.

Another point is that the outlet of the Micro SD card is narrow, so try using a flat-blade screwdriver or something similar when inserting or removing the card.

Finally, combine the front and rear parts. At that time, be careful not to break the fixing dowel and the receiving hole. Secure with screws (M3 12mm) from the bottom hole.

Step 16: And Completed

If there is no problem with the wiring, it is finally a startup test.

But let’s put a logo decal at the very end!

I think it’s okay to put anything on it, but I basically made it a rainbow-colored apple. Besides, it may be cool to put the Raspberry Pi logo on it.

Regarding the dimensions, it is best to place the 4mm logo within an area of 4.5mm square.

It is recommended to prepare multiple items in consideration of failure. I didn’t want to waste the print area, so I prepared only 200 apples !? (Additionally, a little Plus logo … 40 pcs)

Finally, Insert the Micro SD card into the slot, plug in the power cord and turn on the power.

Raspberry Pi starts with CLI, auto-login, and Mini vMac starts.

It’s completed!

* Mini vMac can be closed with “hold down the control > h > q > y”.

** By the way, if you execute the “logout” command, you will be automatically logged in immediately and Mini vMac will start up again. (When set in .bashrc)

Step 17: Supplement

About the display area

The bezel around the LCD display is designed to be rounded. Due to various dimensions and ratios, the display area of the LCD display will be slightly covered. It is about 1 mm. The position may shift depending on the printing conditions of the front parts and individual differences in the LCD display itself. I hope you will be patient and make adjustments.

About Raspberry Pi

In Japan, where I live, the Raspberry Pi Zero 2 has not been certified domestically at this time, so it is not yet on sale. As far as I read the overseas reviews, I think that the Raspberry Pi Zero 2 is a good choice. If you live in an area that is officially available, please give it a try.

Step 18: Thank You for Reading It Until the Very End

When I was inspired, I just wanted to enjoy myself, but as I proceeded with the production, I began to want to post this production process.

Actually, I started writing this post gradually from the middle of production, and while repeating corrections and additions, I completed the manuscript at the same time as the completion of Tiny Apple Pi.

Scroll to Top
Read previous post:
NEW-PISUGAR2-ADDS-BATTERY-PACK-AND-UPS-FEATURES
NEW PISUGAR2 ADDS BATTERY PACK AND UPS FEATURES

The team of engineers at the PiSugar project has launched a second-generation version of their compact battery accessory for the Raspberry Pi Zero family...

Close