Thursday, January 6, 2022

Birthday Jumbotron

 Okay, I'm like 5 years late to the Neopixel bandwagon, but did you know that you can buy a Jumbotron by the foot?

My calendar dinged that Jeremy's birthday is coming up in a week. What to get him? I recall sitting in his 22nd floor apartment last hack day, looking at the Seattle Star, a big programmable LED display on the Macy's building. For $15 you can choose the pattern it displays for 15 seconds.

Well, for $15 I can buy a 5 meter spool of 90 programmable LEDs. For $45, I can buy three and rearrange them into an 8 foot by 1 foot Jumbotron. That thing should last at least 45 seconds. I'm actually saving money.

I had a denser spool of 300 LEDs sitting around on my bench, so the first step was to see how tricky this was. I unrolled the spool onto a scrap plank of pine and folded it back and forth into six rows of 50 LEDs. I taped it down with magic tape.

I grabbed an esp8266 off the leftover pile from the temperature sensor project. It's a bit of overkill for this task -- 240MHz with built-in WiFi -- but I'm out of 555s. I pulled up Arduino on my desktop, #included the Adafruit Neopixel library, and coded up a little animation.

It didn't light up right away. Hmm. I know I'd had these working before. Oh, yeah, I recall some LED strips that take 12V. Let's just dial up the voltage on the power supply. 6V. Nothing. 8V. Nothing. 12V: a brilliant red flash, a popping sound, and an acrid smell. Oops.

I look closer at the LED strip.


Yep, I've visibly burnt out the first several LEDs.

I look a little closer. The symbol "+5V" is printed every centimeter. But, you know, it was easier just to spin the knob on the power supply to find that out, right?

I look even closer, and notice the directional arrows. I was trying to pour the data into the output end of the spool. Duh.

I chopped off the dead LEDs and attached my controller and power supply to the other end, and it sprung to life. A few adjustments to pixel offsets to account for LEDs lost in the U-turns, and I was in business:

At one point, the display got dim halfway through, and the meter was showing 2A draw even when nothing was lit up -- oh, the stripped wires on the output end were shorting. I taped them up, and it's back to work again. So far I've overvolted and shorted this poor little display and it's barely worse for wear.


Okay, the concept is proven. Time to scale up. I found the aforementioned 90-LED 5m waterproof strips on Amazon for $15/ea, shipped overnight. I select quantity 3, and Amazon says "yeah, we can get those to you ... the day after Jeremy's birthday." Wait, wut? Fiddle around with the cart, and I figure out that they have quantity two in the nearby warehouse, and the others must be farther away. So I order two of the waterproof model, and one non-waterproof one. By the next day, Amazon's Ominous Massive Consumer Exploitation AI had rearranged the inventory, and they were willing to get another one of the waterproof ones here by Thursday. Okay, we're in business.

I began building out the display. I made it on two 1x4 foot panels of 2.7mm plywood so I can fold it up to carry it in the truck to wherever it's going to end up. Siggy helped me drill the panels.


Then we zip-tied the segments into place. 22 LEDs fit nicely in 4 feet, so I'm only wasting two LEDs on each row. I end up with a 44x6 display.

I had a lot of trouble soldering it together. The connection points are on the very ends of the board, poorly protected, so as I flipped the panels over and over, I broke wires off one end while soldering the other. In many cases, the wire took a piece of copper from the strip with it, making soldering it back unworkable.

I regrouped and rethought. All the broken points were power wires, which I can splice anywhere. So I peeled back more waterproofing silicone and spliced those in wherever. The data lines can't skip past LEDs, but none of those broke off. So I just rearranged the wires to return away from the edge of the board, and zip-tied all the pigtails to act as strain reliefs.

It's not quite perfect. At full brightness, the voltage drop at the end of the board is enough to turn the lights orange (the blue LEDs have a higher voltage threshold and drop out soonest). I suspect kinda-cold solder joints are adding too much resistance. But it works enough for now:

Things that are missing:

* I'm still waiting for the third LED spool

* Reconnoiter a place to deploy it. Can I get to the Convention Center loading dock? That's visible from Jeremy's place.

* Attach a power supply. A D-cell battery holder is coming from eBay.

* Add mounting holes and straps.

Improvements:

* Fix the cold solder joints.

* Add some spacers to keep the halves from bumping together and shorting.


Oh, and one more improvement. I wrote the display software in Arduino because it was quick and easy and came with a library to drive the pulse train for the programmable LEDs. But Arduino stinks! Jeremy and I have been building microcontroller software in our own lightweight operating system that we developed for the distributed system in my backyard rocketship treehouse. In the last month, Jeremy launched an effort to port it to the ESP32 platform. How dare I give him a birthday gift not built in his artisanal operating system?

Last night I worked on porting my Arduino code to rulos. The main challenge was bringing over the Adafruit Neopixel library.

The first issue was that it was written in C++, and rulos didn't have C++ support yet. I began hand-translating the class into a struct. Meanwhile, I casually mentioned that g++ didn't work in rulos in our group chat, and Jeremy said "hold my beer." Fifteen minutes later he said "try pulling now" -- he'd updated the build system in less time than it took me to port the library. Okay, that was pretty sweet.

Eventually Jeremy asked me what I was working on, and I had to be oblique. I'm pretty sure he knows it's a birthday present at this point, but everything else is still a surprise.

The next issue is that the Adafruit library in ESP32 mode uses the "RMT" peripheral, underlying hardware timing support, that crashes when I run it under rulos. I didn't want to debug that just yet, so I switched from that to the ESP8266 implementation which just does bitbanging in software. For reasons I don't understand, on the ESP32 I can't bang the bits very precisely or very reliably. Even with simple for() delay loops, the width of a pulse varies a by lot:

I'm not sure why bitbanging is so hard. The right thing to do is to get the RMT peripheral working in rulos, but I don't think I want to block this project on that. I hope Jeremy forgives me for celebrating his birthday with (ewww) Arduino code.

No comments:

Post a Comment