All About USB-C: Cable Types

USB-C cables and connectors: these are controversial topics, and rightfully so – I don’t want to pull any punches. I will also show you that things don’t have to be that bad for you, as long as you’re willing to apply a few tricks and adjust your expectations.

Wild West of Wiring

You might have a bunch of USB-C cables, and they all might look exactly the same, but you’ve likely experienced that they’re not the same internally, and often there’s not a label in sight. Yes, it’s pretty bad, and one could argue it’s getting worse.

I’d like to clarify that I’m only talking about USB C male – USB C male cables here. While cables like USB-A to USB-C are popular, they are quite simple; you get USB 2.0 or USB 3.0 data and 2 A of current at most, and the USB-C plug is usually hardwired as “host, will supply five volts”, which is defined by a pullup resistor. Also, while cables like “Type-C to DisplayPort” might look like cables at a glance, they are adapters with a meaningful amount of active circuitry in them.

Purely following the specification, there used to be six types of USB-C to USB-C cables out there. Then, it became eight. Now, I’m afraid, there’s twelve of them, purely following the spec, and there’s way more when counting all the out-of-spec cables. Good news is – for most of the time, majority of these cables will be suitable for simple tasks like charging and data transfer, and situations where you need a very specific cable are going to be rare enough. Still, let’s go through it, and you’ll see that they’re easier to tell apart than it might look. Continue reading “All About USB-C: Cable Types”

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”