-
v2: Hackaday Supercon
10/13/2024 at 19:12 • 0 commentsA few months later, and it's Supercon time! There were a few flaws I wanted to fix from v1 to make it able to be given out to other folks and generally a more interesting board to work with.
First up: bootstrapping I2C. The default state of the LED controller is all off, which generally is probably a good thing. Unfortunately, that means you need to sent I2C commands to the SAO if you want it to do, well, anything, which makes it hard to give to other people. Having to entirely reflash a badge with custom firmware (that would overwrite your custom firmware) is generally a non-starter, so that had to change.
I swear at some point I found a RGB LED controller similar to the LP5018RSMR, but with flash memory to save a default state. That would have been perfect! Unfortunately, after a few hours of searching every LED driver manufacturer I could think of, this might have been a 2am hallucination after all. Ok, so if the LED driver can't save state, then what else can I do?
A few years ago, I came across Jay Carlson's $1 microcontroller roundup, filled with cheap MCUs of every size, shape, and flavor. A whole dollar felt a bit much to send a few I2C commands and then lay dormant, so I then came across his $0.03 MCU review. Ok, getting closer, but having a OTP MCU feels a little risky for me, and also makes it rather unhackable down the road. Thankfully, there's a middle ground: a $0.11 flash-based MCU! Nice and cheap, reprogrammable, and seemingly very well-featured for the price. So, this got designed in fairly easily, and will be programmed to initialize the LED driver on power-up so that the SAO will actually display something, even on a default badge without custom firmware. Plus, down the line I can perhaps offload animations and such to this MCU instead of doing it on the badge itself. A lot of opportunity for not a lot of cost. Adding that MCU was fairly painless (though beware, the location of the debug pins changes depending on if you're looking at the English datasheet or the Chinese one, trust the more up-to-date Chinese one), resulting in the v2 schematic:
Problem number 2: the cost. I want to make a good number of these to give out, I don't want to take out a loan for it. The BOM for v1 came out to a tolerable $4.38CAD per bare board plus controller and power protection... and an eye-watering $10.33CAD for all of the LEDs! Part of the issue was that I was ordering in single quantities, part of the issue is that some of the LEDs were just too esoteric for normal pricing, but in any event, I needed to take the unit cost down from $15CAD/board.
The lowest hanging fruit was alternate sourcing for the LEDs. Digikey is great for next day shipping and consistent quality, but you do pay a price for that. For bulk(ish) LEDs for a large build, LCSC provided much, much, much better pricing, with the caveat of taking longer to ship all the way from China, and ordering parts from brands that I've never heard of before. For just a fun little demo board though, no problem. The updated BOM is in the Github repo, but I was able to get the cost down to just about $1.10CAD for all of the LEDs, though I had to drop the 496nm LED. It's so cool, but the 505nm is close enough and it saves $1.17CAD -- it's cool but not the-entire-cost-of-all-the-other-LEDs-cool. The 505nm is still the most expensive LED at $0.56/ea @ 100, but I had to include one of the weird LEDs one way or another. I also did a few other subs such as making the UV led truly UV instead of just very deep blue (it's UV-A, it's safe, don't worry) and a few others are +/- 5nm or so, but overall the 10x cost saving is absolutely worth it.
The final problem was assembly time. Manually soldering the two dozen or so components on the back is fine for one or two boards, but will suck up a lot of time for 20. Thankfully, JLCPCB also has stupidly cheap assembly services. This did require a few more BOM adjustments to get all the components into the "Basic/Preferred Extended" categories to avoid reeling costs, but with the exception of the three ICs, everything else had a good alternative in JLC's library. To keep the theme of cost-cutting going, I also wanted to stay within the limits of the economical assembly, which is a good few times cheaper than standard assembly. This means only one-sided assembly and certain parts (such as the LED driver) needed replacing with a pin-compatible alternative due to special process issues.
Tragically, another restriction of the economical assembly option was limited board fabrication options. I had to pick between green/ENIG and white/HASL, so that holy grail of white/ENIG is still out of reach. A white PCB is still pretty close to the dream though, and my artistic vision isn't worth the sixty or so dollars it'd wind up adding to the final cost. All in, the boards with backside assembled came out to $2.75CAD/ea -- not bad! That puts the total SAO cost at under $5CAD/board (plus whatever you value my time to solder the front side), exactly what I was aiming for.
-
v1 Build
10/13/2024 at 18:18 • 0 commentsThis SAO was originally designed to bring to the Open Hardware Summit 2024 in Montreal, Canada. They hinted at the possibility of a SAO connector on the badge pretty close to the summit date, so it was a bit of a scramble to get this designed and fabbed in time. I went with JLCPCB to fab it, which meant 3ish days in production + about a week to ship + a day or two to assemble... rather tight, but doable. Unfortunately this meant having to comprimise on build quality: I wanted a white soldermask and ENIG plating to really get that 1931 clean white vibe, but time constraints meant I had to go with good 'ol green soldermask and HASL. Ah well, a green SAO is better than no SAO.
Soldering went alright, though without a stencil it did take a little while. Out of the three boards I assembled, one worked perfectly, one nearly worked with the exclusion of one of the LEDs, and one stubbornly refused to do anything at all. Not bad for a rushed soldering session, and I only needed one to work fully anyway. Some hastily thrown together Arduino code later, and we have light!
Not too bad, not too bad. Seeing all the fun colors was quite nice, though it was a pretty uneven spread of intensities. I wrote a little helper to normalize the intensities and that resulted in a pretty good looking SAO, I felt. It turned out that the OHS badge designer chose to not connect the I2C lines (sad) but did connect the GPIO pins (yay) which meant a little I2C bitbanging and the SAO was OHS-compatible.
I had intended to write some effects to give a little motion and intregue, but ran out of time for OHS. Hopefully I can do something fancier for next time, though generally I was very pleased that it worked out given the super short timeline I was working with.
-
Initial Design
10/13/2024 at 18:04 • 0 commentsI did a writeup for the motivation for this design over here, but the end result is that I wanted to put as many wavelengths of LED as I could onto a CIE 1931-shaped badge.
The first challenge was finding all the LEDs needed for this. Because this was in a SAO form factor, I was limited to using small 0603 or 0805 LEDs instead of the big, powerful Chip on Board LEDs. This means all the LEDs will have to come from the "Indicator LED" section on Digikey where there is generally less selection of color -- who cares if your indicator light is a slightly deeper shade of red than a standard 615nm red? A bit of a challenge, but I managed to find 12 unique colors plus four shades of white for a total of 16 LEDs:
Color Name Wavelength (nm) v1 P/N UV 456 150224BS73100 Deep Blue 465 APT2012QBC/D Blue 470 QBLP631-IB Teal 496 SMLD12E3N1WT86 Emerald 505 SMLD12E2N1WT86 Green 525 QBLP631-IG Yellow-Greener 560 SML-M13PTT86 Yellow-Green 570 QBLP631-AG Yellow 590 QBLP631-Y Amber 605 QBLP631-O Red 625 QBLP631-R Deep Red 640 QBLP631-S3 Soft White 3000K QBLP675-IW-WW Cool White 4000K QBLP675-IW-NW Bright White 6000K QBLP675-IW-CW Daylight 11000K QBLP661-IW5-CW I think my favorite are the Teal and Emerald LEDs from Rohm: they're marketed as being indicator lights for color universal design to make indicators apparent for colorblind folks. Pretty neat!
Of course, with all these LEDs comes a requirement to control them. Since the goal of the design is to show off how color mixing works, intensity control of each individual LED is required. Ideally the badge will be able to control the SAO, so I opted to use the SAO-spec standard I2C interface connected to a driver chip of some sort. I looked through a bunch of driver ICs and eventually settled on the LP5018RSMR constant current LED driver. This chip has a few advantages: first, controllable over I2C. It's designed for controlling RGB LEDs, but allows you to control each individual channel just fine which is what I'll be using. Additionally, it uses constant current control, which means I don't need a separate current-limiting resistor per LED -- reducing the amount of soldering and making layout easier. Finally, it's not a matrix-style controller, so all I need to do is provide power to the anode and route the cathode to the IC, again making layout easier.
I wanted the badge to not only work well but also look nice, which led to the decision to only do bottom-layer routing. I wanted the top layer to only have LEDs and silkscreen for a cleaner look, which made this IC even more useful as it greatly simplified single-layer routing.
All that's left is a bit of power protection to prevent reverse voltage (using a PMOS reverse polarity circuit) and prevent overcurrent from damaging the host badge (using the AP22653AW6-7 current limiting power switch) and we're good to go!
Because I love being difficult, I wanted to do any-angle routing + curves for the entire board to embrace the non-rectangular nature of the CIE1931 horseshoe. Lovely idea in concept, complete pain in practice. Altium is already iffy with any-angle routing, and the moment you try to throw curves in there it gets rather nasty. Thankfully there were not too many traces to have to coax into the right place, and the end result is appropriately swirly.