There are many practical applications for a Raspberry Pi Pico microcontroller board, but it’s important to have a heap of fun too! With his latest project, Tom Verbeure has literally had a ball, creating a NeoPixel-covered sphere that dazzles in more ways than one.

After all, as Tom says: “LED cubes have been pretty popular, but spheres are a much harder problem, mechanically.”

The idea for the project followed a friendly chat. “I was having a lunchtime discussion at work with my friend, Jens, a 3D printing wizard, about doing things with LEDs that hasn’t really been done before,” Tom recalls. After ordering a 3D printer – “and wanting to use it for something more than printing out an Iron Man helmet or a vase” – he put a plan into action. “One of my biggest requirements from the start was a lot of LEDs.”

Bouncing ideas

By the time he got started, other makers were creating something similar. Jiří Praus unveiled his Freeform LED Sphere (“but it’s constructed out of differently sized rings around a central axis, which I didn’t want”) and Whity created the Geodesic(k) RGB LED Spheres (“but 180 LEDs, and the LED density was too low because he used premade WS2812B PCBs”).

With research, he learned that it’s mathematically impossible to distribute points uniformly across a sphere, but there were techniques which came close. “I loosened the requirement of uniform LED distribution somewhat and chose an icosahedron as the core internal structure,” he says. “Its 20 axes of symmetry is sufficiently high.

“I also came to the conclusion that through-hole LEDs were the way to go if you want the surface of the sphere to be truly curved. You can adjust the length from the LED core to the PCB for each LED individually.” He then spent more than a month using FreeCAD to come up with potential design ideas, starting with a central lattice made out of hollow triangles on which 20 PCBs and 20 triangular sphere elements were mounted separately.

On a roll

Printing and assembly issues caused a rethink. “The breakthrough came when I dropped the central frame, inserted LEDs from the outside into the shell, and mounted the PCBs firmly against the inside shell triangle,” Tom explains. “I used magnets on each triangle side to form a self-supported structure. The more sphere elements snap together, the sturdier it becomes.”

Eventually, he switched from FreeCAD’s GUI to its embedded Python engine. He also settled on 21 LEDs for each of the 20 sphere elements, designing a custom controller PCB on which to mount them. A Raspberry Pi Pico formed the project’s heart and Tom initially coded the project using MicroPython, later transitioning to regular C.

“I needed something that was small, didn’t require a lot of power, had a lot of performance, was close to the metal, had the ability to drive WS2812 LEDs, and had very good documentation and examples,” Tom notes. “The Raspberry Pico scored high on all those points.”

The result is impressive. “The LEDs are not just a part of a sphere element, but part of the whole sphere, with a unique (x,y,z) coordinate assigned to it,” Tom says. It’s also battery-operated, making it entirely mobile.

Tom has enjoyed the process so much, he’s on a roll, continuing to make improvements. “Right now, I’m dealing with a fair bit of instability due to loose wires,” he says. “If I were to do this again, I’d probably use JST connectors instead of plain vanilla pin headers and connectors, because they make a very reliable link.”

From The MagPi store

Subscribe