Madscientists's DIY Laptop

Like most of my projects, I got annoyed with off the shelf options and excited about trying to do better. Results were mixed, but it was fun and I learned a lot. Some of the inspiration probably came from some of the earlier cyberdeck builds that made it to Hackaday, too.


Wish list:


Photo: overview of Mk. II, case open, lights on, htop running.

Mk. I

My first attempt was a Pi 3 in a box, with a screen and a battery. It never got far enough to have any chance of meeting my requirements, partly because the design was bad, and partly because I ran into issues with the Pi.


The Pi 3 has enough hardware oddities to make running a general purpose Linux system on it tricky:


I gave up when I couldn't fix the audio driver or even extract any useful diagnostics from the kernel, and updates kept breaking the bootloader by causing weird filesystem issues. Oh, and the UPS HAT I used for power was all kinds of finicky. With the Pi 4 now available the situation might be a bit nicer, but I still doubt it would be headache free so I have no plans to try building any future Pi-based systems.


Photo: comparison of smaller Mk. I case size to Mk. II, which is about twice the size

Mk. II

Mk. II uses all-new basically everything.


I swapped the Pi for an Intel NUC, with a standard x86 CPU and integrated GPU, a useful amount of RAM, and a real SSD (bye bye SD cards!). The dodgy UPS HAT got replaced with a custom power controller board and mains PSU module to meet the much larger power requirements of the x86 hardware. Due to the difficulties of sourcing and working with Lithium batteries, Mk. II had a small lead acid battery instead. If that sounds like a bad idea, you're right, but I'll come back to that.


Mk. I had everything mounted on a grid of threaded mounting posts so I could rearrange things as the design grew. It worked sort of ok, and I thought an upgraded version might work nicely in Mk. II. This became a modular front panel design inspired by Eurorack synthesisers, with two rows of slots that modules could bolt into.


In the end, Mk. II works, but isn't remotely practical. The design generally doesn't work very well, and there were hardware problems I ran out of motivation to fix. This implies that there may be a Mk. III, eventually.


Photo: pretty close up of Mk. II's front panel.

Features:


Photo: labelled top panel, showing LCD, controls, and 3D printed screen bezel.
Photo: labelled bottom panel, showing many many lights, controls, and 3D printed covers.

Case

Mk. I used a small Peli case, and I'd found it quite nice to work on and use, so I did the same for Mk. II. This time I used a Storm iM2050, chosen because it would neatly fit a 10 inch LCD panel, and had nice easy to use catches.


On the positive side, it's a good robust case. It's IP68 rated, so it should be able to cope with being submerged without issue. I have also confirmed that I can jump up and down on top of the finished machine without any worries about damaging it.


On the negative side, it's an entirely silly choice for this application. The case alone, completely empty, weighs a couple of kilos. This means that the final weight of Mk. II comes out somewhere around 4~5Kg! The resulting form factor is honestly kind of nice, but I imagine “breeze-block” is probably a bit of an acquired taste. I also found that the inside of this particular case has a very complex trapezoid shape with rounded corners, which made mounting anything inside it an absolute nightmare.


Next time... I dunno, do literally anything else.


Motherboard

Intel NUC with Core i3 4010U and HD4000, 4GB RAM (upgradeable), 120GB mSATA SSD (upgradeable).


Ports: HDMI, DisplayPort, Ethernet, 2x USB 3, 3x USB 2, 3.5mm combo audio jack. Power/reset switches, power/disk lights, and 2x USB 2 are forwarded to front panel.


The NUC board was a really nice solution to a motherboard because it's quite capable, very compact, and easy to support electrically and mechanically. It accepts a wide range of DC voltages and only requires a single supply input for all of its power (contrast a conventional ATX-style supply), which meant it could be pretty much directly connected to the battery. X86 systems generally want to draw a few amps from the power supply, so not having to step the voltage up or down saved me a big headache. A lot of the status, control, and I/O I wanted on the front panel is also conveniently exposed via an “application header” on the motherboard, which made disk activity, on/off, etc nice and easy to wire up. Finally, the x86 CPU is nice and boring and moderately powerful, so I don't have to worry about hacking the OS to make anything work.


Unfortunately, the module font-panel design started showing its limitations pretty much as soon as I tried to put he motherboard and power supply in the case. These two components are very large and take up most of the volume, so there's just no way the font-panel mounts can help with them. As a result, both are just bolted to custom brackets at the bottom of the case, and can't be easily moved. The NUC in particular ended up mounted at a very strange angle to optimise use of the available volume, so it looks pretty funky.


Photo: motherboard and a tangle of wires to forward controls and sockets to the front panel.

Power Supply

Off-the-shelf mains PSU, 75W/15v/5A, plus fuse and C13 mains connector.


12v lead-acid battery, 2Ah (~800g).


Custom power control board.


Using an off-the-shelf PSU kept the mains safely contained, made mounting straightforward, should be easily replaceable, and hopefully ought to be pretty reliable. The down side is that its metal chassis is both heavy and moderately bulky. I could have used the usual external power brick other laptops use, but I hate having to carry one everywhere as a separate item.


I didn't have much luck trying to source appropriate lithium batteries. High-current 18650s would have been a good solution, but I just couldn't find anywhere I remotely trusted to buy any from. The circuitry to monitor, charge, and balance lithium also made me very nervous, so I gave up and went with lead-acid. This was never going to work very well, but I was hoping it would be enough to give the machine a little bit of portability.


Lead-acid is cheap, easy to get hold of, and relatively hard to blow up. Unfortunately, it is also very large and very heavy. I don't think the extra size and weight the battery added are worth the capacity it provides, and maximum current limits mean that this is about the smallest battery I could have used. It would probably have been better to skip the battery entirely, given the complexity it also adds.


The custom power control board has four functions:


The safety conditions it monitors:


The board was an Arduino and some simple analog electronics. The Arduino provides monitoring functions, while the analog electronics handles battery charging and power source switching. Analog electronic design isn't my area, so I built this board using the simplest, crudest, most fool-proof solutions I could think of. This wasn't good for performance, and I still managed to screw up when I was specifying the power supply for the Arduino. As a result, the linear regulator I chose gets very hot, and throws off the temperature measurement.


The charge circuit is a crude constant voltage with limited current design, just using a linear regulator and a resistor. I wasn't too worried about having fast charging anyway, so it wasn't a problem that this designed charges extremely slowly.


Power supply switching is done using a simple diode-or circuit using pretty much the biggest power-schottky diodes I could find. Unfortunately, while I'd chosen them for minimal forward drop under load, they still manage to dissipate about a volt under normal use. This wastes quite a lot of power, which is frustrating given the already tiny battery capacity.


Current monitoring is via a current shunt and one of the Arduino's ADCs. The shunt is a spare brass rod I had lying around, the resistance of which I carefully measured and tweaked. I also wired a coil meter across the shunt so I could have a pretty front panel readout of power use.


Power to the whole system goes through a big MOSFET so that the Arduino can turn everything off if safe operating parameters are exceeded. It took me a couple of attempts to get the circuit right, as low-side switching causes all sorts of weird confusing situations. Possibly the right answer here would have been a P-MOSFET instead of an N-MOSFET, but the performance of P type FETs is noticeably worse than N type.


In hindsight, it would have been useful to also have a 5v supply for the entire system, instead of just the 10-15v supply. Several random bits need 5v (audio circuits, lamp, USB power sockets) and giving each one its own little regulator is messy and a bit wasteful.


Screen

Waveshare 7 inch IPS LCD, 1024x600 pixels, capacitive multi-touch, HDMI input.


Modified to add backlight brightness switch (high/low/off).


I had to use a special flat-flex HDMI cable (designed for drones) because a normal cable was too bulky and inflexible. The Waveshare LCD is ok, but a little finicky about EDID and standby. Mounted in the lid of the case and with a 3D printed bezel it does the job well enough.


I was hoping to get hold of a 10 inch LCD, but couldn't justify the cost.


Speakers

Stereo speaker drivers, salvaged from Logitech desk speakers, 6W class D amplifier (PAM8403).


I'm sick of tinny awful laptop speakers, so I put some decent ones in Mk. II. I also wanted a real volume knob because keyboard volume control breaks when some software is full-screen.


The speakers work ok, though they'd benefit from having open space behind them instead of just being jammed into the only space they'd fit inside. The amplifier also seems to do the job perfectly acceptably, except that something about my wiring introduces a huge amount of electrical noise. Screen refreshes are audible, and turning the amplifier off leaves a blessed, delicious silence afterward. My guess is that there's a grounding issue thanks to some awkward power supply circuitry. Wiring and mounting ended up being a horrible mess because space was getting tight toward the end of the build, and honestly I'd just had enough of trying to fix this part. I haven't had the motivation to go back and fix the trouble.


Lamp

8x APA102 RGB LEDs, gooseneck housing.


Older ThinkPads had a “Thinklight”, a little white LED that shines from the top of the screen bezel down onto the keyboard. I find this less prone to glare than backlit keyboards, with the extra bonus that you get to see what's on the desk too!


Mk. II's utility lamp is designed to be an even more useful Thinklight. It's much brighter, has a flexible neck so you can point it at stuff, and the LEDs are addressable RGB thingies for shenanigans. It can light a small room, but also be dimmed for keyboard lighting, turned red for night vision preservation, and has a “Party Mode” with animated rainbow patterns!


This part works absolutely flawlessly, and looks very cyberpunk hacker in night vision mode!


Photo: LED lamp close-up.

Keyboard

30% keyboard, Cherry ML switches, trackpoint.


3D printed chassis/keycaps, point to point wiring.


Having built everything else, I found there wasn't really room for a keyboard and graphics tablet. As an afterthought, I built a tiny mechanical keyboard, and even managed to jam a salvaged trackpoint module into it. trackpoints speak PS2, so it was fairly easy to get it working once I figured out which pins were which. With the addition of an Arduino, this tiny thing is both a keyboard and a mouse, though it takes some slightly arcane chording to get anything other than A-Z!


I built the keyboard basically as an afterthought, so it doesn't really have anywhere to go. This is very annoying and pretty silly. Future designs should probably start with the keyboard instead of ending with it!


It's also a pretty terrible keyboard. The layout is just too small and awkward, the keyboard is so light that it slides around constantly, and I don't like the ML switches.


ML switches have a weird key stem that even the original manufacturers didn't seem to be able to produce key caps for that didn't break frequently, and my 3D printed caps are both fragile and wobbly. It turns out these switches are also no longer manufactured, which is presumably why I couldn't source any key caps for them. The final nail in the coffin is that I don't like the feeling of the switches. I'm no fan of mechanical switches to start with, and MLs have a particularly inconsistent gritty feeling tactile actuation that I extra dislike. Honestly, I think if I build another keyboard I'd just like to use rubber domes, I quite like them.


Photo: keyboard labelled with key layout.

Final Thoughts

I'm amazed this silly thing works at all!


By my estimate, Mk. II took around six months of planning and a few weeks of assembling. It was a long and exhausting build, with a bunch of painful set-backs, and hours and hours of doing and un-doing bolts, watching a 3D printer, and waiting for epoxy to cure. The experience was extremely educational and I'm proud of the result, but the journey itself was less than enjoyable.


It'll be a while before I'm likely to try again but, knowing me, I eventually will.