Custom Music Box Cylinder Puts A Spin On Romance

Music boxes are awesome little mechanical devices. These days, they even make some with slightly more modern tunes, like the Zelda and Star Wars themes.  But they don’t have everything, of course — certainly not that one song from that TV series that [RandomPrototypes]’ girlfriend absolutely adores.

But it’s 2021, and there are options for making your own music box. [RandomPrototypes] could have printed the whole thing, but those don’t sound as good with their plastic combs. Then there’s those paper punch ones, but you have to sit there and crank the thing continuously to hear the song. In the end, [RandomPrototypes] mixed methods and made a custom cylinder that’s playable with a standard music box mechanism.

[RandomPrototypes] started by taking the music box apart to measure the cylinder, and then created a software representation of a cylinder that’s designed to pluck the eighteen notes from low to high rather than play a song. Then he used a Python script to turn it in a 3D model. The slicing preview showed a lot of stops and starts and weak points, so [RandomPrototypes] generated the Gcode directly so that it would print in one continuous spiral and be much stronger.

In order to generate a cylinder with the song his girlfriend likes so much, [RandomPrototypes] printed this scale cylinder and used it to record the notes as a single mp3 and make note of the start times of each note. Finally, he built the new score based on the available notes built into the music box comb. If you want to do this yourself, the code is freely available. The hard part will be choosing a music box mechanism, because they tend to come with a single comb that’s designed to play a specific song. You’ll have to figure out which tune has most or all of the notes you need.

If you don’t mind doing the cranking to listen to the tune, then the paper-punched type of music box is going to be much easier. But why do all that punching yourself, when you could build a machine?

Continue reading “Custom Music Box Cylinder Puts A Spin On Romance”

Python Runs Through A Zombified 8-Bit AVR

As amazing as CircuitPython is, it hasn’t yet been ported to any 8-bit microcontrollers. [Chris Heo] was unsatisfied with his inability to use Python on his 8-bit ATmega4808 AVR, so he worked out a way to zombify it and bend it to his will using Python on his PC.

The trick to making this all work is the UPDI interface: a single-wire UART interface for programming and debugging Microchip’s newer 8-bit AVR microcontrollers. UPDI reaches deep into the microcontroller’s core, allowing you to stop and start execution of microcontroller code and access all of the onboard data and I/O. [Chris] realized this could be used to stop execution of any code running on the AVR and directly control the output pins using the pyupdi library. Since UPDI lets him modify the AVR’s I/O registers, he was also able to blink an LED and use the microcontrollers UART to send a message back to his PC without compiling a single line of code.

This may seem like an entirely unnecessary hack, but for devices too small or basic to have a JTAG interface for debugging this could be the best way to test and debug peripherals in an assembled circuit. We hope this catches on and would love to see how much of the chip can be controlled in this way. Maybe this will make it easy to experiment with the programmable logic that’s on some of the newer AVRs.

Hackaday Links Column Banner

Hackaday Links: May 23, 2021

The epicenter of the Chinese electronics scene drew a lot of attention this week as a 70-story skyscraper started wobbling in exactly the way skyscrapers shouldn’t. The 1,000-ft (305-m) SEG Plaza tower in Shenzhen began its unexpected movements on Tuesday morning, causing a bit of a panic as people ran for their lives. With no earthquakes or severe weather events in the area, there’s no clear cause for the shaking, which was clearly visible from the outside of the building in some of the videos shot by brave souls on the sidewalks below. The preliminary investigation declared the building safe and blamed the shaking on a combination of wind, vibration from a subway line under the building, and a rapid change in outside temperature, all of which we’d suspect would have occurred at some point in the 21-year history of the building. Others are speculating that a Kármán vortex Street, an aerodynamic phenomenon that has been known to catastrophically impact structures before, could be to blame; this seems a bit more likely to us. Regardless, since the first ten floors of SEG Plaza are home to one of the larger electronics markets in Shenzhen, we hope this is resolved quickly and that all our friends there remain safe.

In other architectural news, perched atop Building 54 at the Massachusetts Institute of Technology campus in Cambridge for the last 55 years has been a large, fiberglass geodesic sphere, known simply as The Radome. It’s visible from all over campus, and beyond; we used to work in Kendall Square, and the golf-ball-like structure was an important landmark for navigating the complex streets of Cambridge. The Radome was originally used for experiments with weather radar, but fell out of use as the technology it helped invent moved on. That led to plans to remove the iconic structure, which consequently kicked off a “Save the Radome” campaign. The effort is being led by the students and faculty members of the MIT Radio Society, who have put the radome to good use over the years — it currently houses an amateur radio repeater, and the Radio Society uses the dish within it to conduct Earth-Moon-Earth (EME) microwave communications experiments. The students are serious — they applied for and received a $1.6-million grant from Amateur Radio Digital Communications (ARDC) to finance their efforts. The funds will be used to renovate the deteriorating structure.

Well, this looks like fun: Python on a graphing calculator. Texas Instruments has announced that their TI-84 Plus CE Python graphing calculator uses a modified version of CircuitPython. They’ve included seven modules, mostly related to math and time, but also a suite of TI-specific modules that interact with the calculator hardware. The Python version of the calculator doesn’t seem to be for sale in the US yet, although the UK site does have a few “where to buy” entries listed. It’ll be interesting to see the hacks that come from this when these are readily available.

Did you know that PCBWay, the prolific producer of cheap PCBs, also offers 3D-printing services too? We admit that we did not know that, and were therefore doubly surprised to learn that they also offer SLA resin printing. But what’s really surprising is the quality of their clear resin prints, at least the ones shown on this Twitter thread. As one commenter noted, these look more like machined acrylic than resin prints. Digging deeper into PCBWay’s offerings, which not only includes all kinds of 3D printing but CNC machining, sheet metal fabrication, and even injection molding services, it’s becoming harder and harder to justify keeping those capabilities in-house, even for the home gamer. Although with what we’ve learned about supply chain fragility over the last year, we don’t want to give up the ability to make parts locally just yet.

And finally, how well-calibrated are your fingers? If they’re just right, perhaps you can put them to use for quick and dirty RF power measurements. And this is really quick and really dirty, as well as potentially really painful. It comes by way of amateur radio operator VK3YE, who simply uses a resistive dummy load connected to a transmitter and his fingers to monitor the heat generated while keying up the radio. He times how long it takes to not be able to tolerate the pain anymore, plots that against the power used, and comes up with a rough calibration curve that lets him measure the output of an unknown signal. It’s brilliantly janky, but given some of the burns we’ve suffered accidentally while pursuing this hobby, we’d just as soon find another way to measure RF power.

Simple GUI Menus In Micropython

Love ’em or hate ’em, sometimes your embedded project needs a menu system. Rather than reimplement things each and every time, [sgall17a] put together a simple GUI menu system in Micropython that can be reused in all sorts of projects. The approach uses tables to define the menus and actions, and the demo program comes with a pretty good assortment of examples. Getting up to speed using this module should be fairly easy.

The hardware that [sgall17a] chose to demonstrate the concept couldn’t have been much smaller — it’s a Raspberry Pi Pico development board, an OLED 128 x 64 pixel display, and a rotary encoder with built-in push-button switch (it’s also been tested on ESP32 and ESP8266 boards). The widget under control is one of the commonly available Neopixel development boards. The program is hosted on GitHub, but beware that it’s under development so there may be frequent updates.

This is a good approach to making menus, but is often rejected or not even considered because of the overhead cost of developing the infrastructure. Well, [sgall17a] has done the hard work already — if you have an embedded project requiring local user setup, check out this module.

Tetris For Game Boy Gets Online Multiplayer

Released in 1989, the Game Boy version of Tetris is notable for being the first game to support multiplayer via the so-called “Game Link Cable” accessory. So it’s fitting that, 32 years later, that same game is now playable with others over the Internet thanks to an open source USB adapter from [stacksmashing].

As explained in the video below, the adapter is essentially just a Raspberry Pi Pico paired with some level shifters so that it can talk to the Game Boy’s link port. That said, the custom PCB does implement some very clever edge connectors that let you plug it right into the Link Cable for the original “brick” Game Boy as well as the later Color and Advance variants. This keeps you from having to cut up a Link Cable just to get a male end, which is what [stacksmashing] had to do during the prototyping phase.

The DIY breadboard approach works as well.

Of course, the hardware is only one half of the equation. There’s also an open source software stack which includes a Python server and WebUSB frontend that handles communicating with the Game Boy and connecting players. While the original game only supported a two person head-to-head mode, the relatively simplistic nature of the multiplayer gameplay allowed [stacksmashing] to expand that to an arbitrary number of players with his code. The core rules haven’t changed, and each client Game Boy still thinks it’s in a two player match, but the web interface will show the progress of other players and who ends up on top at the end.

To be clear, this isn’t some transparent Link Cable to TCP/IP solution. While something like that could potentially be possible with the hardware, as of right now, the software [stacksmashing] has put together only works for Tetris. So if you want to battle Pokemon over the net, you’ll have to do your own reverse engineering (or at least wait for somebody else to inevitably do it).

The Link Cable port on the Game Boy, especially on the later versions of the hardware, is a surprisingly versatile interface capable of much more than just multiplayer gaming. While we’re certainly keen to see [stacksmashing] develop this project farther, we’re equally excited to see the non-gaming applications of such an easy to use computer interface for the iconic handheld.

Continue reading Tetris For Game Boy Gets Online Multiplayer”

Linux Fu: Mixing Bash And Python

Although bash scripts are regularly maligned, they do have a certain simplicity and ease of creation that makes them hard to resist. But sometimes you really need to do some heavy lifting in another language. I’ll talk about Python, but actually, you can use many different languages with this technique, although you might need a little adaptation, depending on your language of choice.

Of course, you don’t have to do anything special to call another program from a bash script. After all, that’s what it’s mainly used for: calling other programs. However, it isn’t very handy to have your script spread out over multiple files. They can get out of sync and if you want to send it to someone or another machine, you have to remember what to get. It is nicer to have everything in one file.

Continue reading “Linux Fu: Mixing Bash And Python”

This DIY Split-Flap Display Does Both Time And Weather

With little more than four economical stepper motors, a Raspberry Pi Zero, and a 3D printer, [Thomas Barlow] made himself an awfully slick Smart Flip Clock that can display not only the time, but also weather data as well. This is done by adding a few extra graphics to some of the split-flaps, so numbers can also be used to indicate temperature and weather conditions succinctly. Displaying the time has to do without a colon (so 5:18 displays as 518), but being able to show temperature and weather conditions more than makes up for it.

32 degrees and a mix of sun and cloud

According to the project’s GitHub repository, it looks as though each split-flap has thirteen unique positions. The first ten are for numerals 0 through 9, and the rest are either blank, or used to make up a few different weather icons with different combinations. A Python script runs on the Raspberry Pi and retrieves weather data from OpenWeather, and the GPIO header drives the display via four geared stepper motors and driver boards. The rest of the hardware is 3D printed, and [Thomas] helpfully provides CAD models in STEP format alongside the STL files.

The basic design of a split-flap display is really quite versatile, and enterprising hackers have been putting delightful new twists on them for years. There has been a split-flap display used as a kind of flip-book animation, and we’ve also had the pleasure of seeing an entire Tarot deck used for esoteric, automated readings.