The Digital Lava Lamp

A lava lamp is fundamentally simple: it is a glass envelope, containing a watery fluid and a chunk of brightly-colored wax, resting on a base enclosing an incandescent light bulb.* The light bulb serves two purposes: it lights the glass envelope, and it also heats the wax, causing the wax to both soften and expand – making it buoyant. The result: a trippy slow-motion dance of colorful wax bubbles rising and falling.

There are some problems with the traditional lava lamp though…

1) The temperature of the wax is governed entirely by the waste heat of the lamp. If it was designed for a 25W light bulb, then a 15W light bulb may not get hot enough to do anything at all, and a 35W light bulb may get so hot that the wax doesn’t turn into large slow beautiful bouncing balls of color – it first becomes a veritable snow-globe of tiny wax droplets, and eventually becomes so hot that the wax just floats to the top and stays there.

2) Even if a light bulb of the correct wattage is used, the ambient room temperature also plays a factor, so the light show might not live up to expectations in cold or hot rooms.

3) Because the light bulb is in a small enclosed base, its temperature becomes much hotter than the normal working temperature that the bulb was originally designed for. Result: its lifespan is shortened considerably, and the lava lamp as a whole sits unused, waiting for the light bulb to be changed.

4) Because there’s no direct connection between the light bulb and the lava lamp’s glass envelope, it can take a very long time for the wax to heat up enough to start its magic dance.

5) Since the lava lamp essentially relies on the waste heat of an inefficient incandescent lamp, and since incandescent lamps are going the way of the dodo, it sure seems like newer and more appropriate tech is about due.

This particular lamp was my daughter’s – a prize for outstanding performance at the neighborhood Dave and Buster’s. After collecting dust for some years, I decided it was time for an upgrade. My original plan was:

  • Resistive heating to get the wax in molten motion
  • Temperature sensors to maintain optimum trippiness
  • Four high-output RGB LEDs in a slowly-changing rainbow of hues to heighten the hippie experience

Hardware

The microcontroller at the heart of this project is an STM32L4 MCU. This is a really simple project, so I don’t have much to say about the MCU. I wired so that I would have the option of using a PWM channel to control the power to the heating element, but even this turned out to be design overkill.

I originally intended to use banks of 100-ohm 3W resistors wired in parallel to generate the heat required for the lamp. This turned out to be bulky and unwieldy. Instead, I wrapped the base of the glass envelope in a single turn of #32 Nichrome wire. I embedded the Nichrome in a bead of nonconductive thermal grease, and then encased that in a larger bead of high-temp-rated silicone adhesive. An NFET and a 24VDC supply finished the job nicely.

For the temperature sensing, I chose a simple thermistor mounted to thruholes on the PCB. I left the thermistor on its 1” wire leads to raise it above the board so it would contact the glass of the lava lamp. This worked out perfectly as well.

I added four serially addressable RGB LEDs to finish the job. This was overkill, but I have lots of these LEDs lying around, so it was easy to drop them into the layout, and the firmware was also a simple drop-in.

Even with the change from parallel resistor arrays to NiChrome, this was a simple project. The CAD took only a few hours, and assembly was an easy weekend project. I even went a little overboard and profiled the temperature readings with ST’s monitoring tools. This was a fun exercise.

*Footnote: No self-respecting engineer with training in illumination would refer to the replaceable illuminating component as a “light bulb.” The thing you call a “bulb” is professionally referred to as a “lamp”. The thing you probably call a “lamp” is professionally referred to as a “fixture.” However, that complicates things because the overall term “lava lamp” is in wide use, and speaking about the lamp inside the lava lamp could cause confusion. Hence, for this post only… “light bulb.”