Supercon Badge Reads A “Punch” Card

Hackaday supercon badge PCB showing illuminated activity lights after being loaded with a punch card

This year’s Hackaday Supercon, the first since 2019 thanks to the pandemic, was a very similar affair to those of the past. Almost every hardware-orientated hacker event has its own custom electronic badge, and Supercon was no different. This year’s badge is a simulation platform for a hypothetical 4-bit CPU created by our own [Voja Antonic], and presented a real challenge for some of the attendees who had never touched machine code during their formative years. The challenge set was to come up with the most interesting hack for the badge, so collaborators [Ben Hencke] and [Zach Fredin] set about nailing the ‘expandr’ category of the competition with their optical punched card reader bolt-on.

Peripheral connectivity is somewhat limited. The idea was to build a bolt-on board with its own local processing — using a PixelBlaze board [Ben] brought along — to handle all the scanning details. Then, once the program on the card was read, dump the whole thing over to the badge CPU via its serial interface. Without access to theirPrinted paper faux punch card showing read LEDs and an array of set and reset bits of the encoding usual facilities back home, [Ben] and [Zach] obviously had to improvise with whatever they had with them, and whatever could be scrounged off other badges or other hardware lying around.

One big issue was that most people don’t usually carry photodiodes with them, but luckily they remembered that an LED can be used as a photodiode when reverse-biased appropriately. Feeding the signal developed over a one Meg resistance, into a transconductance amplifier courtesy of a donated LM358 there was enough variation for the STM32 ADC to reliably detect the difference between unfilled and filled check-boxes on the filled-in program cards.

The CPU required 12-bit opcodes, which obviously implies 12 photodiodes and 12 LEDs to read each word. The PixelBlaze board does not have this many analog inputs. A simple trick was instead of having discrete inputs, all 12 photodiodes were wired in parallel and fed into a single input amplifier. To differentiate the different bits, the illumination LEDs instead were charlieplexed, thus delivering the individual bits as a sequence of values into the ADC, for subsequent de-serialising. The demonstration video shows that it works, with a program loaded from a card and kicked into operation manually. Such fun!

Punch cards usually have a hole through them and can be read mechanically, and are a great way to configure testers like this interesting vacuum valve tester we covered a short while back.

10 thoughts on “Supercon Badge Reads A “Punch” Card

  1. The LED as photodiode trick is a fun one — and as a tip for anyone trying to do this in the future, you can actually get away without any of the analog circuitry. I’d have to go digging to find the details, as it was about 10 years ago that I did this, but if your microcontroller has hardware timer peripherals and semi-consistent input thresholds / schmitt trigger inputs it’s the best, but you could probably get away with polling in a tight loop too. The basic idea is that you set your microcontroller pin as an output to reverse bias the LED, also charging the capacitance of the LED & board parasitics. Then, you reconfigure the pin as a digital input and measure the amount of time it takes to discharge & cross the logic threshold — that time is proportional to the amount of light falling on the LED.

    For bonus points, you can connect the LED between two GPIO pins, and then under software control it can be either forward biased or reverse biased, so it can be either an output or input — bidirectional optical communications over a single LED. Not very fast, or very robust against changing background illumination levels (usually IR communications are modulated on some high-frequency carrier), but a nice trick to have up your sleeve regardless.

    1. But of course, the conference is about hacking, and a large portion of Hackaday Supercon is dedicated to hacking on things. The entire alley is filled with tents, tables, and soldering irons and it’s packed with attendees. What better way to meet interesting people and discuss things of mutual interest? There are plenty of great talks and workshops as well, as you’d expect, and we didn’t limit ourselves to just badge hacking.

    2. The reality is that the talks are all recorded and will be released eventually, while you’ve only got one shot to meet people and collaboratively work on projects.

      Plenty of people chose to spend their limited time during Supercon working in the alley on whatever passion project they brought with them (or inherited once they arrived), and it’s hard to argue they got the short end of the stick compared to anyone else.

    3. Maybe this answers your question:

      I gave a talk this year and had to spend a lot of conference time finishing the preparation, and I can tell you I would have enjoyed it much more if I would have been able to do some badge hacking.

      4 years ago I was there and worked on a hack to change the badge into an Apple-1 emulator. I didn’t quite get it done on time but it was featured in an article by Roger Chang on hackaday.com the day after the conference. That was still a better memory than sitting around and editing a PowerPoint.

      What I missed most though, was the workshops. There seemed to be a lot fewer of them this year than before, and they were all sold out before I saw the announcement. Maybe that was because each one of them only cost $15 but anyway. That was the biggest bummer because if you missed those, you also don’t get the goodies that come with them, and there’s not going to be a YouTube video to make up for that.

      === Jac

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.