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.

Twelve Days Of Christmas As Performed By 1980s Speech Chip

In a curious historical twist, the “Twelve days of Christmas” are actually the days of revelry that followed the 25th. The preceding period, Advent, was traditionally a fast, not unlike Lent. When and why a fast became an excuse for chocolate calendars we cannot say, but this historical information is presented to explain that this great hack by [Kevin], making a vintage speech synthesizer chip sing the classic carol will remain relevant at least until January 5th — or perhaps even the 19th, for the Orthodox amongst us.

The chip in question is an SP0256A-AL2, which you may remember from various speech projects for 8-bit computers back in the day. It can talk, after a fashion, by reproducing 56 “allophones” — the sounds that make up English speech — from ROM. Singing, though? We cannot recall much of that back in the day, but then, a talking computer was impressive enough.

As it turns out this is building on an earlier hack [Kevin] did in which he used an Arduino to make the venerable speech chip MIDI controllable. In that project’s write-up it is revealed that a Si5351 programmable clock module is used to give a variable pitch signal to the speech synthesizer. In this way he’s able to get about an octave an a half, which is good enough when the carol in question only spans one octave.

Of course the pitch signal needs to be varied by something and for that the venerable Arduino once again takes the place of an 8-bit computer. In this case it’s pre-programmed, but can also be set up for MIDI control.Of course nothing says you can’t use true retro hardware or a more-capable RP2040 instead of the Amtel chip.

It’s sad to think how much compute power has been wasted this year on AI-generated novelty carols when a little bit of 1980s silicon and some ingenuity can do nearly as good — or better, depending on your tastes. Continue reading “Twelve Days Of Christmas As Performed By 1980s Speech Chip”

Christmas Ornament Has Hidden Compartment, Clever Design

If you need something clever for a gift, consider this two-part 3D-printed Christmas ornament that has a small secret compartment. But there’s a catch: the print is a challenging one. So make sure your printer is up to the task before you begin (or just mash PRINT and find out).

Want a challenging print that’s also useful? This two-piece ornament has a small gift area inside, and prints without supports.

This design is from [Angus] of [Maker’s Muse] and it’s not just eye-catching, but meticulously designed specifically for 3D printing. In fact, [Angus]’s video (embedded under the page break) is a great round-up of thoughtful design for manufacture (DFM) issues when it comes to filament-based 3D printing.

The ornament prints without supports, which is interesting right off the bat because rounded surfaces (like fillets, or a spherical surface) facing the build plate — even when slightly truncated to provide a flat bottom — are basically very sharp overhangs. That’s a feature that doesn’t generally end up with a good surface finish. [Angus] has a clever solution, and replaces a small section with a flat incline. One can’t tell anything is off by looking at the end result, but it makes all the difference when printing.

There are all kinds of little insights into the specific challenges 3D printing brings, and [Angus] does a fantastic job of highlighting them as he explains his design and addresses the challenges he faced. One spot in particular is the flat area underneath the hang hole. This triangular area is an unsupported bridge, and because of its particular shape, it is trickier to print than normal bridges. The workable solution consists of countersinking a smaller triangle within, but [Angus] is interested in improving this area further and is eager to hear ideas on how to do so. We wonder if he’s tried an approach we covered to get better bridges.

Want to print your own? 3D files are available direct from [Angus]’s site in a pay-what-you-like format. If your 3D printer is up to it, you should be able to make a few before Christmas. But if you’d prefer to set your sights on next year with something that uses power and hardware, this tiny marble machine ornament should raise some eyebrows.

Continue reading “Christmas Ornament Has Hidden Compartment, Clever Design”

A Musically-Reactive LED Christmas Tree

Regular Christmas trees don’t emit light, nor do they react to music. If you want both things in a holiday decoration, consider this build from [dbmaking]. 

An ESP32-D1 mini runs the show here. It’s hooked up to a strip of WS2812B addressable LEDs. The LED strip is placed on a wooden frame resembling the shape of a traditional Christmas tree. Ping-pong balls are then stacked inside the wooden frame such that they act as a light diffuser for the LEDs behind. The microcontroller is also hooked up to an INMP441 omnidirectional MEMS microphone module. This allows the ESP32 to detect sound and flash the LEDs in time, creating a colorful display that reacts to music. This is achieved by using the WLED web installer to set the display up in a sound reactive mode.

It’s a fun build, and we’d love to tinker around with coding more advanced visualizer effects for a build like this. We’ve seen builds that go the other way, too, by toning down excessive blinkiness in Christmas decorations.

Continue reading “A Musically-Reactive LED Christmas Tree”

Christmas Comes Early With AI Santa Demo

With only two hundred odd days ’til Christmas, you just know we’re already feeling the season’s magic. Well, maybe not, but [Sean Dubois] has decided to give us a head start with this WebRTC demo built into a Santa stuffie.

The details are a little bit sparse (hopefully he finishes the documentation on GitHub by the time this goes out) but the project is really neat. Hardware-wise, it’s an audio-enabled ESP32-S3 dev board living inside Santa, running the OpenAI’s OpenRealtime Embedded SDK (as implemented by ExpressIf), with some customization by [Sean]. Looks like the audio is going through the newest version of LibPeer and the heavy lifting is all happening in the cloud, as you’d expect with this SDK. (A key is required, but hey! It’s all open source; if you have an AI that can do the job locally-hosted, you can probably figure out how to connect to it instead.)

This speech-to-speech AI doesn’t need to emulate Santa Claus, of course; you can prime the AI with any instructions you’d like. If you want to delight children, though, its hard to beat the Jolly Old Elf, and you certainly have time to get it ready for Christmas. Thanks to [Sean] for sending in the tip.

If you like this project but want to avoid paying OpenAI API fees, here’s a speech-to-text model to get you started.We covered this AI speech generator last year to handle the talky bit. If you put them together and make your own Santa Claus (or perhaps something more seasonal to this time of year), don’t forget to drop us a tip!

You’ve Got All Year To Print This Marble Machine Ornament For Your Christmas Tree

Most Christmas ornaments just hang there and look pretty. [Sean Hodgins] decided to whip up something altogether fancier and more mechanical. It’s a real working marble machine that hangs from the tree!

The build is simple enough, beginning with a translucent Christmas ornament shell readily available from most craft stores. Inside, a small motor spins a pinion, which turns a larger gear inside the body. As the larger gear spins, magnets embedded inside pick up steel balls from the base of the ornament and lift them up to the top. As they reach their zenith, they’re plucked off by a scoop, and then they roll down a spiral inside. As for power, [Sean] simply handled that with a couple of wires feeding the motor from a USB power bank. Just about any small battery pack would do fine.

The build is beautiful to watch and to listen to, with a gentle clacking as the balls circulate around. Files are on MakerWorld for the curious. We’ve featured some great Christmas decorations before, too. Video after the break.

A Transparent BB-8 Build Using Christmas Ornaments

The cool thing about the droids of Star Wars is that they’re not that hard to recreate in real life. R2-D2 is a popular choice, but you can even build yourself a neat little BB-8 if you’re so inclined. [Piyush] has built a particularly compelling example that’s transparent, which lets you see the internals and how it all works.

The build makes creative use of a pair of Christmas ornaments. They are perhaps the cheapest and easiest way to source a clear plastic sphere. One serves as the “head”, while the other serves as the larger spherical body. Inside, an Arduino Pro Micro is running the show. It’s hooked up to a L293D motor driver which runs the drive motors and the reaction wheel motor which provides stability, while a separate MOSFET is on hand to run the gear motor which controls the head.

There’s also an HC-05 module for Bluetooth communication, and a BNO055 sensor for motion tracking and ensuring the robot stays the right way up. 3D printed components are used prodigiously to cram everything together tightly enough to fit. There’s even a printed charging base to juice up the little droid. Controlling the robot is as simple as using a smartphone with an app created in the MIT App Inventor.

If you’ve never built a spherical rolling robot before—and few of us have—this design is a great reference for your own work. We’ve seen a few BB-8s over the years, most of which dropped shortly after the movie was released. Continue reading “A Transparent BB-8 Build Using Christmas Ornaments”