Musical Motors, BLDC Edition

This should count as a hack: making music from a thing that should not sing. In this case, [SIROJU] is tickling the ivories with a Brushless DC motor, or BLDC. 

To listen to a performance, jump to 6:27 in the embedded video. This BLDC has a distinctly chip-tune like sound, not entirely unlike other projects that make music with stepper motors. Unlike most stepper-based instruments we’ve seen [SIROJU]’s BLDC isn’t turning as it sings. He’s just got it vibrating by manipulating the space vector modulation that drives the motor — he gets a response of about 10 kHz that way. Not CD-quality, no, but plenty for electronic music. He can even play chords of up to 7 notes at a time.

There’s no obvious reason he couldn’t embed the music into a proper motor-drive signal, and thus allow a drone to hum it’s own theme song as it hovers along. He’s certainly got the chops for it; if you haven’t seen [SIROJU]’s videos on BLDC drivers on YouTube, you should check out his channel. He’s got a lot of deep content about running these ubiquitous motors. Sure, we could have just linked to him showing you how to do FOC on an STM32, but “making it sing” is an expression for mastery in English, and a lot more fun besides.

There are other ways to make music with motors. If you know of any others, don’t hesitate to send us a tip.

Continue reading “Musical Motors, BLDC Edition”

What Is The Fourier Transform?

Over at Quanta Magazine [Shalma Wegsman] asks What Is the Fourier Transform?

[Shalma] begins by telling you a little about Joseph Fourier, the French mathematician with an interest in heat propagation who founded the field of harmonic analysis in the early 1800s.

Fourier’s basic insight was that you can represent everything as a sum of very basic oscillations, where the basic oscillations are sine or cosine functions with certain parameters. [Shalma] explains that the biology of our ear can do a similar thing by picking the various notes out from a tune which is heard, but mathematicians and programmers work without the benefit of evolved resonant hairs and bone, they work with math and code.

[Shalma] explains how frequency components can be discovered by trial and error, multiplying candidate frequencies with the original function to see if there are large peaks, indicating the frequency is a component, or if the variations average to zero, indicating the frequency is not a component. [Shalma] tells how even square waves can be modeled with an infinite set of frequencies known as the Fourier series.

Taking a look at higher-dimensional problems [Shalma] mentions how Fourier transforms can be used for graphical compression by dropping the high frequency detail which our eyes can barely perceive anyway. [Shalma] gives us a fascinating look at the 64 graphical building blocks which can be combined to create any possible 8×8 image.

[Shalma] then mentions James Cooley and John Tukey and the development of the Fast Fourier Transform in the 1960s. This mathematical tool has been employed to study the tides, to detect gravitational waves, to develop radar and magnetic resonance imaging, and to support signal processing and data compression. Even quantum mechanics finds use for harmonic analysis, and [Shalma] explains how it relates to the uncertainty principle. The Fourier transform has spread through pure mathematics and into number theory, too.

[Shalma] closes with a quote from Charles Fefferman: “If people didn’t know about the Fourier transform, I don’t know what percent of math would then disappear, but it would be a big percent.”

If you’re interested in the Fourier transform and want to dive deeper we would encourage you to read The Fastest Fourier Transform In The West and Even Faster Fourier Transforms On The Raspbery Pi Zero.

Header image: Joseph Fourier, Attributed to Pierre-Claude Gautherot, Public domain.

Running Code On A PAX Credit Card Payment Machine

The PAX D177 PoS terminal helpfully tells you which tamper points got triggered. (Credit: Lucas Teske)
The PAX D177 PoS terminal helpfully tells you which tamper points got triggered. (Credit: Lucas Teske)

These days Points of Sale (PoS) usually include a digital payment terminal of some description, some of which are positively small, such as the Mini PoS terminals that PAX sells. Of course, since it has a CPU and a screen it must be hacked to run something else, and maybe discover something fun about the hardware in the process. Thus [Lucas Tuske] set out to do exactly this with a PAX D177 PoS, starting with purchasing three units: one to tear apart, one to bypass tamper protections on and one to keep as intact reference.

As expected, there are a few tamper protections in place, starting with pads that detect when the back cover is removed and a PCB that’s densely covered in fine traces to prevent sneaky drilling. Although tripping the tamper protections does not seem to affect the contents of the Flash, the firmware is signed. Furthermore the secrets like keys that are stored in NVRAM are purged, rendering the device effectively useless to any attacker.

The SoC that forms the brains of the whole operations is the relatively obscure MH1903, which is made by MegaHunt and comes in a dizzying number of variants that are found in applications like these PoS terminals. Fortunately the same SoC is also found on a development board with the AIR105 MCU that turns out to feature the same MH1903 core. These are ARM Cortex-M3 cores, which makes targeting them somewhat easier.

Rather than try to break the secure boot of the existing SoC, [Lucas] opted to replace the SoC package with a brand new one, which was its own adventure. Although one could say that this is cheating, it made getting a PoC of custom code running on one of these devices significantly easier. In a foll0w-up article [Lucas] expects to have Doom running on this device before long.

A Breadboard Computer In Three Chips

Building a computer on a breadboard is a seminal project for many builders, but it can become complicated quite quickly, not to mention that all the parts needed for a computer are being placed on a medium which often lends itself to loose wires and other hardware bugs. [3DSage] has a working breadboard computer that is as simple as it can possibly be, putting it together piece by piece to show exactly what’s needed to get a computer which can count, access memory, and even perform basic mathematical operations.

The first step for any computer is to build a clock, and in this case it’s being provided by a 555 timer which is configured to provide an adjustable time standard and which steps through the clock pulses when a button is pressed. The next piece is a four-bit counter and a memory chip, which lets the computer read and write data. A set of DIP switches allows a user to write data to memory, and by using the last three bits of the data as opcodes, the computer can reset, halt, and jump to various points in a simple program.

Although these three chips make it possible to perform basic programming, [3DSage] takes this a bit further in his video by demonstrating some other simple programs, such as one which can play music or behave as an alarm clock. He also shows how to use a fourth chip in the form of a binary adder to perform some basic math, and then packages it all into a retro-styled computer kit. Of course you can take these principles and build them out as far as they will go, like this full 8-bit computer built on a breadboard or even this breadboard computer that hosts a 486.

Continue reading “A Breadboard Computer In Three Chips”

Inside and outside the Contrib Cal.

Reify Your GitHub Commit History With Contrib Cal

Over on Instructables, [Logan Fouts] shows us the Contrib Cal GitHub desk gadget. This build will allow you to sport your recent GitHub commit activity on your wall or desk with an attractive diffuse light display backed by a 7×4 matrix of multicolor LEDs. Motivate yourself and impress your peers!

This humble project is at the same time multifaceted. You will build a case with 3D printing, make a diffuse screen by gluing and cutting, design a LED matrix PCB using KiCad, solder everything together, and then program it all with Python. The brains of the operation are a Raspberry Pi Zero W.

The Instructables article will run you through the required supplies, help you to print the case, explain how to solder the LEDs, tell how to install the heat-set inserts for high quality screw attachments, explain wiring and power, tell you about how to use the various screws, then tell you about where to get more info and the required software on GitHub: Contrib Cal v2.

Of course this diffuse LED matrix is only one way to display your GitHub progress, you can also Track Your GitHub Activity With This E-Ink Display.

Hackaday Podcast Episode 337: Homebrew Inductors, Teletypes In The Bedroom, And Action!

Fresh hacks here! Get your fresh hot hacks right here! Elliot and Dan teamed up this week to go through every story published on our pages to find the best of the best, the cream of the crop, and serve them up hot and fresh for you. The news this week was all from space, with the ISS getting its latest push from Dragon, plus <<checks notes>> oh yeah, life on Mars. Well, maybe, but it’s looking more and more like we are not alone, or at least not a few million years ago.

But even if we are, plenty is still going on down here to keep you interested. Like homebrewing? Good, because we looked at DIY inductors, wire nuts, and even a dope — but nope — ultralight helicopter. Into retro? We’ve got you covered with a loving look at IRC, a 60s bedside computer guaranteed to end your marriage, and a look at the best 8-bit language you never heard of.

We looked at a rescued fume hood, sensors galore on your phone, a rug that should have — and did, kind of — use a 555, and raytracing for the rest of your natural life. As for “Can’t Miss Articles,” Elliot could barely contain himself with the bounty of projects written up by our Hackaday writers, not to mention Arya’s deep dive into putting GPS modules to work in your builds.

Download this MP3, full of twisty little podcasts, all alike. Plugh!

Continue reading “Hackaday Podcast Episode 337: Homebrew Inductors, Teletypes In The Bedroom, And Action!”

This Week In Security: NPM, Kerbroasting, And The Rest Of The Story

Two billion downloads per week. That’s the download totals for the NPM packages compromised in a supply-chain attack this week. Ninety-nine percent of the cloud depends on one of the packages, and one-in-ten cloud environments actually included malicious code as a result of the hack. Take a moment to ponder that. In a rough estimate, ten percent of the Internet was pwned by a single attack.

What extremely sophisticated technique was used to pull off such an attack? A convincing-looking phishing email sent from the newly registered npmjs.help domain. [qix] is the single developer of many of these packages, and in the midst of a stressful week, fell for the scam. We could refer to the obligatory XKCD 2347 here. It’s a significant problem with the NPM model that a single developer falling for a phishing email can expose the entire Internet to such risk. Continue reading “This Week In Security: NPM, Kerbroasting, And The Rest Of The Story”