Going Pro

Swagbadge

The Badge of Infinite Possibilities

DIYODE Magazine

Issue 41, December 2020

Find out how some clever makers designed open source, network enabled badges for their virtual conference.

ABOVE: The very beautiful Swagbadge PCBs with lanyard hanging points, ready to be assembled, complete with capacitive touch sliders, and locations for the screens that will have switches behind them. Layout and design by Andrew Nielsen.

One of many things we admire about the maker community is their ability to adapt and overcome barriers. One perfect example of this is from the Open Hardware Mini-Conference (OHMC) team who has designed electronic badges for the upcoming online Linux Conference 2021 event.

Meet the Team:

Open Hardware Mini-Conference

Website: http://www.openhardwareconf.org

Twitter: @swagbadge2021

Instead of the traditional paper conference badge, these slick pre-assembled badges, called Swagbadges, will be made available to conference attendees. The badges are intended to let attendees send messages to each other over their badges so that the badges can provide a digital sense of community during (and after) the conference.

For those who can’t attend the conference, the OHMC team has designed the DIY Dagbadge that you can build yourself. We will describe this badge in detail if you want to build one for yourself.

To learn more about the Swagbadge, Dagbadge, and the Linux Conference, we caught up with Nicola Nye from the Open Hardware team. The following is what Nicola had to say.

Thank you for taking the time to talk with us Nicola. Please tell our readers a little about yourself.

I am the newest member of the Open Hardware team, and the newest to electronics. What I lack in experience, I make up for with generous amounts of enthusiasm and an acute desire to share my freshly gained knowledge with others. I am passionate about privacy, libraries, and Hope Punk: joy as an act of resistance.

Where abouts is your Open Hardware team located?

The Open Hardware MiniConference (OHMC) team draws upon expertise from around Australia. The core team often meets at the Melbourne based Connected Community HackerSpace (CCHS). Jon Oxer and Andy Gelme have coordinated the OHMC team for the past 12 years. The core team for the badge this year is Jon, Andy, John Spencer, Andrew Nielsen, and Nicola Nye.

It’s so great that these hackerspaces exist. Before we get you to tell us about the badges, can you tell us about the Linux Conference?

Linux Australia represents approximately 5000 Australian users and developers of Free Software and Open Technologies, and facilitates internationally-renowned events including linux.conf.au – Australasia’s grassroots Free and Open Source Software Conference.

Linux.conf.au (https://linux.conf.au/) is a deeply technical, not for profit conference covering topics varying from the inner workings of the Linux kernel to the inner workings of dealing with communities. Each year the conference attracts between 500-800 attendees making it one of the most popular grassroots open source conferences in our region.

In 2021, the conference will be entering its 22nd year. It will be held online for the first time, so anyone in the world can attend, from January 23-25.

This year’s theme is ‘So what’s next?’. As large numbers of the world’s workforce continue to work from home, how can our community help people and organisations navigate this change? How can open source principles support our new world? What new developments in software and hardware can we look forward to in 2021 and beyond?

We’re very fortunate that our Open Hardware MiniConference proposal has been accepted for LCA2021. This provides an opportunity to describe the Swagbadge in detail, encourage hacking of the badge. It will also include a whole day of presentations focused on building skills, exploring open hardware projects, and community engagement.

Thank goodness for fast Internet speeds to be able to conduct an online conference. We are really fascinated by the Swagbadge that your attendees will be provided. Tell us all about it.

For some, the Swagbadge is a gadget they will extend for controlling their smart lights, and for others, it’s a way to experiment with animating googly eyes. For programmers, it lets them try out IoT, and for hardware makers, they can build out a multitude of addons. It also has a built-it-yourself counterpart, the Dagbadge.

The Swagbadge is an electronic conference badge that comes as a pre-assembled PCB with two OLED screens - which double as switches, two capacitive touch sliders, powered by a Lolin32 (ESP32 with LiPo battery support) to provide wifi connectivity, and four headers for your own add-ons. It’s also beautiful.

Built for Linux Conference Australia (LCA), 300 of them will be available for attendees of the virtual conference focusing on open software on Jan 23-25, 2021.

The “Dagbadge” is the DIY version, for people who are unable to receive a Swagbadge (they’re not in Australia or they’re not attending the conference or demand exceeds supply).

The team behind the Swagbadge have run the Open Hardware MiniConf for LCA for over a decade and we were approached to build the badges by Sae Ra Germaine, President of Linux Australia, and conference chair for LCA 2021. When asked why they wanted the badges for this year, she had this to say:

“Like many people I keep a collection of badges from the conferences I’ve attended. As we started to plot out how an all digital conference would work we started to think why not make the badge digital too?”

Since the community can’t come together in person (for the first time in 22 years!), it felt right to create something special: I figured by having the open hardware team build electronic badges for attendees we could tap into the creativity of our community and keep the excitement going in a different way.

It looks like you have thought of everything! How does SAO work?

Whether you’re on the Swagbadge or the Dagbadge, you can use a Simple Add On (SAO) to add more capabilities to your badge. Our team have looked at atmosphere sensors, a lolly catapult, a cute Tux (the mascot of Linux), a shiny LED unicorn, animating a face with googly eyes and wiggly hair, a rocket, an IMAP/JMAP mail notifier and even a game controller.

The SAO is a very rough standard first designed on a napkin back in February 2018 for the Defcon conference, to let users design little addons for their electronic badges. Having a standard allows people to design add-ons that work on different badges for those who attend multiple conferences, and even sell or exchange them. You can find some of these on Tindie, or by searching for "#badgelife"; the tag used by many badge designers.

As far as standards go, it’s pretty basic. The first version of the SAO header had just four pins: 3.3V, ground, and SCL and SDA for I2C. More recently, the SAO header standard, jokingly named “V1.69bis”, has been updated to include those same four pins with the addition of two general purpose I/O pins. The new SAO header provides 6 pins in total, and this is the version we’ve used on Swagbadge.

The components of a basic Dagbadge: Breadboard, Lolin32, 2x OLED screens, 2x switches, wires.

Unfortunately we can’t get a badge to every attendee in time for the conference, but we want to make the badges as available to as many people as possible to build one (even me!). So for those we can’t get one to, we’re working on a list of components so people can head out to their local electronics shop and craft their own. This is the Dagbadge.

It’s been pretty cool having something that people at different skill levels in our community can tinker with and learn about together. Community is what makes our conference special and what makes us keep coming back each year. And despite all the chaos of 2020, through projects like this our community is stronger than ever.”

Led by Jon Oxer and Andy Gelme, we designed the Swagbadge to be:

  • small and light enough to fit (safely!) into a standard small sized padded bag for posting
  • cheap enough to fit within the budget (under $20 per badge, including postage)
  • simple enough to assemble 300 of them in the timeframe
  • attractive to newcomers and experienced hardware folk alike
  • network enabled, to allow attendees to get connected through their badges even if we couldn’t be face to face in person
  • run on an open source software framework so people could improve them
  • extensible through use of the Simple Addon (SAO) standard
  • visually appealing

While the Swagbadge is beautiful, it comes pre-assembled. So for this article, we’ll dive into the Dagbadge version, and explore the hardware and software extensions available for this nifty gizmo.

You have discussed a lot about the hardware. Can you elaborate on how the software side of these badges work?

Hardware doesn’t often do a lot without software and we wanted it to be open and extensible so that people could take the hardware and use it in any way their imagination chose.

The badge runs on MicroPython, designed by Melbourne-based, Damien George. Aiko, an open source framework goes on top which comes with support for all the badge components, as well as an MQTT interface so you can invoke your badge, or communicate between badges, via the open message queue standard without having to program: you just need an MQTT client.

We anticipate having some applications on the badges that will let people send messages to each other over their badges, and display a count of how many badges are currently online, so that the badges can provide a digital sense of community during (and after) the conference.

We know that many of these badges will be going to predominantly software developers who haven’t had much (or any) hardware experience, so the development and documentation of the badge is just the first step. We’re also building a community so that people can get the support and expertise they need to help them learn, and extend.

It sounds like an amazing community. Could any of our interested readers join?

If the possibilities intrigue your readers and they would like to join in our community, whether they are a seasoned maker pro, or someone just starting out in electronics, they are welcome! And perhaps they’ll be able to share this opportunity with others who haven’t yet found the right excuse to dive into the world of making.

For our readers who want to know more about the badges, attend the Linux Conf or make a Dagbadge for themselves, where can they go for more information?

For more information on the Swagbadge and Dagbadge, including the specific components and more detailed assembly instructions, and information on how to connect with the community, see http://www.openhardwareconf.org/wiki/Swagbadge2021

To find out more about LinuxConf, visit:

https://linux.conf.au/

@Linuxconferenceaustralia

@linuxconfau

To find out more about the Connected Community HackerSpace, visit:

http://hackmelbourne.org

@hackmelbourne

We will also provide you with some construction details that you can publish for your readers who want to make the Dagbadge.

Excellent! Thank you for your time Nicola and we wish you and your team a successful event. It would be great to hear from you about how it all goes.

The Build:

Dagbadge - Your DIY Swagbadge

Parts Required:Jaycar
1 x Lolin32 or ESP32 Development Board-
2 x 0.96" OLED Screens-
2 x Tactile SwitchesSP0600

* A breadboard and prototyping hardware are also required.

How to assemble the badge

Solder headers onto the Lolin32. Make sure the short part of the pin goes into the bottom of the Lolin, and the long part of the pin goes down so it can be inserted into the breadboard.

Note: Use a bigger breadboard than we did here, which will give you more space to fit everything on, and room for any extensions you may want to add.

Insert the Lolin32 into the breadboard, then insert the switches into the breadboard.

The OLED displays use I2C for their connection to the Lolin32, so to use two displays together they need to have different I2C addresses. The displays have an address of 0x3C by default, so if you bought two displays you can’t use them both at the same time. We use the default address for the display on the left, and then the display on the right needs to have a solder bridge applied to change its address to 0x3D. On the back of the display PCB is a tiny surface-mount resistor and a text label with a cute mis-spelling that says “IIC ADRESS SELECT”. You need to add a solder blob to join the end of the resistor to the solder pad just to its right.

The back of an OLED showing where to apply a solder bridge to change its address.

Put the OLEDs onto the breadboard.

Wire up the circuit as per the circuit diagram shown.

When buying an ESP32 or any microprocessor, it’s worth erasing and putting on your software of choice so you have a known and stable base to work from. For the Dagbadge, we use esptool to do these operations, available on Linux, MacOS and Windows in a Python environment. Use Python's pip tool to install esptool. And we get the version of MicroPython for esp32 from http://micropython.org/download/ (we are using the latest ESP stable release v1.13).

pip install esptool 
esptool --chip esp32 --port <port> erase_flash
esptool --chip esp32 --port <port> --baud 
460800 write_flash -z 0x1000 esp32-idf4-20200902-v1.13.bin

So now we have a badge that can turn on, but how do we control it? We write a special kind of Python designed specifically for embedded devices, called MicroPython. To get files onto the devices, we use mpfshell which works like a kind of ftp client. Use Python's pip tool to install mpfshell. It also has a shell style interface on the badge, called “repl”. This starts up mpfshell and takes you to the command prompt where you can enter some MicroPython:

pip install mpfshell 
wget https://raw.githubusercontent.com/
micropython/micropython/master/drivers/display/ssd1306.py
mpfshell -o <port>
md lib
put ssd1306.py lib/ssd1306.py
repl

Sample program to display a message whilst turning the LED on and off:

import machine, ssd1306, time
scl_pin = 4
sda_pin = 5
led = machine.Pin(22, machine.Pin.OUT, 
machine.Pin.PULL_UP)
i2c = machine.I2C(scl=machine.Pin(scl_pin), 
sda=machine.Pin(sda_pin))
oled = ssd1306.SSD1306_I2C(128, 64, i2c, 
addr=0x3c)
while True:
  led_state = "on" if led.value() else "off"
  message = "LED is " + led_state
  print(message)
  oled.fill(0)
  oled.text(message, 0, 0)
  oled.show()
  led.value(not(led.value()))
  time.sleep(0.5)

Use Ctrl-C to cancel it when you’re done.

For further details on assembling and programming your own Dagbadge, please visit: http://www.openhardwareconf.org/wiki/Swagbadge2021