CircuitPython Badge

A handheld running CircuitPython and cheap enough for a badge.

Similar projects worth following

More and more conferences want to have a cool badge. But most badges are not really that interesting or useful. Sure, you can learn soldering if you have to assemble it yourself — but then most people never do. You can play tetris during boring talks, or, if you really don't want to attend any talks, you can spend time programming it in some exotic assembly to play snake. And as soon as you get home, it goes into a drawer to never see the light of day again.

But we can do better than that!

We can make a badge that is useful during the conference — that has USB disk storage where you can put conference materials, slides of all talks, etc. It can display the schedule, and maybe even have reminders for the talks you wanted to see. It can have some simple games for the boring talks, but also perhaps some social games, to make you talk to other people. But most importantly of all, it can be super-easy to program, without having to install anything on your computer or learn some esoteric language — by simply copying Python files on it. And finally, when you get home from the conference, you can incorporate it into other projects.

This project is not about a badge for any particular conference. It's about making a baseline project, that can be then taken and extended/modified for a particular conference. The idea is that it should be easier to make something actually useful, instead of a gadget with blinking LEDs.

  • PCBs on the Way

    ðeshipu3 days ago 0 comments

    It's the first time I'm ordering the PCBs at, so I'm not entirely sure how this will go. Looking at the order status page, they have already shipped them, so I hope to have them here in a couple of days.

    In the mean time, I found a mistake — of course! The SDB pin on the IS31FL3733 should be pulled up, while I am pulling it down. This is a third time I'm making this mistake, because on the schematic on the datasheet that pin is pulled down and connected to a microcontroller pin, so that the chip is disabled by default and can be enabled on demand. But in this case I want the chip to be always on, and I don't want to waste a pin for this. Fortunately, I can simply solder the resistor only by one of its pads, and use bodge wire to connect it to a nearby via.

    I am also considering upping the display resolution to luxurious 16×16 by using an IS31FL3741 and four 8x8 matrices. That would of course require a redesign, and I don't have any IS31FL3741 at hand, so we will see. The 14×11 I have right now should be good enough, and four matrices instead of two would push the price a bit.

  • A Short Video

    ðeshipu6 days ago 0 comments

    I was meaning to make a short video where I explain the idea behind this badge while I draw, but I only got as far as drawing it all. I think you can still guess the narrative there (or maybe it's just me, because I know what I wanted to say), so I will link the video here anyways. Sadly, I don't think I'm any good with adding voice to it, so you will have to just imagine it's there.

  • Mockup

    ðeshipu04/14/2018 at 14:18 0 comments

    Since the contest requires it, and since I finally know what shape this badge is going to have, here's a little mockup image, at 1:1 scale, with some of the parts placed next to it to give a better idea of how it's going to look like.

    I'm considering making it so that you can break off the bottom part and wear it as a badge alone, and use the electronic part of the badge separately. The battery holder is too big, because it's a 4 AAA one, not 3 AAA — I didn't have the correct size at hand.

  • Redesigned PCB

    ðeshipu04/14/2018 at 13:58 0 comments

    I couldn't sleep this night, and that means I got to redo the PCB from the last log. I like it much better now:

    There is a number of improvements and cool things about it:

    • Most components (except for the display driver and accelerometer) are not covered by the display, so they can be easily inspected and debugged.
    • The USB socket and the switch are now on the side, which means you can have the empty part of the badge either at the top or at the bottom.
    • I got rid of the prototyping area (nobody would have a soldering iron at the conference anyways), and replaced it with two grove connectors — one for I²C and one for analog in/out.
    • The accelerometer is in the center of the board, so you can easily calculate its orientation.
    • I added a footprint for an NRF24L01 radio module. I am not yet sure what we will use for communication, but this module is common and cheap, and lets us provide a similar interface to what the "radio" module does on the micro:bit. This could be easily modified to instead have a wifi, bluetooth, lora, nfc or anything else — the pins used support both SPI and UART.
    • The back of the board is still completely empty, and has plenty of room for the battery holder. Unfortunately I wasn't able to include mounting holes for the holder (they would be in the center, where the accelerometer and display driver are), so it will need to be glued with a double-sided tape.
    • The display's LEDs are powered directly from the USB or battery, without voltage regulation — that should save some power. As a side effect, because USB will have higher voltage than the battery, the display will probably be a little bit brighter when connected.
    • The switch switches between battery and USB power, so no diodes or mosfets necessaery for backfeed protection of the USB.
    • The MCU has a double footprint — for both QFN and TQFP packages. I'm going to use TQFP for testing, because they are easier to handle and that's what I have at hand, but for production QFN is cheaper.

    Overall, I'm pretty happy with it already. Over the weekend I will poke at it a little bit more, verify everything, and on Monday I'm going to order a prototype PCB.

  • The Matrix

    ðeshipu04/13/2018 at 22:39 0 comments

    After yesterday's log, it has become clear to me what shape and size the badge should have and what I should use for the display. Behold:

    This is a matrix I made when playing with the ISSI chips for the #D1 Mini Matrix Deluxe Shields. It's two 7×11 matrices, side by side, driven by the IS31FL3733 chip. Each pixel has 256 values of brightness, independent from the 256 values of global brightness and with gamma correction lookup table. It also has 4 kinds of hardware blinking, selected per pixel. And everything controlled over an I2C bus. The only problem with this is that the matrices have a rather stupid pinout, so there is not even a chance for routing it nicely in order. But we can remap rows and columns in software, so we should be fine.

    As for the shape, I decided to make it a game handheld again, with a large empty area below it for conference logos and participant's name. This way it can be held comfortably for playing. For now I'm skipping the empty half of the PCB — no reason to pay for it in the prototypes, when it won't contain any important parts. The final design will be exactly 10×10cm.

    I made a first stab at the PCB routing:

    You can see that LED driver chip has some dense traces. There is a direction pad and four buttons, also arranged in a direction pad — so that you could make a two-player game, or swap the buttons for left-handed people. There is also a prototyping area in the corner, where you can connect additional parts or modules.

    I wanted to include an accelerometer (the small footprint in the middle), but I'm having a hard time routing the traces for it. It has to be in the center of the board (so that rotations work right), but there is quite a bit of things in there. Also, the design generally has too many vias to my taste. Plus the USB socket is too thick, so the matrix that comes on top of it would stick out a bit — I'm thinking about moving it to the side.

    There is no battery charging, since at this size I can simply include a battery holder for 3 AAA batteries — that should be enough for a day of a conference. Some tests are in order, of course.

    I'm not ordering the PCB just yet — I'm hoping I can do a better job with the design.

  • Taking a Step Back

    ðeshipu04/12/2018 at 14:12 0 comments

    After indulging myself with trying out different hardware and prototypes, I realized that I really don't have enough information to design a good badge. You know, all those displays and chips and sensors and buttons and batteries are cool, but at the end of the day you have to *design* something that serves a *purpose*, and if you don't make that the center of your design, there is a big chance it will suck. So let's take a step back and think what we need.

    Core Functionalities

    Things without which a badge is not a badge. These are non-negotiable requirements.


    This is so basic, that it's easy to forget about it, and go designing watches or belt buckles. First and foremost a conference badge has to identify its wearer to all other conference participants that they might meet. That usually means that it has to have the owner's name (or nickname) displayed prominently somewhere at all times in a way that makes it visible and easy to read from a relatively large distance.

    In practice, this means that the badge has to be worn in a visible place (traditionally on your neck, but clipped to your breast pocket or bag strap would also work). It also sets the minimum size of the badge — it can't be the 5×5cm tiny little device that I initially planned — that will simply not work.

    The simplest, most fault-proof, long-lasting, convenient and obvious way of achieving this is to simply have a white area on the badge where you can write your name with a sharpie. It always works, even if you run out of battery or release the blue smoke, you can fix it if you made a mistake, and you don't need to know the names of all participants up front — you can even have some spare badges. It also makes it obvious which badge is yours, in case you mix them up while hacking on them.

    I really have no idea what I was thinking with the e-ink display.


    The second function of a badge like this is to provide your contact information to anyone you choose. Whether it's a vendor at a booth asking to scan your badge, another participant that you have just chatted with and want to continue it online, or a group of people that you want to go to lunch with next day — the idea is pretty much the same.

    The simplest, "analog" way of solving this is of course to have your e-mail address (or twitter handle, or whatever) written then on your badge, in letters small enough to not be visible from afar, so that the people wanting to copy it (or take a photo) have to come close and possibly ask you. But there is a lot of room for technology here.

    Bar and QR codes, NFC tags, IR beaming, BLE and other wireless communication methods can be helpful here. Being compatible with existing devices, such as phones, is a big plus here, of course, but we shouldn't require people to have a phone to use it. Ideally, there would be several methods available, with the analog fallback in case of a dead battery.


    Those are the thing that make the electronic badge more useful than the piece of paper that you normally get. They should be good enough to justify the extra expense and hassle.


    This is a Python-based badge for Python conferences, so it's fundamental that you should be able to (easily) program it with Python. That's the whole point of using MicroPython/CircuitPython here. But it's not enough to just be able to run your program on it — you should be able to show off the programs you have written!

    That means that the badge must be able to run the program while you are wearing it (and not just when connected to your computer), which implies a battery. It also means that the results of running that program should be visible and unique.

    RGB LEDs are nice for that, because they are flashy, colorful, and visible from far away, especially when blinking or cycling colors. Unfortunately, a lot of LEDs can run down your battery pretty fast, and also there is only so many ways you can make them blink — so the uniqueness aspect suffers...

    Read more »

  • The Shape

    ðeshipu04/10/2018 at 21:45 0 comments

    Now that I have the e-ink display drivers written, it's time to start thinking about another prototype, the Mark III. But what shape should it have? For the LCD/OLED I just went for the game handheld looks, because those displays are suitable for making simple games, that layout is also convenient for all sorts of menus and navigation, and the shape is generally associated with fun and pleasure. But with an e-ink display, that doesn't make so much sense anymore, so I started thinking about other possibilities.

    But before I start with that, let's review what we need to have in there:

    • display (38×32mm)
    • USB port
    • power switch (not sure about this anymore)
    • expansion header (either a female 2.54mm pin header, or grove sockets)
    • LIR2505 battery in a holder (25mm diameter)
    • optionally some crocodile clip contacts/touch panels
    • optionally some buttons
    • all the components

    Ideally we want all the components on one side, though that is not a hard requirement. We probably also won't fit it in 50×50mm, so 100×100mm is the new limit. With that in mind, what can we do?

    Well, it's a Python badge, so there is a good chance it's going to be used on a Python conference, so why not play with the motifs from the Python logo? For example, something like this:

    At the top we could have the pin header connector, so that expansions would come in forms of various hats for the snake — a crown with crocodile clip contacts, a paper hat with prototyping holes, and a number of different hats with various sensors or LEDs. The USB socket would go on the bottom, so that we can easily power the thing with a USB cable and still wear it on the neck. Edge-mounted buttons could go on both sides, the battery goes on the other side, as well as all the components. The power switch can go next to the USB, but if we want this to also work as a watch (the SAMD21 chip has a built-in RTC), then we probably don't even want a power switch, just some sleep modes.

    Then I thought a bit more about the RTC and the Pebble watch, and I though: why not make it in a shape that could be both worn as a badge and as a (large) wristwatch? That would be pretty cool, people could make wearable things with it. So I started thinking about how this would be laid out. Unfortunately, I don't see a way of packing it all on a small-enough PCB and still making it thin enough to fit on your wrist. So I guess that is out (but I might revisit it in another project).

    And then I went to the Hackaday Unconference, and saw a presentation that talked about how electronics are scary and ugly for most girls, and how the presenter worked on making them look good, and how that made a lot of difference in interest. And I thought, hey, Guido van Rossum wears that "Python is for girls" t-shirt on his every keynote, maybe I should work on this badge a little bit more and also make it look nice. It would be great if I could make it something that you would actually *want* to wear, even after the conference, as an accessory. So what can I do?

    The lazy option is to re-use my #Blinka designs and use the CircuitPython mascot on the badge:

    This is shiny, but it's still not something I would like to wear, especially with that display that seems to be tucked on. Also, while the cute snake might attract the less technical part of the population, it might at the same time scare the more technically-inclined one. It wouldn't be such a tragedy, but maybe we can do better. So now I'm thinking about original designs. I think I want to put there some kind of a cartoon monster, that would be both cute and cool at the same time, and I want to incorporate the display into the design more. This is one of the sketches I have:

    I'm really not sure what it is going to be in the end — I will give myself some time for this. In the worst case, I can just use a floral pattern around the display.

  • Mark II

    ðeshipu04/10/2018 at 09:43 0 comments

    After realizing that that LCD display is way too slow for games, I quickly designed a version with an OLED display, re-using the designs and the parts from the #Micro:Boy project — I didn't get the display to work there, but now that I knew about the reset requirements, I was confident it will work. Surprise! It doesn't. I now suspect that the whole batch of displays I got might be faulty, or simply using a different chip than advertised. In any case, here are some photos of the assembled device:

    Note how few components are required!

    I decided to not pursue that direction much, and instead focus on the e-ink display. Right now I'm exploring the different possible shapes the badge could have — more about it in a separate log.

  • The Look-up Table Holds the Secret

    ðeshipu04/05/2018 at 19:43 0 comments

    I spent half of the last night poring over the datasheets and wading through horrible C code examples, but finally I managed to find the code that was used to make this example:

    Inside I found a lot of scrambled code, unused files, copy-pasted fragments, but also the thing I was looking for: the LUT tables for the refresh sequence! After adding them to my driver code, the full refresh suddenly takes less than 2 seconds, and the "quick" refresh is practically instant (but of course leaves some mess from the previous image). That is so much better!

    I have published my driver code here:

  • Testing Cheap E-paper Displays

    ðeshipu04/04/2018 at 18:52 0 comments

    The e-paper displays that I mentioned earlier arrived today, and I was able to do some testing with one of them:

    The datasheet has a very handy flow diagram, which tells us exactly what SPI commands need to be sent. Using that, I wrote a simple driver:

    Read more »

View all 16 project logs

Enjoy this project?



RoGeorge wrote 04/15/2018 at 12:31 point

Can't take my eyes off of that pic, no idea why.

  Are you sure? yes | no

ðeshipu wrote 04/15/2018 at 13:18 point

Yeah, pretty shiny lights. I think it's going to look great on a badge, with people programming some cool animations, like flames or plasma.

  Are you sure? yes | no

davedarko wrote 03/25/2018 at 13:26 point

hmm, what happened to the usb port?

  Are you sure? yes | no

ðeshipu wrote 03/25/2018 at 14:56 point

Too much rosin. This is just a mockup with the parts I had lying around. The real PCB is already ordered, should come in a dew days, then I can assemble it properly.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates