Building Portable Linux Devices: Never Been Easier, But Still Hard

We live in a Golden Age of single-board computers. There was a time when a portable computer that was any good was a relatively rare and expensive device, certainly not something you could expect to replicate for yourself. A Psion, or later a Palm or perhaps a WinCE device would have been a lot more than an impulse purchase, and could not easily have been replicated using the components then available to the experimenter.

Thanks to spin-offs from technology developed for set-top boxes and mobile phones we can now buy any one of a pile of different boards that have almost equivalent power to a desktop computer. The experimenter can leverage that computing power to create their own small portables. Zerophone creator Arsenijs Picugins spoke about the tricky parts of designing a LInux portable at the recent Hackaday Superconference. You’ll find his talk below the break, which makes for a fascinating primer for those tempted to walk in his footsteps.

Zerophone – a Raspberry Pi Smartphone

Minor Details of Portables are the Majority of the Build

In theory, it’s pretty easy to use one of these boards to make a portable computer. Take one of the smaller members of the Raspberry Pi or Beaglebone families, add a battery and a display, and away you go. But as always the devil is in the detail, and for a truly successful build there are a wealth of variables to attend to.

In his talk, Arsenijs takes us through the challenges of power supplies, connectors, and interfaces. In particular there is considerable challenge to running an SBC from a battery small enough to be portable, as efficiency concerns and the ability to easily recharge make for a critical set of choices. Then we learn of another pitfall, that of using USB as a default interface. Power loss in converting 5V to 3.3V that is inconsequential for a desktop computer is a battery-killer in a small device, so we’re pointed at the array of alternatives.

Zerophone screen menu [via @ZeroPhoneOSHW]

Screen Size is a Tricky Spec to Settle

If you’ve been tempted by one of those cheap Raspberry Pi touch screens, you’ll certainly understand that while a full desktop on a screen the size of a playing card looks cool, the reality is almost unusable. Your device will require a user interface that fits its form factor, which from his experience, Arsenijs suggests is best achieved through the medium of buttons rather than a touchscreen on smaller screens. There are a variety of UI and display libraries he introduces us to which make the whole process significantly easier.

Arsenijs’ Zerophone Raspberry Pi smartphone was a finalist in the 2017 Hackaday Prize, and remains an exemplary portable project from which many others can gain inspiration. We are privileged that he was able to bring his experience to speak at the Superconference, and his talk makes for a fascinating watch.

Continue reading “Building Portable Linux Devices: Never Been Easier, But Still Hard” →

Packing Decimal Numbers Easily

While desktop computers have tons of computing power and storage, some small CPUs don’t have a lot of space to store things. What’s more is some CPUs don’t do multiplication and division very well. Same can be said for FPGAs. So suppose we are going to grab a bunch of three-digit decimal numbers from, say, a serial port. We want to store as many as we can, and we don’t want to do a lot of math because we can’t, it is slow, or perhaps it keeps our processor awake longer and we want to sleep to conserve power. We want a way to pack the numbers as close to the theoretical maximum as we can but with little or no math.

The simple approach is to store the numbers as ASCII. Great for processing since they are probably in ASCII already. If they aren’t, you just add 30 hex to each digit and you are done. That’s awful for storage space, though, since we can store 999 in 10 bits if it were binary and now we are using 24 bits! Storing in binary isn’t a good option, if you play by our rules, by the way. You need to multiply by 10 and 100 (or 10 twice) to get the encoding. Granted, you can change that to two shifts and an add (8x+2x=10x) but there’s no easy way to do the division you’ll have to do for the decode.

Of course, there’s no reason we can’t just store decimal digits. That’s call binary coded decimal or BCD and that has some advantages, too. It is pretty easy to do math on BCD numbers and you don’t get rounding problems. Some CPUs even have specific instructions for BCD manipulation. However, three digits will require 12 bits. That’s better than 24, we agree. But it isn’t as good as that theoretical maximum. After all, if you think about it, you could store 16 distinct codes in 4 bits, and we are storing only 10, so that 6 positions lost. Multiply that by 3 and you are wasting 18 codes.

But there is a way to hit that ten-bit target without doing any math. Its called DPD or densely packed decimal. You can convert three decimal digits into ten bits and then back again with no real math at all. You could implement it with a small lookup table or just do some very simple multiplexer-style logic which means it is cheap and easy to implement in software or onboard an FPGA.

Continue reading “Packing Decimal Numbers Easily” →

Katrina Nguyen Automates Her Mice

When embarking on a career in the life sciences, it seems like the choice of which model organism to study has more than a little to do with how it fits into the researcher’s life. I once had a professor who studied lobsters, ostensibly because they are a great model for many questions in cell biology; in actuality, he just really liked to eat lobster. Another colleague I worked with studied salt transport in shark rectal glands, not because he particularly liked harvesting said glands — makes the sharks a tad grumpy — but because he really liked spending each summer on the beach.

Not everyone gets to pick a fun or delicious model organism, though, and most biologists have had to deal with the rats and mice at some point. It’s hard to believe how needy these creatures can be in terms of care and feeding, and doubly so when feeding is part of the data you’re trying to collect from them. Graduate student Katrina Nguyen learned this the hard way, but rather than let her life be controlled by a bunch of rodents, she hacked a solution that not only improved her life, but also improved her science. She kindly dropped by the Hackaday Superconference to tell us all about how she automated her research.

Continue reading “Katrina Nguyen Automates Her Mice” →

Linux Fu: Controlling The Terminal

A Linux terminal has a lot more features than the TeleType of yore. On a TeleType, text spews out and scrolls up and is gone forever. A real terminal can use escape characters to do navigate around and emulate most of what you like about GUIs. However, doing this at the lowest level is a chore and limits portability. Luckily, all the hard work has already been done.

First, there’s a large database of terminal capabilities available for you to use: terminfo.  And in addition, there’s a high-level library called curses or ncurses that simplifies writing programs to control the terminal display. Digging deep into every nook and cranny of ncurses could take years. Instead, I’m going to talk about using a program that comes with ncurses to control the terminal, called tput. Using these two commands, you can figure out what kind of terminal you’re dealing with, and then manipulate it nearly to your heart’s content. Let’s get started!

Continue reading “Linux Fu: Controlling The Terminal” →

Bill Gross On Why Your Startup Will Succeed

Bill Gross is one of the great heros when it comes to technology incubators. Twenty years ago, he founded Idealab, a business whose business plan is to create more businesses. This started out with just a handful of companies in 1996, and has since gone on to found 150 companies, that have collectively raised three and a half billion dollars. Out of these companies, more than half have either gone through successful IPOs and acquisitions, or are currently operating. That investment has generated a 13.5x return, and created more than 10,000 jobs.

Obviously, when you want to talk about what goes into a successful startup, Bill Gross is the person you want to talk to. We were happy to have him Keynote the Hackaday Superconference this year, and the lessons he shared might surprise you, especially if you’re interested in starting your own business.

Continue reading “Bill Gross On Why Your Startup Will Succeed” →

Designing Space-Rated PCBs

We’ve reduced printed circuit board design to practice so much that we hardly give a thought to the details anymore. It’s so easy to bang out a design, send it to a fab house, and have ten boards in your hands in no time at all. All the design complexities are largely hidden from us, abstracted down to a few checkboxes on the vendor’s website.

There’s no doubt that making professional PCB design tools available to the hobbyist has been a net benefit, but there a downside. Not every PCB design can be boiled down to the “one from column A, one from column B” approach. There are plenty of applications where stock materials and manufacturing techniques just won’t cut it. PCBs designed to operate in space is one such application, and while few of us will ever be lucky enough to have a widget blasted to infinity and beyond, learning what’s behind space-rated PCBs is pretty interesting.

Continue reading “Designing Space-Rated PCBs” →

Hackaday Links Column Banner

Hackaday Links: November 25, 2018

Bad Obsession Motorsport have been stuffing the engine and suspension from a 4WD Celica into an old Mini since forever. It is a wonderful homage to Police Squad and some of the best machining and fabrication you’ll see on YouTube. The latest episode tackled the electrical system and how to drive an alternator in an extremely cramped engine bay. The solution was a strange flex-shaft confabulation, and now the Bad Obsession Motorsport guys have a video on how they attached an alternator to a car where no alternator should go. It’s forty minutes of machining, go watch it.

Last Friday was Black Friday, and that means it’s time to CONSUME CONSUME CONSUME. Tindie’s having a sale right now, so check that out.

I’m the future of autonomous flight! This week, I got a market research survey in my email from Uber, wanting me to give my thoughts on autonomous ridesharing VTOL aircraft. Uber’s current plan for ridesharing small aircraft involves buying whatever Embraer comes up with (Uber is not developing their own aircraft), not having pilots (this will never get past the FAA), and turning a random parking lot in LA into the busiest airport in the world (by aircraft movements, which again is something that will never get past the FAA). Needless to say, this is criminally dumb, and I’m more than happy to give my thoughts. Below are the relevant screencaps of the survey:

The crux of this survey is basic market research; how much would I pay for a VTOL ride sharing service versus buying a new (autonomous) car versus using an autonomous Uber. You’ve also got a Likert scale thingy asking me if I’m comfortable flying in a battery-powered aircraft. Protip: I highly doubt anyone given this survey has flown in a battery-powered aircraft. Proprotip: the easiest way to screw up the scoring for a Likert scale is to answer ‘1’ for the first question, ‘2’ for the second, etc., and wrap back around to ‘1’ for the sixth question.

Don’t worry, though: I answered all the questions truthfully, but Uber Air will never happen. The FAA won’t let this one fly, and no company will ever carry passengers without a licensed pilot on board.