Smallest USB Device… So Far

For better or worse it seems to be human nature to compete with one another, as individuals or teams, rather than experience contentedness while moving to the woods and admiring nature Thoreau-style. On the plus side, competition often results in benefits for all of us, driving down costs for everything from agriculture to medical care to technology. Although perhaps a niche area of competition, the realm of “smallest USB device” seems to have a new champion: this PCB built by [Emma] that’s barely larger than the USB connector pads themselves.

With one side hosting the pads to make contact with a standard USB type-A connector, the other side’s real estate is taken up by a tiny STM32 microcontroller, four phototransistors that can arm or disarm the microcontroller, and a tiny voltage regulator that drops the 5V provided by the USB port to the 3.3V the STM32 needs to operate. This is an impressive amount of computing power for less than three millimeters of vertical space, and can operate as a HID device with a wide variety of possible use cases.

Perhaps the most obvious thing to do with a device like this would be to build a more stealthy version of this handy tool to manage micromanagers, but there are certainly other tasks that a tiny HID can be put to use towards. And, as far as the smallest USB device competition goes, we’d also note that USB-A is not the smallest connector available and, therefore, the competition still has some potential if someone can figure out how to do something similar with an even smaller USB connector.

Thanks to [JohnU] for the tip!

Fluid Simulation Pendant Teaches Lessons In Miniaturization

Some projects seem to take on a life of their own. You get an idea, design and prototype it, finally build the thing and — it’s good, but it’s not quite right. Back to the drawing board, version 2, still not perfect, lather, rinse, repeat. Pretty soon you look around to discover that you’ve built ten of them. Oops.

That seems to be the arc followed by [mitxela] with this very cool fluid simulation pendant. The idea is simple enough; create a piece of jewelry with a matrix of tiny LEDs that act like the pendant is full of liquid, sloshing about with the slightest movement. In practice, though, this project was filled with challenges. Surprisingly, [mitxela] doesn’t seem to number getting a fluid dynamics simulation running on a microcontroller among those problems, at least not to a great degree. Rather, the LED matrix seemed to cause the most problems, both in terms of laying it out on the 25-mm diameter PCB and how to address the LEDs with relatively limited GPIO on the STM32 microcontroller. The solution to both was diagonal charlieplexing, which reduces the number of vias needed for the 216-LED matrix and allows the 0402 to be densely packed, along with providing some tolerance for solder bridging.

And then there’s the metalworking heroics, which no [mitxela] project would be complete without. This seems to be where a lot of the revisions come from, as the gold-plated brass case kept not quite living up to expectations. The final version is a brass cup containing the LiR2450 rechargeable battery, a magnetic charging connector, and the main PCB, all sealed by a watch crystal. The fluid simulation is quite realistic and very responsive to the pendant’s position. The video below shows it in action along with a summary of the build.

If you want to catch up on [mitxela]’s back catalog of miniaturized builds, start with his amazing industrial ear adornments or these tiny matrix earrings. We’re also fond of his incredible shrinking MIDI builds. Continue reading “Fluid Simulation Pendant Teaches Lessons In Miniaturization”

Custom built RGB laser firing beam

Lasers, Galvos, Action: A Quest For Laser Mastery

If you’re into hacking hardware and bending light to your will, [Shoaib Mustafa]’s latest project is bound to spike your curiosity. Combining lasers to project multi-colored beams onto a screen is ambitious enough, but doing it with a galvanomirror, STM32 microcontroller, and mostly scratch-built components? That’s next-level tinkering. This project isn’t just a feast for the eyes—it’s a adventure of control algorithms, hardware hacks, and the occasional ‘oops, that didn’t work.’ You can follow [Shoaib]’s build log and join the journey here.

The nitty-gritty is where it gets fascinating. Shoaib digs into STM32 Timers, explaining how modes like Timer, Counter, and PWM are leveraged for precise control. From adjusting laser intensity to syncing galvos for projection, every component is tuned for maximum flexibility. Need lasers aligned? Enter spectrometry and optical diffusers for precision wavelength management. Want real-time tweaks? A Python-controlled GUI handles the instruments while keeping the setup minimalist. This isn’t just a DIY build—it’s a work of art in problem-solving, with successes like a working simulation and implemented algorithms along the way.

If laser projection or STM32 wizardry excites you, this build will inspire. We featured a similar project by [Ben] back in September, and if you dig deep into our archives, you can eat your heart out on decades of laser projector projects. Explore Shoaib’s complete log on Hackaday.io. It is—literally—hacking at its most brilliant.

Ethernet From First Principles

For someone programming in a high-level language like Python, or even for people who interact primarily with their operating system and the software running on it, it can seem like the computer hardware is largely divorced from the work. Yes, the computer has to be physically present to do something like write a Hackaday article, but most of us will not understand the Assembly language, machine code, or transistor layout well enough to build up to what makes a browser run. [Francis Stokes] is a different breed, though, continually probing these mysterious low-level regions of our computerized world where he was recently able to send an Ethernet packet from scratch.

Continue reading “Ethernet From First Principles”

Running Game Boy Games On STM32 MCUs Is Peanuts

Using a STM32F429 Discovery board [Jan Zwiener] put together a Game Boy-compatible system called STM32Boy. It is based around the Peanut-GB Game Boy emulator core, which is a pretty nifty and fast single-header GB emulator library in C99. Considering that the average 32-bit MCU these days is significantly faster than the ~4 MHz  8-bit Sharp SM83 (Intel 8080/Zilog Z80 hybrid) in the original Game Boy it’s probably no surprise that the STM32F429 (up to 180 MHz) can emulate this 8-bit SoC just fine.

Since Peanut-GB is a library, the developer using it is expected to provide their own routines to read and write RAM and ROM and to handle errors. Optional are the line drawing, audio read/write and serial Tx/Rx functions, with the library providing reset and a host of other utility functions. Audio functionality is provided externally, such as using the provided MiniGB APU. Although fast, it comes with a range of caveats that limit compatibility and accuracy.

For STM32Boy, [Jan] uses the LCD screen that’s on the STM32 development board to render the screen on, along with a Game Boy skin. The LCD’s touch feature is then used for the controls, as can be elucidated from the main source file. Of note is that the target GB ROM is directly compiled into the firmware image rather than provided via an external SD card. This involves using the xxd tool to create a hex version of the ROM image that can be included. Not a bad way to get a PoC up and running, but we imagine that if you want to create a more usable GB-like system it should at least be able to play more than one game without having to reflash the MCU.

Doing 1080p Video, Sort Of, On The STM32 Microcontroller

When you think 1080p video, you probably don’t think STM32 microcontroller. And yet! [Gabriel Cséfalvay] has pulled off just that through the creative use of on-chip peripherals. Sort of.

The build is based around the STM32L4P5—far from the hottest chip in the world. Depending on the exact part you pick, it offers 512 KB or 1 Mbyte of flash memory, 320 KB of SRAM, and runs at 120 MHz. Not bad, but not stellar.

Still, [Gabriel] was able to push 1080p at a sort of half resolution. Basically, the chip is generating a 1080p widescreen RGB VGA signal. However, to get around the limited RAM of the chip, [Gabriel] had to implement a hack—basically, every pixel is RAM rendered as 2×2 pixels to make up the full-sized display. At this stage, true 1080p looks achievable, but it’ll be a further challenge to properly fit it into memory.

Output hardware is minimal. One pin puts out the HSYNC signal, another handles VSYNC. The same pixel data is clocked out over R, G, and B signals, making all the pixels either white or black. Clocking out the data is handled by a nifty combination of the onboard DMA functionality and the OCTOSPI hardware. This enables the chip to hit the necessary data rate to generate such a high-resolution display.

There’s more work to be done, but it’s neat to see [Gabriel] get even this far with such limited hardware. We’ve seen others theorize similar feats on chips like the RP2040 in the Pi Pico, too. Video after the break.

Continue reading “Doing 1080p Video, Sort Of, On The STM32 Microcontroller”

screenshot of the code defining a hid descriptor by using essentially macros for common descriptor types

Coupling STM32 And Linux? Consider HID Over I2C

If you’re pairing a tiny Linux computer to a few peripherals — perhaps you’re building a reasonably custom Pi-powered device — it’s rightfully tempting to use something like an STM32 for all your low-level tasks, from power management to reading keyboard events.

Now, in case you were wondering how to tie the two together, consider HID over I2C, it’s a standardized protocol with wide software and peripheral support, easily implementable and low-power. What’s more, [benedekkupper] gives you an example STM32 project with a detailed explanation on how you too can benefit from the protocol.

There are several cool things about this project. For a start, its code is generic enough that it will port across the entire STM32 lineup nicely. Just change the pin definitions as needed, compile it, flash it onto your devboard and experiment away. Need to change the descriptors? The hid-rdf library used lets you define a custom descriptor super easily, none of that building a descriptor from scratch stuff, and it even does compile-time verification of the descriptor!

The project has been tested with a Raspberry Pi 400, and [benedekkupper] links a tutorial on quickly adding your I2C-HID device on an Linux platform; all you need is DeviceTree support. Wondering what’s possible with HID? We’ve seen hackers play with HID aplenty here, and hacking on the HID standard isn’t just for building keyboards. It can let you automate your smartphone, reuse a laptop touchpad or even a sizeable Wacom input surface, liberate extra buttons on gamepads, or build your own touchscreen display.