Different Algorithms Sort Christmas Lights

Sorting algorithms are a common exercise for new programmers, and for good reason: they introduce many programming fundamentals at once, including loops and conditionals, arrays and lists, comparisons, algorithmic complexity, and the tradeoff between correctness and performance. As a fun Christmas project, [Scripsi] set out to implement twelve different sorting algorithms over twelve days, using Christmas lights as the sorting medium.

The lights in use here are strings of WS2812 addressable LED strips, with the program set up to assign random hue values to each of the lights in the string. From there, an RP2040-based platform will step through the array of lights and implement the day’s sorting algorithm of choice. When operating on an element in the array the saturation is turned all the way up, helping to show exactly what it’s doing at any specific time. When the sorting algorithm has finished, the microcontroller randomizes the lights and starts the process all over again.

For each of the twelve days of Christmas [Scripsi] has chosen one of twelve of their favorite sorting algorithms. While there are a few oddballs like Bogosort which is a guess-and-check algorithm that might never sort the lights correctly before the next Christmas (although if you want to try to speed this up you can always try an FPGA), there are also a few favorites and some more esoteric ones as well. It’s a great way to get some visualization of how sorting algorithms work, learn a bit about programming fundamentals, and get in the holiday spirit as well.

Raspberry Pi Pico LED display sitting in window sill

An Ode To The Aesthetic Of Light In 1024 Pixels

Sometimes, brilliant perspectives need a bit of an introduction first, and this is clearly one. This video essay by [Cleggy] delivers what it promises: an ode to the aesthetic of light. But he goes further, materializing his way of viewing things into a beautiful physical build — and the full explanation of how to do it at home.

What’s outstanding here is not just the visual result, but the path to it. We’ve covered tons of different LED matrices, and while they’re all functional, their eventual purpose is left up to the builder, like coasters or earknobs. [Cleggy] provides both. He captured a vision in the streets and then built an LED matrix from scratch.

The matrix consists of 1024 hand-soldered diodes. They’re driven by a Raspberry Pi Pico and a symphony of square waves. It’s not exactly a WS2812 plug-and-play job. It’s engineered from the silicon up, with D-latches and demultiplexers orchestrating a mesmerizing grayscale visual.

Pulse-width modulation (PWM) is the secret ingredient of this hack. [Cleggy] dims each white pixel separately, by varying the duty cycle of its light signal. The grayscale video data, compressed into CSV files, is parsed line-by-line by the Pico, translating intensity values into shimmering time slices.

It transforms the way you see and perceive things. All that, with a 1000 LED monochrome display. Light shows are all highly personal, and each one is a little different. Some of them are really kid stuff.

Continue reading “An Ode To The Aesthetic Of Light In 1024 Pixels”

A visual timer for toddlers that uses LEDs that go out.

Time Management For Toddlers

It’s really never too early (or too late) to learn time management. All joking aside, carefully managing one’s time can result in some really wondrous achievements. So it’s best to learn early, when most of your time is spent generally having fun.

Let’s say you’ve just heard you have five minutes left to play, but what does that mean if you’re three years old? Not much, unless you have some visual cues to go by. That’s the idea behind [Julius Curt]’s visual timer for toddlers.

This lovely reverse progress bar uses a Wemos D1 mini to control a strip of six WS2812B LEDs at 30 LEDs/meter density. There’s a small OLED display for literate users, and the whole thing is childproof. [Julius] challenged himself to do this entire project in one day, and ended up finishing it in a little over eight hours total, including time to design the way cool knob. Be sure to check out the build video below.

If you struggle with managing your time, check out our own [Arya Voronova]’s personal account.
Continue reading “Time Management For Toddlers”

Modular Magnetic LED Matrix

[bitluni] seems rather fond of soldering lots of LEDs, and fortunately for us the result is always interesting eye candy. The latest iteration of this venture features 8 mm WS2812D-F8 addressable LEDs, offering a significant simplification in electronics and the potential for much brighter displays.

The previous version used off-the-shelf 8×8 LED panels but had to be multiplexed, limiting brightness, and required a more complex driver circuit. To control the panel, [bitluni] used the ATtiny running the MegaTinyCore Arduino core. Off-the-shelf four-pin magnetic connectors allow the panels to snap together. They work well but are comically difficult to solder since they keep grabbing the soldering iron. [bitluni] also created a simple battery module and 3D printed neat enclosures for everything.

Having faced the arduous task of fixing individual LEDs on massive LED walls in the past, [bitluni] experimented with staggered holes that allow through-hole LEDs to be plugged in without soldering. Unfortunately, with long leads protruding from the back of the PCB, shorting became an immediate issue. While he ultimately resorted to soldering them for reliability, we’re intrigued by the potential of refining this pluggable design.

The final product snapped together satisfyingly, and [bitluni] programmed a simple animation scheme that automatically updates as panels are added or removed. What would you use these for? Let us know in the comments below. Continue reading “Modular Magnetic LED Matrix”

A chicken's egg with many holes glows beneath a glass globe set atop an inverted wooden bowl.

Glowing Egg Is A One-Oeuf Solution For Tracking Cycles

Look, if something happened to you every three weeks or so to basically turn you into a different person and factored heavily into whether any new humans were created, you’d probably want to keep abreast of the schedule, yeah? Yeah. So, while there are, of course, a ton of ways to do this with your phone, most of those apps do gross things with your data. Are you angry yet?

A standard chicken's egg with many holes both large and small.[Jakoba the Online Witch] certainly was, or if not angry, at least annoyed. So she built a glowing egg timer, which shines a different color based on current point in her cycle, to let her know when she is fertile and expecting Aunt Flo.

The coolest part is that this is an actual egg from one of [Jakoba]’s backyard chickens. No. The coolest part is how she was able to make so many holes without breaking it. (It took four tries.)

After bleaching the insides, the egg was ready to glow. As [Jakoba] says, the guts are simple — just a Wemos D1 Mini ESP8266, a WS2812 LED, and a heatsink. The enclosure consists of an inverted peanut bowl with a glass ornament hot-glued in place.

Once it was put together, all she had to do was add it in Home Assistant and use the current calendar state to trigger services from the YAML configuration.

Would you prefer an on-body solution? Here’s an earring that tracks temperature.

A small physical version of the game 2048, played with LEDs as numbers and tilt for input.

2024 Tiny Games Challenge: It’s 2048, But With LEDs

Remember the game 2048? You slide numbered tiles around on a grid, combining them until you have one tile with a value of 2048 (although it’s possible to go higher). Legend has it that 2048 was created by a bored teenager in the space of a weekend to see if he could program a game from scratch.

It only took a couple of weekends for [David] to get Tiny2048 up and running. In this version, each RGB value represents a number value, and input comes from a rudimentary gesture detector — tilt it this way and that to move the LEDs and combine the ‘numbers’. As you might imagine, it was a bit tricky to use colors to represent numbers, so each one had to be sufficiently unique.

[David] says that the LED matrix is a string of WS2812 LEDs in a grid formation, controlled by an ESP32-S3-MINI-1. Although this may be overkill, [David] broke out a bunch of IO at the top of the board so it can be used in the future as a dev board. Be sure to check it out in blinkenlight action after the break!

Continue reading “2024 Tiny Games Challenge: It’s 2048, But With LEDs”

It’s The Simple Things

I love minimal hacks. Limitations are sometimes the spark for our greatest creativity, and seeing someone do something truly marvelous with the simplest of technological ingredients never fails to put a smile on my face.

This week, it was the super-simple 1D Fireworks project by [Daniel Westhof]. Nothing more than an ESP8266 and a long RGB LED strip went into this effect on the hardware side, and indeed the code isn’t all that tricky either. But what it does is a very nice simulation of the physics that define the movement of a flare rocket and then all of the stars that explode out of it. And that makes it look so good.

Hackaday’s [Kristina Panos] is apparently also a fan of the single dimension, because she picked out some of my personal favorite uses of an LED strip, including Twang, to which we’ll admit we’re addicted, or any of the PONG versions.

But I’ve seen other games, including a button-mashing racer and various roller-coaster simulations. All with the same, essentially, two-part BOM. (OK, if you don’t count the buttons/accelerometer, or power supply.) Or this demo of sorting routines, or the Velocicoaster. And I think there’s more out there.

How much creativity can you pack into an LED strip? This sounds like we need to make a new contest…