Projects - Tufty 2040 Conbadge

Look, look at the thing!

Thing!

So this is a digital convention badge in a 3D-printed case, based around a neat display-and-microcontroller combination (and some other components) from Pimoroni. In the video you can see the main thing I coded for it:

This particular build integrates a rechargable battery and, unlike the others I've seen, a charge controller so it just acts as a USB gizmo you can charge on the run with a normal phone charger, laptop port, convenient unattended Protogen, etc. No disassmbling it and fiddling with JST-PH connectors to hook a cell into a special charger every time it runs flat!

Ingredients

This is built from:

(None of these are affiliate links or anything. This is a hobby and some excited lookit lookit look at the thing I made, look.)

You will also want a USB-C cable (it can be A on the other end, whatever your computer/charger can do), a long-ish, small-tipped Phillips-head (or Pozidriv) screwdriver, and some needle-nose pliers (computer repair tools should cover these). And a little bit of sticky tape.

And a 3D printer. If you don't have one of those find your local makerspace and say hello. (This isn't the hardest print in the world, but it's still a bit fine, so definitely get some help if you're not a seasoned plastic-depositor. I printed it successfully as my first-ever print, but that's because of help and guidance from other friendly smart folk, and a really fancy printer that is a bit more idiot-proof than some.)

Case

I designed a custom case (with a lot of great help from Balázs) that compactly holds this lot together. Aside from allowing for the Amigo board, it's also just two pieces, and both are relatively nice to print—you can get away without supports (although a couple tiny cutouts might sag and need filing if so).

OnShape project
This the native format, for a pretty nice web-base CAD system with a free tier for hobbyists. You can export from this to your format of choice, and since it has all the constraint-based sketches, it's the easiest to edit. You want the "Middle layer" and "Back" parts from the "Case" tab.
STL files: middle, back
These are exports of the model in the usual format for printing, if you just want it as-is without needing to sign up for OnShape (or if [an archive of] this site has outlived it).
CAD formats: STEP, IGES (whole assembly with the modelled boards: STEP, IGES)
These are more useful for importing into other CAD software, and still having some of the geometry intact.
Schematic drawings: DXF middle, back
These don't seem to include dimensions, unfortunately, which doesn't make them super useful.
You can export from OnShape the sketches which are used to construct the modelled Tufty and Amigo PCBs (and battery), and the case, but these are not the complete model and are missing all the information on how they combine and are extruded/cut from each-other, so aren't great either.
Manual drawings: measurements, concept, design
These are just my initial caliper measurements and design idea, for curiosity's sake!

(If for some reason you want the older version from my first print: STL middle, back. These will need some slight filing down, though!)

Things you might want to customize:

(If you do make derivatives, the case is under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.)

Printing

Mine printed in about two and half hours and 14g of PLA filament on an Ultimaker S5. I am not an experienced 3D printsmith, so can't give much advice, but pay attention to:

Lookit it go! (Also: side-on timelapse!)

Assembly

Leave the screen protector on the Tufty! Protecting the screen during assembly is what it's for. Resist the temptation to peel!
(Since it's nice and clear and flat, I actually suggest leaving it on to protect it while wearing it, too. Better to scuff that than the screen itself.)

Here's an under-seven-minute assembly video, or read on for words:

There's a 4K version of the assembly video on YouTube.

To assemble everything:

The Amigo is going to locate on pins in the lid like this (cables disconnected and uncurled to avoid obscuring everything and let it lie flat):

The two halves of the case opened, with the back of the Tufty and the mid piece and battery on one side, and the Amigo sat words-up in the case back on the other.

(If you haven't previously checked it's all working, do so before you bolt it together! Hit the PWR button on the Amigo and then the one on the Tufty and it should show the colorful menu. Hit the PWR button on the Amigo again to turn it back off. Do be careful not to clonk the Amigo against the Tufty and short anything, but I, uh, did this a few times during all my prototyping and got away with it.)

Power it on (see below) and give it a try! You might want to check if the nuts need retighening every so often, especially as things settle after initial construction, or after a lot of activity. I don't really recommend trying to glue them; you won't have a good way to disassemble it again.

Care and feeding

The flexible button built into the rear of the case turns the power supply from the battery to the Tufty on and off. While it's on, a bright white LED glows out through the case (don't worry, it doesn't come out the front/sides, just the part that's against your shirt). The Tufty, slightly unfortunately, also has its own power button, which is exposed through a slot on the top. Slip your fingernail in and aim for the button on the left.

To turn the badge on:

To turn the badge off:

You don't need to turn the Tufty board itself off; cutting power to it is enough. (It's a microcontroller; there's no Linux to shut down here.)

The USB socket on the bottom, partway through the thickness of the case, is the one on the Amigo, for charging the battery. While the battery is charging, a red charge LED should glow out through the slots on the back. Charging fully seems to take about two hours (this seems about right for the 400 mAh/200 mA math), after which the light goes out. The Tufty won't know about the charge state while charging—it sees the "full charge" supply voltage.

Experimentally, a full charge lasts about 10 hours running my script, which is doing dynamic display brightness and constantly color-cycling. After that it drops into "low power mode" (3.1v, the shutoff is at 3.0v) and cuts out about half-an-hour later. A simpler script that does less work might last longer.

The USB socket on the side, direcly on the Tufty board, is for programming the microcontroller. Using this doesn't involve the battery part of the badge, so the Amigo can be left turned off (no white LED). (Or it could be charging the battery at the same time, if you plugged in both sockets!)

If you're brave, the "fast charge" on the Amigo should be safe to enable, since the battery has its own protection circuit—see its product page. I haven't tried, so don't know if it'd offer a speedup (in theory, it might about double it).

You can also turn on the badge while it's charging, but it'll slow down the charge. (There's a really helpful review comment on the Amigo that has no URL to link, but basically the charge limiting covers the battery and the device.) Charging it while wearing it is also probably not a great idea.

Software

First and foremost: follow Pimoroni's own Getting Started with Tufty 2040 to get the software environment set up. In particular you should make sure you follow the instructions to update the custom MicroPython to at least version 1.20.6 (for PNG and fixed fixed-width font support). This guide also sets you up with Thonny to upload files to the Tufty from your computer. You should also copy over the updated main.py if you have an old version, since I fixed some upstream memory issues.

Remember to use the side USB port to connect your Tufty for programming!

You should totally try writing your own badge script! Simple, self-contained, interactive projects are some of the most immediately rewarding things to tinker with, and provide a great way to personalize your badge beyond just uploading a custom graphic. The examples (which should also have flashed onto your Tufty with the MicroPython update) have some great pointers.

(To realistically set expectations though, especially if you're reading this while thinking if you want to try to buy and build one of these, the PicoGraphics library cannot really drive arbitrary graphics to the screen fast enough to do full-screen animation. You would probably have to use C++, or the techniques I've used like palette-cycling.)

If you leave main.py alone, other .py files you save to the Tufty will appear in the startup menu for you to select from. This is a great way to be able to switch between entirely different scripts while wearing it, away from a computer.

(Tip: adjust selected_item, target_scroll_position, and target_scroll_position in main.py to change which one is selected on power-on.)

My badge script

That said, here's a slightly stripped-down version of mine on GitHub under a copyleft license (or a local ZIP). It provides:

You'll have to provide your own art though! 😺

But can it run DOOM…?

Ha.

Watch this space.

See also

The Mastodon post where I announced this! Maybe it has some discussion or something. Don't ask me, I'm a static webpage.

(There's also a horrible birdsite post, if that's still up.)

Other builds

If you looked at all this and thought "man, I hate colour, but I love battery life and radio signals", Pimoroni also do a couple of e-ink badge boards, one with wifi. Note you can't just substitute those in for the Tufty here though, you'll need a different case.

Tail of the page

Pimoroni also have a solution to the "can I just drive an individually-addressible LED strip off USB power and a programmable microcontroller and not have to care about logic-level shifting" in the Plasma 2040, which is something I'd wanted for a while. Go check that out if you want to be luminous. (I haven't built mine into anything yet, so it's just been camoflaged as christmas lights for now.)

Also I have an room environment sensing and logging project using a full-fat Raspberry Pi and some slottable Pimoroni expansion boards. (They make a lot of cool things that scratch the "I really don't want to get hardcore into electronics, I have enough hobbies already" itch. Support small businesses who make cool things.)

Seriously though, Bromptons are great, they're tremendously elegant folding bikes and hugely maneuverable in city and even light countryside environments, and…