Using Pad Printers To Add Color To Artistic PCBs

I’ve done a few experiments in adding color to printed circuit boards. These experiments used a process known as pad printing, and so far all indications are that pad printing is a viable process for truly multicolor artistic PCBs. For this year’s DEF CON, I’m stepping things up and taking them to their logical conclusion. I’m making true multicolor PCBs with orange and blue ink. This is, I believe, the first time this has ever been done with printed circuit board art, and it is certainly the first time it has ever been documented.

You may be wondering why I need more color on my boards. It’s that time of year again where PCB artisans all around the world are gearing up for badgecon DEF CON. For the last few years, independent badge makers have come together to form a demoscene of hardware creation. This year, add-ons for badges are a thing, and everyone is getting in on the game. Tindie is filled with amazing electronic badges and add-ons that will be found at this year’s DEF CON. There are badges featuring the Cromulon from Rick and Morty, baby Benders from Futurama, pikachus, and glowing tacos.

This is all about badge art, but when it comes to rendering an image in fiberglass and soldermask, everyone is working with a limited palette. Yes, you can get pink and orange soldermask, but I can’t find a place that will do it inexpensively. For any PCB, your choice of colors are only green, red, yellow, blue, purple, black, or white. No, you can’t mix them.

But I want both orange and blue, on the same board, cheaply and easily — here’s how I did it.

Continue reading “Using Pad Printers To Add Color To Artistic PCBs”

The Machinists’ Mantra: Level Thy Lathe

Let’s say you’ve gone and bought yourself a sweet sweet metal lathe. Maybe it’s one of the new price-conscious Asian models, or maybe it’s a lovely old cast iron beast that you found behind a foreclosed machine shop. You followed all the advice for setting it up, and now you’re ready to make chips, right? Well, not so fast. Unlike other big power tools, such as band saws or whatever people use to modify dead trees, machine tools need to be properly level. Not, “Hurr hurr my carpenter’s level says the bubble is in the middle”, but like really level.

This is especially true for lathes, but leveling is actually a proxy for something else. What you’re really doing is getting the entire machine in one plane. Leveling is a primitive way of removing twist from the structure. It may not seem like a huge piece of cast iron could possibly twist, but at very small scales it does! Everything is a spring, and imperceptible twist in the machine will show up as your lathe turning a couple thousandths of taper (cone) when it should be making perfect cylinders. All this is to say, before making chips, level your lathe. Let me show you the way. Continue reading “The Machinists’ Mantra: Level Thy Lathe”

Coolest Way to Watch 3D Printing: Lights, Camera, Octolapse!

Octoprint is a household name for anyone into 3D printing and anyone regularly reading Hackaday. Described by creator Gina Häußge as “the snappy web interface for your 3D printer”, Octoprint allows you to control effectively any desktop 3D printer over the local network or Internet. It even has webcam support so you can watch your printer while it works, meaning you can finally put that video baby monitor back into the crib with Junior.

While the core functionality of Octoprint is fantastic alone, its true power is unlocked through the plugin system and the community that’s sprung up around it. With plugins, Octoprint can do everything from control RGB light strips in your printer’s enclosure to sending status messages via Discord. One particularly popular plugin that has been making the rounds lately is Octolapse by [FormerLurker]. This plugin provides a comprehensive intelligent system for creating time-lapse videos of prints.

What does that mean? Well, instead of simply taking a picture every few seconds like you’d do traditionally, Octolapse actually keeps track of the printer’s motions while its running. It can then take a picture at the opportune moment to create a number of user-selected effects. More importantly, it can even take control of the printer directly; moving the hotend away from the print before taking a picture. The effect is that the print simply “grows” out of the bed.

I thought it would be interesting to take a closer look at Octolapse and see just what it takes to create one of those awesome time-lapse videos. It turned out to be somewhat trickier than I anticipated, but the end results are so fantastic I’d say it’s a technique worth mastering.

Continue reading “Coolest Way to Watch 3D Printing: Lights, Camera, Octolapse!”

Linux Fu: Scripting for Binary Files

If you ever need to write a binary file from a traditional language like C, it isn’t all that hard to do. About the worst thing you might have to deal with is attempts to fake line endings across Windows and Linux, but there’s usually a way to turn that off if it is on by default. However, if you are using some type of scripting language, binary file support might be a bit more difficult. One answer is to use a tool like xxd or t2b (text-to-binary) to handle the details. You can find the code for t2b on GitHub including prebuilt binaries for many platforms. You should be able to install xxd from your system repository.

These tools take very different approaches. You might be familiar with tools like od or hexdump for producing readable representations of binary files. The xxd tool can actually do the same thing — although it is not as flexible. What xxd can even reverse itself so that it can rebuild a binary file from a hex dump it creates (something other tools can’t do). The t2b tool takes a much different approach. You issue commands to it that causes it to write an original hex file.

Both of these approaches have some merit. If you are editing a binary file in a scripting language, xxd makes perfect sense. You can convert the file to text, process it, and then roll it back to binary using one program. On the other hand, if you are creating a binary file from scratch, the t2b program has some advantages, too.

I decided to write a few test scripts using bash to show how it all works. These aren’t production scripts so they won’t be as hardened as they could be, but there is no reason they couldn’t be made as robust as you were willing to make them.

Continue reading “Linux Fu: Scripting for Binary Files”

Linux Fu: The Great Power of Make

Over the years, Linux (well, the operating system that is commonly known as Linux which is the Linux kernel and the GNU tools) has become much more complicated than its Unix roots. That’s inevitable, of course. However, it means old-timers get to slowly grow into new features while new people have to learn all in one gulp. A good example of this is how software is typically built on a Linux system. Fundamentally, most projects use make — a program that tries to be smart about running compiles. This was especially important when your 100 MHz CPU connected to a very slow disk drive would take a day to build a significant piece of software. On the face of it, make is pretty simple. But today, looking at a typical makefile will give you a headache, and many projects use an abstraction over make that further obscures things.

In this article, I want to show you how simple a makefile can be. If you can build a simple makefile, you’ll find they have more uses than you might think. I’m going to focus on C, but only because that’s sort of the least common denominator. A make file can build just about anything from a shell prompt.

Continue reading “Linux Fu: The Great Power of Make”

Buttery Smooth Fades with the Power of HSV

In firmware-land we usually refer to colors using RGB. This is intuitively pleasing with a little background on color theory and an understanding of how multicolor LEDs work. Most of the colorful LEDs we are use not actually a single diode. They are red, green, and blue diodes shoved together in tight quarters. (Though interestingly very high end LEDs use even more colors than that, but that’s a topic for another article.) When all three light up at once the emitted light munges together into a single color which your brain perceives. Appropriately the schematic symbol for an RGB LED without an onboard controller typically depicts three discrete LEDs all together. So it’s clear why representing an RGB LED in code as three individual values {R, G, B} makes sense. But binding our representation of color in firmware to the physical system we accidentally limit ourselves.

The inside of an RGB LED

Last time we talked about color spaces, we learned about different ways to represent color spatially. The key insight was that these models called color spaces could be used to represent the same colors using different groups of values. And in fact that the grouped values themselves could be used to describe multidimensional spacial coordinates. But that post was missing the punchline. “So what if you can represent colors in a cylinder!” I hear you cry. “Why do I care?” Well, it turns out that using colorspace can make some common firmware tasks easier. Follow on to learn how!

Continue reading “Buttery Smooth Fades with the Power of HSV”

Getting Good at FPGAs: Real World Pipelining

Parallelism is your friend when working with FPGAs. In fact, it’s often the biggest benefit of choosing an FPGA. The dragons hiding in programmable logic usually involve timing — chaining together numerous logic gates certainly affects clock timing. Earlier, I looked at how to split up logic to take better advantage of parallelism inside an FPGA. Now I’m going to walk through a practical example by modeling some functions. Using Verilog with some fake delays we can show how it all works. You should follow along with a Verilog simulator, I’m using EDAPlayground which runs in your browser. The code for this entire article is been pre-loaded into the simulator.

If you’re used to C syntax, chances are good you’ll be able to read simple Verilog. If you already use Verilog mostly for synthesis, you may not be familiar with using it to model delays. That’s important here because the delay through gates is what motivates us to break up a lot of gates into a pipeline to start with. You use delays in test benches, but in that context they mostly just cause the simulator to pause a bit before introducing more stimulus. So it makes sense to start with a bit of background on delays.

Continue reading “Getting Good at FPGAs: Real World Pipelining”