Code Your Own Twitch Chat Controls For Robots — Or Just About Anything Else!

Twitch Plays Pokemon burst onto the then nascent livestreaming scene back in 2014, letting Twitch viewers take command of a Game Boy emulator running Pokemon Red via simple chat commands. Since then, the same concept has been applied to everything under the sun. Other video games, installing Linux, and even trading on the New York Stock Exchange have all been gameified through Twitch chat.

TwitchPlaysPokemon started a craze in crowdsourced control of video games, robots, and just about everything else.

You, thirsty reader, are wondering how you can get a slice of this delicious action. Fear not, for with a bit of ramshackle code, you can let Twitch chat take over pretty much anything in, on, or around your computer.

It’s Just IRC

The great thing about Twitch chat is that it runs on vanilla IRC (Internet Relay Chat). The protocol has been around forever, and libraries exist to make interfacing easy. Just like the original streamer behind Twitch Plays Pokemon, we’re going to use Python because it’s great for fun little experiments like these. With that said, any language will do fine — just apply the same techniques in the relevant syntax.

SimpleTwitchCommander, as I’ve named it on Github, assumes some familiarity with basic Python programming. The code will allow you to take commands from chat in two ways. Commands from chat can be tabulated, and only the one with the most votes executed, or every single command can be acted on directly. Actually getting this code to control your robot, video game, or pet viper is up to you. What we’re doing here is interfacing with Twitch chat and pulling out commands so you can make it do whatever you like. With that said, for this example, we’ve set up the code to parse commands for a simple wheeled robot. Let’s dive in.

Continue reading “Code Your Own Twitch Chat Controls For Robots — Or Just About Anything Else!”

Compute Module 4 NAS With Custom Carrier Board

At this point, we’ve seen more Raspberry Pi Network Attached Storage (NAS) builds than we can possibly count. The platform was never a particularly ideal choice for this task due to the fact it could only connect to drives over USB, but it was cheap and easy to work with, so folks made the best of it. But that all changed once the Compute Module 4 introduced PCIe support to the Raspberry Pi ecosystem.

If this impressive NAS built by [mebs] represents the shape of things to come, we’re more than a little excited. On the outside, with its 3D printed case and integrated OLED display to show system status, it might look like plenty of builds that came before it. But pop the top of this cyberpunk-styled server, and you realize just how much work went into it.

At the heart of this NAS is a purpose-built carrier board that [mebs] designed based on the KiCad files the Raspberry Pi Foundation released for their official CM4 IO Board. While not much larger than the CM4 itself, the NAS board breaks out the board’s PCIe, Ethernet, HDMI, and USB. There’s also a header for I2C, used primarily for the OLED display but naturally expandable to additional sensors or devices, and nine GPIO pins for good measure.

Of course, that alone doesn’t make a NAS. Into that PCIe port goes a four channel SATA controller card, which in turn is connected to the hard disk drives that are nestled into their respective nodes of the printed case. A central fan blows over the electronics at the core, and thanks to clever design and a few cardboard seals, pulls air over the drives by way of intake vents printed into the sides.

As impressive as this build is, not everyone will need this level of performance. If you don’t mind being limited to USB speeds, you can 3D print a NAS enclosure for the standard Raspberry Pi. Or you could always repurpose an old PC case if you’d like something a bit more substantial.

Big Clive Hacks LED Bulbs With OpenSCAD

After accidentally crushing the plastic envelope on a cheap LED light bulb, [bigclivedotcom] figured out he could make custom ones using OpenSCAD in any shape he wants. He previously hacked a bunch of these inexpensive LED bulbs last month, discovering they all shared a similar circuit topology. All the ones he experimented with drove the LEDs hard, something that’s bound to reduce bulb lifetime. By reverse engineering the current control regulator, it turns out it is easy to adjust the drive current by changing a resistor or two. Reducing the current should not only increase lifetime, but could allow repurposing the bulb for other uses, such as decorative lighting.

Tweaking the LED Current

Three OpenSCAD scripts are provided which generate what he calls diamond, obelisk, and globe styles. Basic parameters for each style can be tweaked by the user, such as feature sizes and number of facets. He mentions the lack of OpenSCAD customizers in his script — this can easily be added as shown in the following example (this section of the User Manual on customizers explains the syntax). Note that you can’t make the slider generate real numbers, only whole numbers, which is why the scaling factor is multiplied by 10.

Adding Parameter Customization Sliders is Easy

These fancy globes can be used as night lights and possibly outdoor lighting, if you can make a good seal with the base. Custom chandeliers, anyone? Indicator lamps for very large panels? Any other ideas? If you want to explore the LED lifetime issue further, inveterate tinkerer Ted Yapo wrote a deep dive into the mythical 100,000 hour LED bulb. Thanks to [Cliff Claven] for the tip.

Continue reading “Big Clive Hacks LED Bulbs With OpenSCAD”

Fun While It Lasted, Falcon 9 Telemetry Now Encrypted

A few weeks back we brought word that Reddit users [derekcz] and [Xerbot] had managed to receive the 2232.5 MHz telemetry downlink from a Falcon 9 upper stage and pull out some interesting plain-text strings. With further software fiddling, the vehicle’s video streams were decoded, resulting in some absolutely breathtaking shots of the rocket and its payload from low Earth orbit.

Unfortunately, it looks like those heady days are now over, as [derekcz] reports the downlink from the latest Falcon 9 mission was nothing but intelligible noise. Since the hardware and software haven’t changed on his side, the only logical conclusion is that SpaceX wasn’t too happy about radio amateurs listening in on their rocket and decided to employ some form of encryption.

Since this data has apparently been broadcast out in the clear for nearly a decade before anyone on the ground noticed, it’s easy to see this as an overreaction. After all, what’s the harm in a few geeks with hacked together antennas getting a peek at a stack of Starlink satellites? [derekcz] even mused that allowing hobbyists to capture these space views might earn the company some positive buzz, something Elon Musk never seems to get enough of.

Some of the images [derekcz] was able to capture from the Falcon 9

On the other hand, we know that SpaceX is actively pursuing more lucrative national security launch contracts for both the Falcon 9 and Falcon Heavy. For these sensitive government payloads, the normal on-screen telemetry data and space views are omitted from the company’s official live streams. It seems likely the Pentagon would be very interested in finding out how civilians were able to obtain this information, and a guarantee from SpaceX that the link would be encrypted for all future flights could have helped smooth things over.

At the end of the post [derekcz] echos a sentiment we’ve been hearing from other amateur radio operators  recently, which is that pretty soon space may be off-limits for us civilians. As older weather satellites begin to fail and get replaced with newer and inevitably more complex models, the days of picking up satellite images with an RTL-SDR and a few lines of Python are likely numbered.

Hydraulics Made Simple

Corralling electrons is great and what most of us are pretty good at, but the best projects have some kind of interface to the real world. Often, that involves some sort of fluid such as water or air moving through pipes. If you don’t grasp hydraulics intuitively, [Practical Engineering] has a video you’ll enjoy. It explains how flow and pressure work in pipes.

Granted, not every project deals with piping, but plumbing, sprinkler systems, cooling systems, and even robotics often have elements of hydraulics. In addition, as the video points out, fluid flow in a pipe is very similar to electrical current flowing through wires.

Continue reading “Hydraulics Made Simple”

Shoot Above The Waves On This E-Foil Made From A Rifle Case

So you say you want to fly above the waves on an electric hydrofoil, but you don’t have the means to buy a commercial board. Or, you don’t have the time and skills needed to carve a board and outfit it with the motor and wing that let it glide above the water. Are you out of luck? Not if you follow this hackworthy e-foil build that uses a waterproof rifle case as the… hull? Board? Whatever, the floaty bit.

If you haven’t run across an e-foil before, prepare to suddenly need something you never knew existed. An e-foil is basically a surfboard with a powerful brushless motor mounted on a keel of sorts, fairly far below the waterline. Along with the motor is a hydrofoil to provide lift, enough to raise the board well out of the water as the board gains speed. They look like a lot of fun.

Most e-foils are built around what amounts to a surfboard, with compartments to house the battery, motor controller, and other electronics. [Frank] and [Julian] worked around the difficult surfboard build by just buying a waterproof rifle case. It may not be very hydrodynamic, but it’s about the right form factor, it already floats, and it has plenty of space for electronics. The link above has a lot of details on the build, which started with reinforcing the case with an aluminum endoskeleton, but at the end of the day, they only spent about 2,000€ on mostly off-the-shelf parts. The video below shows the rifle case’s maiden voyage; we were astonished to see how far and how quickly the power used by the motor drops when the rifle case leaves the water.

Compared to some e-foil builds we’ve seen, this one looks like a snap. Hats off to [Frank] and [Julian] for finding a way to make this yet another hobby we could afford but never find time for.

Continue reading “Shoot Above The Waves On This E-Foil Made From A Rifle Case”

Harmonic Drive Uses Compliant Mechanism To Slim Down

[Levi Janssen] has a secret: he doesn’t like harmonic drives. But rather than abandon the torque-amplifying transmission completely, he decided to see about improving them using 3D-printed compliant mechanisms.

For the uninitiated, harmonic drives, also known as strain-wave gears, are a compact, high-torque gearbox that has become popular with “robotic dog” makers and other roboticists. The idea is to have a rigid, internally-toothed outer ring nested around an externally-toothed, flexible cup. A wave generator rotates within the inside cup, stretching it so that it meshes with the outer ring. The two gears differ by only a couple of teeth, meaning that very high gear ratios can be achieved, which makes them great for the joints of robot legs.

[Levi]’s problem with the harmonic drive is that due to the depth of the flexible spline cup, compactness is not among its virtues. His idea is to couple the flex spline to the output of the drive through a flat spring, one that allows flexion as the wave generator rotates but transmits torque efficiently. The entire prototype is 3D-printed, except for the wave generator bearings and stepper motor, and put to the test.

As the video below shows after the excellent introduction to harmonic drives, the concept works, but it’s not without its limitations. Even lightly loaded, the drive made some unpleasant crunching sounds as the PLA springs gave out. We could easily see that being replaced with, say, a steel spring, either machined or cut on a water-jet machine. That might solve the most obvious problem and make [Levi]’s dream of a compact harmonic drive a reality. Of course, we have seen pretty compact strain-wave gears before.

Continue reading “Harmonic Drive Uses Compliant Mechanism To Slim Down”