M.2 For Hackers – Connectors

In the first M.2 article, I’ve described real-world types and usecases of M.2 devices, so that you don’t get confused when dealing with various cards and ports available out there. I’ve also designed quite a few M.2 cards and card-accepting adapters myself. And today, I’d like to tell you everything you need to know in order to build M.2 tech on your own.

There’s two sides to building with M.2 – adding M.2 sockets onto your PCBs, and building the PCBs that are M.2 cards. I’ll cover both of these, starting with the former, and knowing how to deal with M.2 sockets might be the only thing you ever need. Apart from what I’ll be describing, there’s some decent guides you can learn bits and pieces from, like the Sparkfun MicroMod design guide, most of which is MicroMod-specific but includes quite a few M.2 tips and tricks too.

First, Let’s Talk About The Y-Key

What could you do with a M.2 socket on your PCB? For a start, many tasty hobbyist-friendly SoMs and CPUs now have a PCIe interface accessible, and if you’re building a development board or a simple breakout, an M.2 socket will let you connect an NVMe SSD for all your high-speed low-power storage needs – many Raspberry Pi Compute Module mainboards have M.2 M-key sockets specifically for that, and there’s NVMe support in the RPi firmware to boot. Plus, you can always plug a full-sized PCIe adapter or an extender into such a socket and connect a PCIe network card or other much-needed device – even perhaps, an external GPU! However, as much as PCIe-equipped SoMs are tasty, they’re far from the only reason to use M.2 sockets.

Continue reading “M.2 For Hackers – Connectors”

Moving Big Stuff Without The Tears

It’s something that has probably happened to more than one of us over the years, there’s an unmissable opportunity at the machinery auction or on eBay, with the small snag that it weighs a ton and requires a flatbed truck to transport. A big lathe, a bandsaw, or the like.

The sensible option would be to hire a crane or a forklift to do the job, but cash is tight so at the appointed hour the truck turns up at the end of your driveway to meet you and as big a group of your friends as you could muster. You’re going to shift this thing with pure muscle power! If you grow up around any form of workshop-based small business it’s something you’ll no doubt be familiar with. Craftsmen seem to have a network for such moments, so just as the blacksmith might find himself helping the woodworker unload a huge saw bench, so might they both spend an unexpected afternoon at the engineering shop manhandling a lathe.

It came as a shock in a casual hackerspace conversation to realise how many times I’d been involved in such maneuvers at home, for friends, or at hackerspaces, and how that experience in doing so safely isn’t necessarily something that’s universal. Maybe it’s time to tell the story of moving big machines on limited resources. This is something that starts by thinking ahead and planning what you’ll need and where you’ll need it. Continue reading “Moving Big Stuff Without The Tears”

M.2 For Hackers – Expand Your Laptop

You’ve seen M.2 cards in modern laptops already. If you’re buying an SSD today, it’s most likely an M.2 one. Many of our laptops contain M.2 WiFi cards, the consumer-oriented WWAN cards now come in M.2, and every now and then we see M.2 cards that defy our expectations. Nowadays, using M.2 is one of the most viable ways for adding new features to your laptop. I have found that the M.2 standard is quite accessible and also very hackable, and I would like to demonstrate that to you.

If you ever searched the Web trying to understand what makes M.2 tick, you might’ve found one of the many confusing articles which just transcribe stuff out of the M.2 specification PDF, and make things look more complicated than they actually are. Let’s instead look at M.2 real-world use. Today, I’ll show you the M.2 devices you will encounter in the wild, and teach you what you need to know to make use of them. In part 2, I will show you how to build your own M.2 cards and card-accepting devices, too!

Well Thought-Out, Mostly

You can genuinely appreciate the M.2 standard once you start looking into it, especially if you have worked with mPCIe devices for some amount of time. mPCIe is what we’ve been using for all these years, and it gradually became a mish-mash of hardly-compatible pinouts. As manufacturers thought up all kinds of devices they could embed, you’d find hacks like mSATA and WWAN coexistence extensions, and the lack of standardization is noticeable in things like mPCIe WWAN modems as soon as you need something like UART or PCM. The M.2 specification, thankfully, accounted for all of these lessons.

Continue reading “M.2 For Hackers – Expand Your Laptop”

Git Your PCBs Online

Last time, I’ve shown you how to create a local Git repository around your PCB project. That alone provides you with local backups, helping you never lose the changes you make to your files, and always be able to review the history of your project as it developed.

However, an even more significant part of Git’s usefulness is the ability to upload our creations to one of the various online Git repository hosting services, and keep it up to date at all times with a single shell command. I’d like to show you how to upload your project to GitHub and GitLab, in particular!

Continue reading “Git Your PCBs Online”

Lithium-Ion Batteries Are Easy To Find

In the first article, I’ve given you an overview of Lithium-Ion batteries and cells as building blocks for our projects, and described how hackers should treat their Lithium-Ion cells. But what if you don’t have any LiIon cells yet? Where do you get LiIon cells for your project?

Taking laptop batteries apart,  whether the regular 18650 or the modern pouch cell-based ones, remains a good avenue – many hackers take this road and the topic is extensively covered by a number of people. However, a 18650 cell might not fit your project size-wise, and thin batteries haven’t quite flooded the market yet. Let’s see what your options are beyond laptops. Continue reading “Lithium-Ion Batteries Are Easy To Find”

Books You Should Read: The Hardware Hacker’s Handbook

Here on Hackaday, we routinely cover wonderful informative writeups on different areas of hardware hacking, and we even have our own university with courses that delve into topics one by one. I’ve had my own fair share of materials I’ve learned theory and practical aspects from over the years I’ve been hacking – as it stands, for over thirteen years. When such materials weren’t available on any particular topic, I’d go through hundreds of forum pages trawling for details on a specific topic, or spend hours fighting with an intricacy that everyone else considered obvious.

Today, I’d like to highlight one of the most complete introductions to hardware hacking I’ve seen so far – from overall principles to technical details, spanning all levels of complexity, uniting theory and practice. This is The Hardware Hacking Handbook, by Jasper van Woudenberg and Colin O’Flynn. Across four hundred pages, you will find as complete of an introduction to subverting hardware as there is. None of the nuances are considered to be self-evident; instead, this book works to fill any gaps you might have, finding words to explain every relevant concept on levels from high to low.

Apart from the overall hardware hacking principles and examples, this book focuses on the areas of fault injection and power analysis – underappreciated areas of hardware security that you’d stand to learn, given that these two practices give you superpowers when it comes to taking control of hardware. It makes sense, since these areas are the focus of [Colin]’s and [Jasper]’s research, and they’re able to provide you something you wouldn’t learn elsewhere. You’d do well with a ChipWhisperer in hand if you wanted to repeat some of the things this book shows, but it’s not a requirement. For a start, the book’s theory of hardware hacking is something you would benefit from either way. Continue reading “Books You Should Read: The Hardware Hacker’s Handbook”

Natural Language AI In Your Next Project? It’s Easier Than You Think

Want your next project to trash talk? Dynamically rewrite boring log messages as sci-fi technobabble? Happily (or grudgingly) answer questions? Doing that sort of thing and more can be done with OpenAI’s GPT-3, a natural language prediction model with an API that is probably a lot easier to use than you might think.

In fact, if you have basic Python coding skills, or even just the ability to craft a curl statement, you have just about everything you need to add this ability to your next project. It’s not free in the long run, although initial use is free on signup, but for personal projects the costs will be very small.

Basic Concepts

OpenAI has an API that provides access to GPT-3, a machine learning model with the ability to perform just about any task that involves understanding or generating natural-sounding language.

OpenAI provides some excellent documentation as well as a web tool through which one can experiment interactively. First, however, one must create an account and receive an API key. After that is done, the doors are open.

Creating an account also gives one a number of free credits that can be used to experiment with ideas. Once the free trial is used up or expires, using the API will cost money. How much? Not a lot, frankly. Everything sent to (and received from) the API is broken into tokens, and pricing is from $0.0008 to $0.06 per thousand tokens. A thousand tokens is roughly 750 words, so small projects are really not a big financial commitment. My free trial came with 18 USD of credits, of which I have so far barely managed to spend 5%.

Let’s take a closer look at how it works, and what can be done with it!

Continue reading “Natural Language AI In Your Next Project? It’s Easier Than You Think”