Fireplace in a jar

Published on: 29th August 2024

Tagged in picolights

The LED stars I wrote about last time aren’t the only LED lights I have. Last year’s shut-up-and-take-my-money moment ended up with a purchase of a brilliant Pimoroni Plasma Stick and a strip of regular LED lights. I then bought a glass jar from Ikea to house them and wondered what to do next.

Pimoroni Plasma circuit board
The Pimoroni Plasma Stick. It sits on a specially made cap and the cable is fed through a slot (you can see the glow inside).

For almost a year they’ve run one of the supplied demos that used various intensities of yellow to simulate fire. But I’ve now worked on a firefly routine; maybe I could modify that and make something new?

This time I wanted the LEDs to glow between red and yellow as well as change brightness over time. So the best way to describe the colours would be using HSV; hue, saturation and brightness. The hue values move through light wavelengths, or the colours of the rainbow if you prefer, so moving red-orange-yellow would be a simple matter of increasing and decreasing the value. The same would be true of the brightness, and I could vary that between 20% and 80% so the lights didn’t draw too much current overall. (The saturation would stay constant.)

The code generates random hue, brightness and increment (‘step’) values for each LED. With every loop through the LEDs, the hue and brightness change by their individual step values (positive or negative). If the hue or brightness values had reached the pre-defined limits, the step is multiplied by -1 to efectively reverse the steps so increment would become decrement and vice versa.

Now it’s working properly I’ll have to find a way to space the LEDs so they fill more of the jar rather than being lumped at the bottom.

Glowing red LED lights
The fireplace in action. It's cold though.

Gallery

Click to view larger versions.

Glowing red LED lights
Pimoroni Plasma circuit board