Monday, December 12, 2016

Seasonal Blinkenlights

Recently, my wife complained about being bored by all the monochrome Christmas displays in the neighborhood. "Can't we have something gaudy?" she asked.

Being cheap and lazy, I remembered that I had an addressable 1m LED strip that I bought several years ago and never really tried for anything interesting. After a night's hacking, I came up with a few different animations:

High art, it is not, but I picked up some new ideas, especially about how to sort colors.

I also learned that these strips have highly variable builds. Not only were the colors of the wires completely different from their documentation (but easy to figure out from the physical layout), but even the colors of the LEDs were hooked up in a different order than the WS2801 data sheet would have implied.

The code is fairly trivial, but given the reaction of my wife and sons, I think I got a pretty good return on those 450 lines of code.

Saturday, June 25, 2016

Light & Ladder — Simple Testbed for Microcontrollers

Recently I was bringing up an Arduino-like core for the ATtiny841, and wanted to test all the functionality. Testing digitalOut and analogOut was simple, though doing so for lots of pins required a bit of setup. digitalIn was also simple, but analogIn required slightly more work. As a small exercise, I decided to combine all of the required parts onto a single board. Using integrated resistor networks helped save a lot of parts.

The top part is very conventional, but the bottom might be a bit more interesting. Effectively, it serves as a primitive analog computer to generate a wide selection of fractions of the voltage applied to "+" and "-". As noted on the board, connecting one or more pins from the "+" side to one or more pins from the "-" side generates a voltage V*P/(P+M) where "P" is the sum of the labels of pins connected on the "+" side and "M" the sum on the "-" side. If "+" is 5V, you can obtain e.g.:
  • 1V as 1/5 of 5V, by connecting "1" on the "+" side and "4" on the "-" side.
  • 1.25V as 1/4, by connecting "1" on the "+" side, and 3 (as "1" and "2") on the "-" side.
  • 1.5V as 3/10, by connecting "1" and "2" on the "+" side, and "1", "2", and "4" on the "-" side.
Source code available on Github, boards on OSH Park.

Saturday, May 7, 2016

Announcing Octarine

Announcing Octarine — Electronic Component / Data Sheet Manager

Having acquired a sizable collection of parts by now, I often find myself wasting time browsing for data sheets over and over again, instead of having them ready when I need them. I decided to remedy the situation by writing an app, Octarine, to manage my components. Building on the REST API offered by, I tried to minimize the amount of information stored locally, and fetch everything else on the fly.

Octarine 1.5 is now available on github, running on OS X 10.10 (Yosemite) or later.

As usual with my hobby projects, this was an opportunity to try a few technologies I don't use much in my day job:

  • Swift.
  • NSURLRequest
  • PDFKit
  • NSSharingService
Component search in the Octopart database (right). Saved components (left)
Data sheet viewer