Sound-Reactive Light Saber Flips Allegiance Via Vowel Sounds

Students [Berk Gokmen] and [Justin Green] developed an RP2040-based LED-illuminated lightsaber as a final project with a bit of a twist. It has two unusual sound-reactive modes: disco mode, and vowel detection mode.

Switching allegiances (or saber color, at least) is only a sound away.

Disco mode alters the color of the saber dynamically in response to incoming sounds. Color and brightness are altered in response to incoming frequencies picked up by the on-board microphone, making a dynamic light show that responds particularly well to music.

The second mode is vowel detection, and changes the lightsaber’s color depending on spoken sounds. The “ee” sound makes the saber red, and the “ah” sound turns it blue. This method requires a lot of processing and filtering, and in the end it works, but is quite dependent on individual speakers for calibration.

The sound functionality centers around FFTs (Fast Fourier Transforms) which are fundamental to processing signals like audio in a meaningful way, and is a method accessible to embedded devices like microcontrollers with ADCs.

The lightsaber is battery-powered and wireless, and there are loads of details about the finer points of the design (including challenges and tradeoffs) on the project page, and the source code is available on GitHub. A video demonstration and walkthrough is embedded below.

Continue reading “Sound-Reactive Light Saber Flips Allegiance Via Vowel Sounds”

Edgar Thomson Steel Works in the mid-1990s (Credit: David Rochberg - Own work, CC BY 2.5)

How US Steel Changed From World-Leading To Industry-Trailing

It was recently announced that US Steel will be acquired by Tokyo-based Nippon Steel for a measly $14.1 billion , ending the former’s 122 year history as a former US industrial powerhouse. Yet what happened to degrade what was once the number one steel maker in the world upon its formation out of two existing industrial giants in 1901 into a has-been? This is the topic that¬†[Brian Potter] dives into in a recent article.

Most of the how and why can be condensed into a simple reluctance to follow industry innovations, often passing on new technologies. This went well until the post-WWII era, when foreign competition began to heat up, with this competition more than happy to embrace whatever new steel making technologies became available. Case in point was the replacement of open hearth furnaces with basic oxygen furnaces by the early 1950s, which US Steel only began to adopt in the 1960s. These were then themselves largely replaced by contemporary electric arc furnaces, in a constant renewal process that US Steel failed to adapt to, unlike its more nimble competitors.

By the early 1980s US Steel’s US market share had already dropped to around 20% as Japanese steel makers in particular were eating its lunch. As US Steel and other US steel makers kept falling behind on the competition, shedding plants and workers in an attempt to stay profitable, it should come as no surprise that this would be US Steel’s ultimate fate.

(top image: Edgar Thomson Steel Works in the mid-1990s (Credit: David Rochberg – Own work, CC BY 2.5) )

Flashlight Door Lock Is A Bright Idea

There are many ways to lock a door. You could use a keypad, an RFID card, a fingerprint or retina scan, Wi-Fi, Bluetooth, the list goes on. You could even use a regular old metal key. But none of these may be as secure as [mircemk]’s Arduino-based door lock that employs a smartphone’s flashlight as a pass code.

At first blush, this seems horribly insecure. Use a plain old flashlight to open a door? Come on. But the key is in the software. In fact, between the typed-in pass code and the flash of light it generates, this lock kind of has two layers of security.

Here’s what’s going on: inside the accompanying smart phone application, there’s a list of passwords. Each of these passwords corresponds to a flash of light in milliseconds. Enter the correct password to satisfy the Arduino, and the phone’s flashlight is activated for the appropriate number of milliseconds to unlock the door.

As you’ll see in the video below, simply flashing the light manually doesn’t unlock the door, and neither does entering one of the other, bogus passwords. Although it does activate the flashlight each time, they don’t have the appropriate light-time length defined.

Hardware-wise, there is an Arduino Nano Every in charge of the LDR module that reads the flashlight input and the 12 V relay that unlocks the door. Be sure to check it out it the video after the break.

If you want to keep your critters from bringing wild critters back inside, check out this Wi-Fi cat door that lets you have a look at what might be dangling from their jaws before unlocking the door.

Continue reading “Flashlight Door Lock Is A Bright Idea”

Gentoo Linux, Now A Bit Less For The 1337

Among users of Linux distributions there’s a curious one-upmanship, depending on how esoteric or hardcore¬† your distro is. Ubuntu users have little shame, while at the other end if you followed Linux From Scratch or better still hand-compiled the code and carved it onto the raw silicon with a tiny chisel, you’re at the top of the tree*. Jokes aside though, it’s fair to say that if you were running the Gentoo distribution you were something of a hardcore user, because its source-only nature meant that everything had to be compiled to your liking. We’re using the past tense here though, because in a surprise announcement, the distro has revealed that it will henceforth also be available as a set of precompiled binary packages.

There may be readers with long and flowing neckbeards who will decry this moment as the Beginning of the End, but while it does signal a major departure for the distro if it means that more people are spurred to take their Linux usage further and experiment with Gentoo, this can never be a bad thing. Gentoo has been on the list for a future Jenny’s Daily Drivers OS review piece, and while we’re probably going to stick with source-only when we do it, it’s undeniable that there will remain a temptation to simply download the binaries.

Meanwhile this has been written on a machine running Manjaro, or Arch-for-cowards as we like to call it, something that maybe confers middle-ranking bragging rights. Read a personal tale of taking off those Linux training wheels.

* Used a magnifying glass? You’re just not cutting it!

This Baby ‘Scope Is Within Your Reach

The modern oscilloscope is truly a marvelous instrument, being a computer with a high-speed analogue front end which can deliver the function of an oscilloscope alongside that of a voltmeter and a frequency counter. They don’t cost much, and having one on your bench gives you an edge unavailable in a previous time. That’s not to dismiss older CRT ‘scopes though, the glow of a phosphor trace has illuminated many a fault finding procedure. These older instruments can even be pretty simple, as [Mircemk] demonstrates with a small home-made example that we have to admit to rather liking.

At its heart is a small 5 cm round CRT tube, with an off-the-shelf buck converter supplying the HT, a neon lamp relaxation oscillator supplying the timebase, and a set of passive components conditioning the signal to the deflection plates. The whole thing runs from 12 V and fits in a neat case. It has one huge flaw in that there is no trigger circuit, and sadly this compromises its usefulness as an instrument. Our understanding of a neon oscillator is a little rusty but we’re guessing the two-terminal neon lamp would have to be replaced by one of the more exotic gas-filled tubes with more electrodes, of which one takes the trigger pulse.

Even without a trigger it’s still a neat device, so take a look at it. Perhaps surprisingly we’ve seen few CRT ‘scopes made from scratch here at Hackaday, but never fear, here’s one used as an audio visualiser.

Hackaday Podcast Episode 250: Trains, RC Planes, And EEPROMS In Flames

This week in the Podcast, Elliot Williams is off at Chaos Communication Congress, hearing tales of incredible reverse engineering that got locomotives back up and running, while Al Williams is thinking over what happened in 2023. There’s a lot of “how things work” in this show, from data buoys to sewing machines to the simulated aging of ICs.

Whether you’re into stacking bricks, stacking Pi Picos, or stacking your 3D prints to make better use of precious bed space, this episode is for you. Enjoy.

This is your last chance to download a new podcast this year. Take it!

Continue reading “Hackaday Podcast Episode 250: Trains, RC Planes, And EEPROMS In Flames”

Using Local AI On The Command Line To Rename Images (And More)

We all have a folder full of images whose filenames resemble line noise. How about renaming those images with the help of a local LLM (large language model) executable on the command line? All that and more is showcased on [Justine Tunney]’s bash one-liners for LLMs, a showcase aimed at giving folks ideas and guidance on using a local (and private) LLM to do actual, useful work.

This is built out from the recent llamafile project, which turns LLMs into single-file executables. This not only makes them more portable and easier to distribute, but the executables are perfectly capable of being called from the command line and sending to standard output like any other UNIX tool. It’s simpler to version control the embedded LLM weights (and therefore their behavior) when it’s all part of the same file as well.

One such tool (the multi-modal LLaVA) is capable of interpreting image content. As an example, we can point it to a local image of the Jolly Wrencher logo using the following command:

llava-v1.5-7b-q4-main.llamafile --image logo.jpg --temp 0 -e -p '### User: The image has...\n### Assistant:'

Which produces the following response:

The image has a black background with a white skull and crossbones symbol.

With a different prompt (“What do you see?” instead of “The image has…”) the LLM even picks out the wrenches, but one can already see that the right pieces exist to do some useful work.

Check out [Justine]’s script, which cleverly evaluates image filenames. If an image’s given filename already looks like readable English (also a job for a local LLM) the image is left alone. Otherwise, the picture is fed to an LLM whose output guides the generation of a new short and descriptive English filename in lowercase, with underscores for spaces.

What about the fact that LLM output isn’t entirely predictable? That’s easy to deal with. [Justine] suggests always calling these tools with the --temp 0 parameter. Setting the temperature to zero makes the model deterministic, ensuring that a same input always yields the same output.

There’s more neat examples on the Bash One-Liners for LLMs that demonstrate different ways to use a local LLM that lives in a single-file executable, so be sure to give it a look and see if you get any new ideas. After all, we have previously shown how automating tasks is almost always worth the time invested.