Introduction: Clone Trooper PiTop

Clone Trooper PiTop

First I have to acknowledge the work of Mepler https://www.instructables.com/member/mepler/ whose project on the TI99/4a I cribbed for my project. Thank you.

Supplies

Parts Used:

Kids Learning Laptop

Raspberry Pi Zero W

3.5 Inch LCD For Raspberry Pi

Raspberry Pi Zero CSI Mini Camera Module 5MP

64GB Micro SD Card

Teensy 2.0 USB Development Board

USB Hub

USB Power Bank

USB Headset with Microphone

USB Game Controller

Wireless USB Mouse

Assorted USB Cables

Prototyping Board

Step 1: Pick a Laptop

I started off with the Star Wars Clone Trooper Learning Laptop from Oregon Scientific.

There are a few different versions of this laptop but I picked this one because of the color scheme, a real keyboard instead of just a membrane one, and the larger wide screen display. It also needed be big enough to fit all of the parts inside.

I disassembled the laptop. I had to be careful with the top because the screws holding it together are beneath the edge of the plastic graphic sheet and part of the picture stuck to the case and part came off with the plastic sheet. I didn’t pull the sheet completely off, just enough to expose the screws and as long as it was still attached around the middle the graphic lined back up when it was reassembled. With the case top and bottom off I could see that the keyboard, speaker, PCB, and screen are all attached to the two piece folding middle section of the computer. I kept with that idea of attaching all of my components to the middle section and just screwing the top and bottom covers back on when completed.

Step 2: Convert Keyboard to USB

The keyboard is wired in a matrix similar to the TI99/4a’s keyboard. When I disassembled the laptop the circuit board pins for the keyboard are labeled PA0-PA6 and PB0-PB7. There is also a PC0 pin and power button pin. With the laptop on I used a piece of wire to short between the pins and see what happened on the screen. I was able to map most of the keys this way.

To connect this to the teensy I used a small general-purpose prototyping board. I desoldered each of the keyboards wires from the main computer PCB, pulled the wires through the joint between the top and bottom of the computer, and removed the computer board and screen from the top half. I soldered 15 10K ohm resisters as on the prototyping board with one end connected to ground and the other end connected to each separate wire for the keyboard. The pull down resistors connect between each of the keyboard pins and the Teensy pins.

Looking at the project board and Teensy soldered together I could see I should have used longer wires because stacked like that makes it hard to fit in the computer.

The pins on the Teensy are not in order like in my diagram so be sure to read the labels on the circuit board when soldering this together. I used the Arduino software to program the Teensy with the included keyboard script. Check out the Teensy site for tips on programming the board. https://www.pjrc.com/teensy/index.html

I made keyboard pins PB0 – PB7 the outputs and PA0 – PA6 inputs for the Arduino keyboard script. I ended up not using the PC0 pin on the keyboard because when I tried connecting it to the Teensy things became very erratic so some keys ended up not working. The keys I do not have working on the keyboard are Esc, Power, Contrast – and +, Game Category, Music on/off, and the Shift key. I used the Help key as shift and the Backlight key as a Function key so that I could get F1 thru F10 when used with the number keys plus various special characters when used with other keys. The volume – key is Esc and volume + is Tab. You can look through the keyboard script to see some of the key combinations I made to get some of the other keys lacking on this keyboard like Function + Q makes a ~. It’s pretty simple to make changes to the script txt file and then just copy and paste all of it into the Arduino software to program the Teensy and see how your changes work. After programming the Teensy it works just like any USB keyboard so you can plug it into any computer for testing.

Step 3: Prep Hardware

I used the Raspberry Pi Zero W for this project. I soldered the GPIO pins on the board so it could be connected to the 3.5 inch LCD. The LCD I got from Aliexpress and saved a couple of bucks by not getting a touchscreen version because it was going to be behind the clear plastic of the graphic sheet anyway. I used BerryBoot as the bootloader so I could use multiple OSs for this laptop.

https://www.berryterminal.com/doku.php/berryboot

BerryBoot images are available here.

https://berryboot.alexgoldcheidt.com/images/

I used the mini HDMI to HDMI adapter and a normal USB keyboard and mouse for the first boot and to install Berryboot on the micro SD card. After Berryboot was installed I could use its menu to add the lines needed to the config.txt file so the Pi would use the LCD display.

dtoverlay=dpi24

enable_dpi_lcd=1

display_default_lcd=1

dpi_group=2

dpi_mode=87

dpi_output_format=0x6f026

hdmi_timings=480 0 50 20 50 800 1 3 2 3 0 0 0 120 0 32000000 6

display_rotate=3

Since the Pi Zero only has the one USB port and I needed USB connections for the keyboard converter, the wireless mouse, the USB sound adapter, and the two external USB connections for game pads and thumb drives I had to have a USB hub with at least 5 connections. I had one sitting around that had 7 ports available plus it had a 5V 3A DC adapter that I used as the charger for the battery pack.

The laptop only has a single speaker but I wanted to include an earphone jack and a microphone so I used an old USB headset. I just chopped of the wires after the block that says Logitech and used an ohmmeter to test which color wires went to the headphones and microphone. I kept the microphone from the headset just shortened the wires. I have seen USB sound cards on Ebay for around $3 that would have probably been easier to use but you work with what you got.

The battery I purchased from Ebay. It is a 20000mAh power bank with one 1A output and one 2A output. It is charged with a micro USB connection. The description said it was thin and I didn’t pay attention to the rest of the dimensions so it is almost too big for this application but it was cheap. I only use the 2A output, which I think would be the minimum to use with the Pi Zero. The finished computer works fine with this even with stuff connected to the external USB ports.

Step 4: Assembly

I used a rotary tool to cut away the stand offs and supports inside the top and bottom of the case to make room for the parts I installed. Cutting small amounts at a time and then checking for fit is the best way to go at this. The top case also needed a notch cut for the HDMI connector. The bottom case needed holes for the power switch, earphone jack, external USB ports, and a couple of holes in the back so I could see the power indicator lights for the battery pack. That last bit for the lights could have been avoided if I had added the parts needed to monitor the power levels from the Pi but I didn’t.

The 3.5 inch LCD fits very well in the window for the old computer and screen. I hot glued the screen and USB hub into place and started seeing how I could run the cables. I found flat USB cables at the Dollar Tree that made it easier to run the cables through the small hole in the joint between the top and bottom. I still had to cut the ends of the USB cables off and solder them back together after they were through the hole. The flat cables I used had one wire colored red the other three were white so the order they went in was important. The red wire was hot, the next wire was the – data wire, then the + data wire, and then ground.

The wires that needed to run through the joint to the bottom
were the power USB cable, the keyboard USB, two USB extension cables for the external connections, and the Sound card cable. I ran the micro USB cable from the Pi to the USB hub and cut that end off and soldered it to the hub to save some room. I ran the HDMI adapter cable from the Pi to where I cut the notch out off the top cover. I drilled a small hole in the top for the camera that also went through the graphic sheet so the camera would face the user when the laptop is open and everything got hot glued down.

I did have a small problem with the USB hub. When I had the wireless adapter for the mouse connected the mouse would keep losing connection. I had to solder a couple of wires from where the power adapter plugged into the hub to a +5V pin and ground pin on the GPIO. That stabilized the mouse connection.

On the bottom half I soldered the cables for the keyboard, USB extensions, and power USB for the Pi back together using wire heat shrink to keep everything clean and insulated. I cut a small micro USB cable and soldered it to the computers original power adapter barrel plug that luckily was the same size as the USB hubs 5v power adapter plug. For the sound I solder the right channel to the computers only speaker and also added a 3.5mm earphone jack salvaged from an old SoundBlaster card with both audio channels so that when earphones or external speakers are plugged in I get stereo sound and it cuts off the internal speaker. I drilled a hole through the bottom half of the computer just above the contrast keys of the keyboard and placed the microphone salvage from the USB headset under the hole. I added a SPST switch to the USB cable’s red wire going to the 2A power to turn the Pi on and off. The power switch fits through its hole in the bottom case and a nut secures it. Then again I used gobs of hot glue to keep everything in place.

Then it was just a matter of screwing the top and bottom case covers back on and turning it on.

Once it was running I found it easier to add operating systems like Raspian and Retropie to BerryBoot by downloading the images from the link I provided earlier and placing them on a USB flash drive and installing them from the BerryBoot menu. There are some good YouTube videos showing how to do this.

The original weight of the learning laptop with batteries was 1lb 13.5oz. After the modifications it weighs 2lbs 8.2oz.

Please look at the imbeded video to see a small demo of the Clone Trooper PiTop in action.

Raspberry Pi Contest 2020

Participated in the
Raspberry Pi Contest 2020