Originally intended for the 2024 Supercon SAO Contest but we missed the deadline. Wha wha. We introduced it at Supercon 2024 in early November in Pasadena, CA. We should have started a .io project/blog long ago, but here we are.
Features
Besides being out of this world in design and fairly LED-y, it works as an I2C target device to both select different "effects" or assume complete control of the 5 LEDs and 16 WS2812s. Two LEDs are wired to in a special "sensing" circuit. It also features two buttons.
Usage
The left button sequences between "Effects" for the Upper Trim (the 5 WS2812's in the middle), while the right button sequences between Effects for the Lower Trim (WS2812's at the bottom).
A long press on the left button will enter "brightness control mode" - the left eye will go into a rapid red flashing to indicate such. Subsequent regular (short) button presses on left or right, will decrease or increase, respectively, brightness. Use a left long press to return to normal mode.
History
Kop and I started talking about entering the contest back in early August 2024; Kop hadn't done a HW design this complicated, and Todd hadn't written C this complicated - so it was going to be a stretch, but we love how it turned out.
We went through a couple ideas until we hit on the idea of blinky cartoonish flying saucer with alien. We googled up some images as inspiration and eventually Kop came up with a design we loved.
We somehow got it in our heads to use the famous "10 cent microcontroller" and after delving into that, we ended up using the CH32V003F4U6. Originally we designed it with two buttons without any idea what we'd really use them for... but eventually we did (see Features, above).
Since there's white LEDs are stars, we had this idea of reverse biasing one as a sensor, so some kind of data could be transmitted between SAOs during some specific mode... it was vague and it never got implemented.
We also wanted to utilize the I2C, and the idea was to allow a host to fully take over all the LEDs; this is partially implemented and is under continued development.
For the firmware Todd decided on ch32v003fun platform/library over using the manufacturer's IDE and HAL. It's been really great working with the creator, [cnlohr], and the community.
Eventually, time slide by and (besides not blogging) we missed the contest deadline, but got a HW production run of 10 delivered on time. We were busy still working on the FW the Friday of the con. It seemed well received.
[true] was super helpful at the con with his experience with both the mcu and the platform.
We both learned a lot.
Lessons Learned
Well, a lot, but here are some that come to mind:
- Originally, we'd given no thought to the stars except that they would blink. Later, we thought just straight on/off wasn't good enough and we'd hope for more; so dimming and variable brightness would be great. But then we realized many of the GPIO pins they were connected to did not natively support PWM, so we'd have to do it in the firmware. It would have been best to know our design specs up front and assign the GPIO correctly, but we didn't. Thanks again to [true] for help making the soft PWM successful as the stars look so much more star-like now.
- In general (and not just from this project), always come up with a robust state machine approach and apply it - see UML State machines, for instance.
More Info
There's a github link on the project page.
Also, specifically see the Firmware Readme and the Hardware Readme.
Flashing instructions TBD...
The Future
Kop and Todd have caught the "bug", and during the con's Sun night after-party we dreamed up a few ideas, and hope to bring one or more of them to Supercon 2025!