Mitochondrion Mark 5.3 LED Staff

In short: the Mitochondrion looks as stunning as I hoped for about five years ago.

My journey into the obsession of making LED staffs

About five years ago, I stopped fire spinning and started building LED staffs. I wanted to have images hanging in space around me while I am spinning staff. Technology (and my skills) have finally got to that point where I’m pretty happy with the Mitochondrion, Mark 5.3.

The path has been:
Mark 1 – I learnt so much by designing the first one that there was no point building it. Straight on to…
Mark 2 – Ran without a microcontroller and had some fundamental flaws, like not turning on. I learnt enough to build the next one…
Mark 3 – The first of those pictured above. 44 LEDs controlled by a Picaxe. Twenty-eight bytes of memory, home-etched circuit boards, sketchy wooden parts, and bubble-wrap.
Mark 4 – First to use LED strips, 88 LPD8806 controlled by an Arduino Nano, twenty NiMH cells, and 3D printed parts. Eventually became bomb-proof enough that various I was happy to let randoms play with it at festivals.
Mark 5.2 – Teensy 3.1, 800 NeoPixels as four parallel strips of 200, and lithium cells. It looked good at Burning Man until the overloaded Voltage converters tried to catch fire.
Mark 5.3 – The brief details are: twelve 14500 Lithium rechargable cells powering 800 APA102/DotStar LEDs in four strips, controlled by a Teensy 3.2 microcontroller, with a motion sensor to turn it on and off, running the wonderful FastLED library and my own multitasking code to display a hundred images. You may have seen version this at Kiwiburn this year.

The not-so-brief details are explored below, with an emphasis on the inevitable trade-offs that you face when trying to push to the boundary of what’s possible.

What are the limits?

First limit is size, because here we’re trading off between ease of holding, stiffness, and internal diameter. The outside diameter of the tube can only be so big before it gets hard to hold. 32 mm is already fatter than I’d like for a staff. The only possible material for the tube is polycarbonate and that’s pretty flexible stuff. That diameter tubing comes in two choices of wall thickness and 1.6 mm is like a noodle. So 3.2 mm wall it is, giving a 25.4 mm inner diameter. That fact alone drives the rest of the design.

Second limit is energy storage. I want this to be kicking out the lumens all night long, or at least as long I last at a festival. (So that’s till about half-way through the night when everyone is kicking off and I say “I’m just going back to camp to get more water” and then I sneak off and crash out. But I digress.) I also want to fit four LED strips along with the necessary wiring and internal structure. Turns out 14500 cells (AAA size) fit, with about a quarter of millimetre spare. Twelve of them give me 33 Watt-hours, which is sufficient. Splitting them into two groups puts the heavy cells at the tube ends for good weight distribution when spinning. Keeping those two groups as one pack, i.e. all the cells in parallel, makes charging so much easier. Charging from USB is handled by Peskie Products tiny 800 mA board.

The cross-section looks like:

Third limit is power. I’m keen on ridiculous peak powers. And 800 LEDs could peak at 150 Watts. Sadly, that would pull 4 Amps per cell, a rate of 6C. There are high discharge rate 14500 cells, but I’ve yet to find any that are also protected and 50 mm long. The Trustfire Flame cells I’m using have a detectable Voltage sag at anything above 0.1 Amps, so I chose to cap the power at 10 Watts. More is certainly possible, but the green and blue LEDs fade out leading to a noticeable colour change. And 10 Watts is still the brightest LED flow tool that I’ve seen in NZ. (At some point, I’ll try higher discharge cells…)

Fourth limit is features. Here the trade-off is between time writing code (and getting it to work) and just building the bloody thing. I’m at the point where it does images. It doesn’t visualise music, yet, but that’s the plan for Mark 5.4.

Fifth is durability. Making a long, thin electrical device and then repeatedly throwing it on the ground is just hard. So everything is solidly mounted, there’s 3D printed ninja-flex bumpers at the ends, all structural parts are aluminium, thick 3D printed nylon, or FR4. All wires are as short as they can be, with locking connectors. All solder connections between parts that could move are sewn. All cell holders are screwed in place as well as soldered.

Key design features for the Mark 5.3

Power architecture – the great thing about APA102 LED strips is that they will happily run off 3.7 Volts, meaning no need to step Voltages up to 5 Volts as with NeoPixels. (They also just work, unlike NeoPixel’s tricky timing requirements.) This simplifies the power architecture greatly and avoids using UBECs. The downside is that they pull 1 milliAmp per LED even when the LEDs are set to off. I don’t have room for a physical power switch, so to keep the stand-by life at more than a day, there’s MOSFETs between cells and strips which cut or enable power to the strips. This also allows for control of the strips on start up – the Mark 5.2 didn’t have this. On power-up, the NeoPixels could light before the microcontroller had booted up, getting stuck in a high-current draw mode, preventing the Teensy from starting and damaging other components from overheating. The Mark 5.3 holds power off to the strips until explicitly commanded by the microcontroller.

Here’s a block diagram, clickable for enlargement:

Overall Arrangement and Physical Alignment – Accuracy is hard. Or rather, accuracy is expensive and time consuming. Squeezing everything in gets to be a pain in the arse, when you have quarter-millimetre tolerances. Making everything stiff enough and strong enough is bonus arse pain. So rather than try to make structural components myself, I used the PCBs as structure, alignment, and circuitry. Board shops will happily drill holes for no cost with micron accuracy. Then everything just screws together and fits together. The four sides are in two pairs with L-brackets holding each pair. There’s hinges between each pair so you can remove the internals and open the whole thing up for access.

Physical power switches – I said this doesn’t have room for one. It doesn’t, at the ends. One end holds the charging port, the other the microphone. I probably could squeeze one in, but there’s lots of current so the switch isn’t going to be small and the ends are the parts that get most knocked-about, so it’s not going to be durable. Still, power switches are necessary for debugging and resets, so there’s two tiny, board-mounted six Amp switches, one for each battery pack.

Multi-tasking code and timing

The code is all built on Alan Bleaklow’s Very Simple Arduino Task Manager. Every feature is an object that gets called every X milliseconds. The pattern generator and display refresh run every 2 milliseconds; the motion sensor every 250 milliseconds when spinning and every 500 milliseconds when stationary. Communication between objects is by message passing, with a SwitchModes object running a finite state machine to hand smooth transitions between spinning, ambient, and timed-out modes. Transitions between images happen every few seconds, or on reversal of the spin direction. The transitions are sharp, but could be gradual.

This code is probably a bit over the top for just displaying images, but is a solid platform for more complex behaviour.

The interface is entirely motion-based. Spinning wakes it, not spinning drops it into mellow ambient modes, rolling it turns it black.

With a Teensy at 72 MHz and data to strips at 10 MHz, updating 200 LEDs takes 1.5 ms. The display aims to update every 2 milliseconds, leaving 0.5 milliseconds to get new the next column of image data or generate the next frame of a pattern, or do other stuff. This is plenty.


I wanted a strong visual identity to take to Burning Man – something very New Zealand. I also wanted bright colours and not too much complexity, coz the Teensy is pretty tight on memory. Luckily, NZ was having a competition to replace our flag, which provided a source of bold designs that look great in a palette of only 16 colours. (Unluckily, the proposed replacement flag is crap so we might be sticking with the original.)

Some are 256 colours, most are 16 colour for two pixels per byte. Images are 32, 48, or 72 pixels high.

So I rounded up a heap from the flag competition, along with lots of traditional tuktuku and kowhaiwhai patterns, and some mandala drawn by Spiralishis, and some mathematical designs sourced from Wikipedia. Some of these were tweaked in Gimp with conversion to polar co-ordinates, shifted, and faded brightness in the rectangular originals to give round and even brightness in when displayed by the rotating Mitochondrion.

Like this, original on left, what it looks like on right:

The images are processed from GIFs by a hacked version of Philip Burgess’ LED poi converter. It takes a directory full of images and writes out a header file full of image data and palettes, which then gets picked up by the compile.

And of course, we had to include Laser Kiwi. It’s the People’s Choice!

I’ll admit to being quite pleased with this version.

Photo credits

All spinning pics by Gordon Lehany of Platnam Images, who mostly does landscape and event photography, and platinum printing, but is game.

Mitochondrion 5.3 progress

Hmm… twenty one boards into a twenty five mm tube, with quarter mm clearances? I think I might mock that up with paper and cardboard, just to check nothing clashes.

So old school.

And then I’ll get all the circuit boards made and bits 3D printed and it’ll all just fit together, right? RIGHT?

[EDIT, eight hours later – Yeah, I’m really glad I did this before ordering the boards… ]

No Mitochondrion Mark 5 for Kiwiburn… but something else instead

Right then, after a fair amount of swearing, I made the decision that the Mitochondrion Mark 5.0 has some fatal design flaws and won’t be ready for Kiwiburn. Turns out the 144 LED per metre Neopixel strips are a bastard to join and connect to. There’s a variety of ways to do it, none of which will work with my very tight design. Seriously, don’t try to squeeze as much into a one inch tube as I did.

This does mean I’ve learnt enough that the Mark 5.1 should be much easier to construct. This does mean designing and ordering new circuit boards, stepping the power down to 60 Watts not 120 (coz it was going to melt), using more reasonably sized batteries (14500 not 16340), and trying the new APA102 strips with POV and smooth colour fades.

So instead of the Mark 5, we’re bringing something else. It’s a Wendy & Jez co-production and you are all invited. You’ll know it when you see it, but yesterday it looked like:

Mitochondrion Mark 5.0: First light

Yeah, this is going to be bright.

That’s the test power board, the test centre board, and the test strip. The power board holds four 16340 Li-Ion cells and a 5 Volt, 4 Amp converter (and some other gubbins). There’ll be four of them, one for each strip. The centre board holds the Teensy, motion sensor, FRAM, and level shifter (and a bunch of other gubbins). The test strip is 144 Neopixel LEDs. There’ll be 800 of them.

Testing reveals a bunch of issues to fix, but at least I’m at the stage of making light.

Mitochondrion Mark 5.0.1 progress: almost enough LEDs

The answer to the question “how many LEDs?” is always “moar!”. However, I think this counts as “almost enough”:

And you’ll note from the change in version number that the Mark 5.0 power design didn’t work out. The Mark 5.0.1 power design is underway. In short, while I could fit 18.2 mm diameter cells into a 19.6 mm space which also holds circuit boards and wiring, “could” is not the same as “should”. Hence the delicate trade-off of diameter, length, weight, energy, power, charging, balancing, and not catching fire means that 16340 cells are looking better than 18650s. This will result in downgrading the peak power output from “portable apocalypse” to “merely seizure inducing”, but you can’t have everything.*

* – Well, to be precise, you can have everything, but a large fraction of everything is planned for release in future versions.

Mitochondrion Mark 5.0 progress: the bit that I’m supposed to be good at…

Measure twice, cut once, swear loudly, and measure again like five times…

So one of the goals for the Mark 5.0 is for all the bits just to fit together accurately and quickly. The structure for the Mark 4 was passable but there was plenty of bodging. Instead, the Mark 5 would have a far-more thought out design. So then:

Nice and simple. Aluminium strips, held together by 3D printed nylon bits. The aluminium was rectangular and flat, the 3D printing bits had all the accuracy designed in with lots of location holes. Just tap and screw it all together.


Well, the reality ended up being:

Of those bits, I think one part is correct and usable. The rest is junk. I could call that a waste of several days, or I could think about how much I’ve learnt from trialing this design. Like:

  1. Never try to locate holes by hand if they need to be accurate to within less than a millimetre. Or two. Three on a bad day. Draw up a drilling jig and get it printed in stainless, coz that will cost less than the value of the parts you’ll waste by drilling holes in the wrong place.
  2. Check all the drawings. And then sleep on it and check them again. Coz somehow, a quarter of the pairs of holes that should have been 17 mm apart ended up 14 mm apart.
  3. Tolerances are hard.
  4. Try to avoid designing holes that need three tools to create, especially in aluminium less than a millimetre thick. Also, countersinks really really really need depth stops.
  5. Don’t tap anything when you can just design in a recess to hold a nut.
  6. There may be such a thing as a 40 mm long M2 grub screw, somewhere, but you’re a fool to make a design that needs one.

At least when debugging structure, you can tell if you ballsed it up, coz you screw it all together and it just doesn’t fit. So yeah, it’s time to design the Mark 5.0.1.

Mitochondrion Mark 5.0 progress

The power output for the next version of the Mitochondrion glow staff is approaching the level you’d use for an electric bike, hence I’m taking battery management seriously. The current plan is to use a dedicated battery level gauge chip. The Linear LTC2943 looks like it will do the job, except it is 3 mm square, with no legs to solder to, just tiny pads under the chip. It’s designed to be soldering in factories with proper kit, not by a muppet like me with a soldering iron.

So WTH, watch a tutorial, mount my phone as a microscope, flip the chip on its back and deadbug it to a breakout board. How hard could that be?

Really quite hard, it turns out. Got there in the end though.

I know, it doesn’t look great, but it checks out. Everything that should be connected is and everything that shouldn’t be isn’t. I’ll test that the chip is actually working once a few other bits arrive.

Best Kiwiburn Ever!

Picture by Peter Jennings

Very brief summary:

  • Returning to Kiwiburn, with my closest people, who’ve also been away.
  • Helping to build and light the Effigy. The Effigy crew. The resulting meat blanket.
  • New site, oh yes.
  • Finally getting the Hat Band working and out in public. Ooo… it’s shiny. It lasted three days before an expected hardware failure.
  • Being really glad I’d put a dim mode on the Hat. Otherwise no-one could look at me, coz 180 LEDs. I’m not that anti-social. Well, not always.
  • All the smiles.
  • Poking nature with a stick.
  • Cuddle piles with all the fluff.
  • Being happy enough with the durability of the Mitochondrion that I can just give it to anyone, no matter how munted.
  • Realising that I’m very happy with my life.
  • No FOMO, but a bad case of FOMP – Fear Of Missing People. I didn’t see enough of far too many people, in some cases I didn’t see them at all, but as Wendy says we were “focused on deepening connections with people I already know rather than forming a whole bunch of new ones”

There’ll be a proper write-up of the Hat Band hardware, when I’m less shattered. And some pics and video.

The Mitochondrion at Circulation

Circulation is one of New Zealand’s finest little circus festivals. I got back from there last night, still covered in bruises and glitter, but I finally managed to get some video of the Mitochondrion in its native setting, helped by Nicholas Leland, Tama Bw of The Fire Bugs, Reece Dunn of Dragon Flow, Josh Smythe & myself for the spinning, JD for the dome and filming, and Ryan Walker at Spiral Technica for the live motion-tracking projection mapping. No idea where the mirrors came from, but cheers.

Tune is Will Marshall vs Youthful Implants – Use of Weapons, available at Soundcloud under a Creative Commons licence.

And thanks especially to everyone who helped put Circulation together.

Mitochondrion Mark 5 progress

Mitochondrion Mark 4 code is now running on the Mark 5 chip. Teensy 3.0 – an ARM Cortex M4 on an 18 mm wide board. Consider me pleased. Have yet to time the code, but should be faster. Much faster. Which is required, as it might be possible to replace the Mark 4’s 88 LEDs with 800.

Still a long way to go for the Mark 5, but changing the chip from Arduino to Teensy is probably the biggest step.

Also, Eclipse is still a royal pain in the arse, but does actually work for compiling, building, and programming. No debugger and it doesn’t play nicely with the serial port, but it does the job.

(Oh, and the Teensy has an on-chip temperature sensor. This may be needed, as preliminary thermal modeling suggests that full-whack may make the whole thing melt. Coz, you know, EIGHT HUNDRED LEDS.)

The Mitochondrion Mark 5 begins…

That tiny thing is a Teensy 3.0. ARM Cortex M4.

It’s a serious step up in performance from the Arduino Nano that runs the Mark 4. Four times the program memory, eight times the variable memory, four times the clock speed and 32 bit not 8, so quite substantially more grunty.

Which is somewhat handy, as it’ll will have to look after somewhere between three and eight times as many LEDs.

Try, learn, try again – Mitochondrion Mark 4.2.4 progress

The Mitochondrion M4.2.3 code was a bit of a mess. It wasn’t bad, but it wasn’t great either that it was put together in a bit of a hurry for last summer’s festivals. And then I tweaked it further over the summer while running out of program memory (Arduino Nano/ATmega328 so only 32 kb). And then I left it alone for a month or so, to get sufficient distance from that code base before thinking about what it could be. The vast majority of the code sat in one big library file, the control logic say in one big function, and inter-object dependencies were bloody everywhere, to the point where I didn’t want to mess with any part of it.

Clearly the solution was to mess with all of it. So it was major refactor time, starting with a clean sheet of paper, then scribbling all over it to come up with a design that was pretty close to the existing approach but without all the knobbles. And then coding and testing and more coding.

*wavy lines*

The Mark 4.2.4 now has co-operative multitasking with flexible time-based scheduling; one task object per sensor, output, or pattern generator; a message queue for asynch inter-object comms; and a nice and tidy state/event table for controlling switching between different modes and smoothly handling those transitions. Objects have much more responsibility to handle their own transitions and modes, leading to fewer cross-object tangles and asynchronous behaviour where a mode change sends a message to every object, those objects can finish doing what they are doing before changing modes and reporting those changes back. Of course, it’s never that simple

Can you spot the problem?

One of the LED strips in the Mitochondrion is has a problem. Only the first third of the LEDs light up, the rest are dim. Now, finding hardware problems can take bloody forever. Poking, swearing, scratching of head. In this case, however:

Yeah, that’s a crack through the middle of the driver chip. It’s pretty easy to work out why this strip isn’t working.

Short term fix is new LED strip. Longer term, well, the driver chips are slightly wider than the aluminium strip underneath. When I drop the whole thing, the chip bangs up against the curve of the polycarbonate tube, pushing the ends down and the middle up. Thus the crack across the middle. So, some padding required for the Mark 4 to help cushion these chips. For the Mark 5, the drivers are inside the LEDs, so that should be more robust, but again, padding will be required.

Mitochondrion glow staff progress – where I’m at, where I want to go

Back from Rainbow Serpent now and mostly recovered from having too much fun. So much fun that I haven’t any pics or vids. The Mitochondrion mark 4.2.3 got a great reception, someone described it as brain-melting, which is one of the feelings that I’m trying to create, and I got to meet lots of other good people and see lots of other LED gear.

I’ve mostly been developing this glow staff for my own pleasure* but with an eventual goal of making these available to other people. “Eventual” can be a long time in the future, but Reese from Soul-fire had a spin (and looked downright wonderfull with it) and then bounced up to me and said “you should be making these so other people can have this experience”. That’s the best reason for hurrying this process along.

This year's plan

Mark 4.2.3 – More grunt needed. As always.

While everyone’s off to Kiwiburn, we’re off to Rainbow Serpent in Oz. It just worked out that way. Anyway, for the Mark 4.2.3 I’ve fixed lots of bugs, mended a couple of screws, implemented a couple of more structured modes, 24 modes in total, and doubled the speed – 10 ms per refresh.

I’ve also nearly run out of program memory (28 kB out of 30 kB) and RAM, so fitting in the code for the audio, BlueTooth, and motion-responsive patterns is going to be tricky.

More grunt needed. As always.

I must go now, to rejoin my people: