Quantum Random Number Generator Squirts Out Numbers Via MQTT

Sometimes you need random numbers — and properly random ones, at that. Hackaday Alum [Sean Boyce] whipped up a rig that serves up just that, tasty random bytes delivered fresh over MQTT.

[Sean] tells us he’s been “designing various quantum TRNGs for nearly 15 years as part of an elaborate practical joke” without further explanation. We won’t query as to why, and just examine the project itself. The main source of randomness — entropy, if you will — is a pair of transistors hooked up to create a bunch of avalanche noise that is apparently truly random, much like the zener diode method.

In any case, the noise from the transistors is then passed through a bunch of hex inverters and other supporting parts to shape the noise into a nicely random square wave. This is sampled by an ATtiny261A acting as a Von Neumann extractor, which converts the wave into individual bits of lovely random entropy. These are read by a Pi Pico W, which then assembles random bytes and pushes them out over MQTT.

Did that sound like a lot? If you’re not in the habit of building random number generators, it probably did. Nevertheless, we’ve heard from [Sean] on this topic before. Feel free to share your theories on the best random number generator designs below, or send your best builds straight to the tipsline. Randomly, of course!

From Good Enough To Best

It was probably Montesquieu who coined the proto-hacker motto “the best is the mortal enemy of the good”. He was talking about compromises in drafting national constitutions for nascent democracies, of course, but I’ll admit that I do hear his voice when I’m in get-it-done mode and start cutting corners on a project. A working project is better than a gold-plated one.

But what should I do, Monte, when good enough turns out to also be the mortal enemy of the best? I have a DIY coffee roaster that is limping along for years now on a blower box that uses a fan scavenged in anger from an old Dust Buster. Many months ago, I bought a speed-controllable and much snazzier brushless blower fan to replace it, that would solve a number of minor inconveniences with the current design, but which would also require some building and another dive into the crufty old firmware.

So far, I’ve had good enough luck that the roaster will break down from time to time, and I’ll use that as an excuse to fix that part of the system, and maybe even upgrade another as long as I have it apart. But for now, it’s running just fine. I mean, I have to turn the fan on manually, and the new one could be automatic. I have only one speed for the fan, and the new one would be variable. But the roaster roasts, and a constant source of coffee is mission critical in this house. The spice must flow!

Reflecting on this situation, it seems to me that the smart thing to do is work on smoothing the transitions from good enough to best. Like maybe I could prototype up the new fan box without taking the current one apart. Mock up some new driver code on the side while I’m at it?

Maybe Montesquieu was wrong, and the good and the best aren’t opposites after all. Maybe the good enough is just the first step on the path toward the best, and a wise man spends his energy on making the two meet in the middle, or making the transition from one to the other as painless as possible.

Digital Squid’s Behavior Shaped By Neural Network

In the 90s, a video game craze took over the youth of the world — but unlike today’s games that rely on powerful PCs or consoles, these were simple, standalone devices with monochrome screens, each home to a digital pet. Often clipped to a keychain, they could travel everywhere with their owner, which was ideal from the pet’s perspective since, like real animals, they needed attention around the clock. [ViciousSquid] is updating this 90s idea for the 20s with a digital pet squid that uses a neural network to shape its behavior.

The neural network that controls the squid’s behavior takes a large number of variables into account, including whether or not it’s hungry or sleepy, or if it sees food. The neural network adapts as different conditions are encountered, allowing the squid to make decisions and strengthen its algorithms. [ViciousSquid] is using a Hebbian learning algorithm which strengthens connections between neurons which activate often together. Additionally, the squid’s can form both short- and long-term memories, and the neural network can even form new neurons on its own as needed.

[ViciousSquid] is still working on this project, and hopes to eventually implement a management system in the future, allowing the various behavior variables to be tracked over time and overall allow it to act in a way more familiar to the 90s digital pets it’s modeled after. It’s an interesting and fun take on those games, though, and much of the code is available on GitHub for others to experiment with as well. For those looking for the original 90s games, head over to this project where an emulator for Tamagotchis was created using modern microcontroller platforms.

Amazing Oscilloscope Demo Scores The Win At Revision 2025

Classic demos from the demoscene are all about showing off one’s technical prowess, with a common side order of a slick banging soundtrack. That’s precisely what [BUS ERROR Collective] members [DJ_Level_3] and [Marv1994] delivered with their prize-winning Primer demo this week.

This demo is a grand example of so-called “oscilloscope music”—where two channels of audio are used to control an oscilloscope in X-Y mode. The sounds played determine the graphics on the screen, as we’ve explored previously.

The real magic is when you create very cool sounds that also draw very cool graphics on the oscilloscope. The Primer demo achieves this goal perfectly. Indeed, it’s intended as a “primer” on the very artform itself, starting out with some simple waveforms and quickly spiraling into a graphical wonderland of spinning shapes and morphing patterns, all to a sweet electronic soundtrack. It was created with a range of tools, including Osci-Render and apparently Ableton 11, and the recording performed on a gorgeous BK Precision Model 2120 oscilloscope in a nice shade of green.

If you think this demo is fully sick, you’re not alone. It took out first place in the Wild category at the Revision 2025 demo party, as well as the Crowd Favorite award. High praise indeed.

We love a good bit of demoscene magic around these parts.

Continue reading “Amazing Oscilloscope Demo Scores The Win At Revision 2025”

RP2040 Spins Right ‘Round Inside POV Display

Sometimes, a flat display just won’t cut it. If you’re looking for something a little rounder, perhaps your vision could persist in in looking at [lhm0]’s rotating LED sphere RP2040 POV display.

As you might have guessed from that title, this persistence-of-vision display uses an RP2040 microcontroller as its beating (or spinning, rather) heart. An optional ESP01 provides a web interface for control. Since the whole assembly is rotating at high RPM, rather than slot in dev boards (like Pi Pico) as is often seen, [lhm0] has made custom PCBs to hold the actual SMD chips. Power is wireless, because who wants to deal with slip rings when they do not have to?

The LED-bending jig is a neat hack-within-a-hack.

[lhm0] has also bucked the current trend for individually-addressable LEDs, opting instead to address individual through-hole RGB LEDs via a 24-bit shift-register. Through the clever use of interlacing, those 64 LEDs produce a 128 line display. [lhm0] designed and printed an LED-bending jig to aid mounting the through-hole LEDs to the board at a perfect 90 degree angle.

What really takes this project the extra mile is that [lhm0] has also produced a custom binary video/image format for his display, .rs64, to encode images and video at the 128×256 format his sphere displays. That’s on github,while a seperate library hosts the firmware and KiCad files for the display itself.

This is hardly the first POV display we’ve highlighted, though admittedly it isn’t the cheapest one. There are even other spherical displays, but none of them seem to have gone to the trouble of creating a file format.

If you want to see it in action and watch construction, the video is embedded below.

Continue reading “RP2040 Spins Right ‘Round Inside POV Display”

Hash Functions With The Golden Ratio

In the realm of computer science, it’s hard to go too far without encountering hashing or hash functions. The concept appears throughout security, from encryption to password storage to crypto, and more generally whenever large or complex data must be efficiently mapped to a smaller, fixed-size set. Hashing makes the process of looking for data much faster for a computer than performing a search and can be incredibly powerful when mastered. [Malte] did some investigation into hash functions and seems to have found a method called Fibonacci hashing that not only seems to have been largely forgotten but which speeds up this lookup process even further.

In a typical hashing operation, the data is transformed in some way, with part of this new value used to store it in a specific location. That second step is often done with an integer modulo function. But the problem with any hashing operation is that two different pieces of data end up with the same value after the modulo operation is performed, resulting in these two different pieces of data being placed at the same point. The Fibonacci hash, on the other hand, uses the golden ratio rather than the modulo function to map the final location of the data, resulting in many fewer instances of collisions like these while also being much faster. It also appears to do a better job of using the smaller fixed-size set more evenly as a consequence of being based around Fibonacci numbers, just as long as the input data doesn’t have a large number of Fibonacci numbers themselves.

Going through the math that [Malte] goes over in his paper shows that, at least as far as performing the mapping part of a hash function, the Fibonacci hash performs much better than integer modulo. Some of the comments mention that it’s a specific type of a more general method called multiplicative hashing. For those using hash functions in their code it might be worth taking a look at either way, and [Malte] admits to not knowing everything about this branch of computer science as well but still goes into an incredible amount of depth about this specific method. If you’re more of a newcomer to this topic, take a look at this person who put an enormous bounty on a bitcoin wallet which shows why reverse-hashing is so hard.

XOR Gate As A Frequency Doubler

[IMSAI Guy] grabbed an obsolete XOR gate and tried a classic circuit to turn it into a frequency doubler. Of course, being an old part, it won’t work at very high frequencies, but the circuit is super simple, just using the gate and an RC network. You can see a video of his exploration below.

The simple circuit seems like it should work, but in practice, it needed an extra component. In theory, the RC circuit acts as an edge detector. So, each edge of the input signal causes a pulse on the output as the second input lags the first.

Continue reading “XOR Gate As A Frequency Doubler”