A better Geiger-Müller mood lamp (v2)

Somewhere in 2010, John Iovine published an interesting concept for a Geiger-Müller lamp that changed color in response to high-energy particles hitting a specialized sensor at the heart of the device. The idea of combining home decor with a doomsday warning system has some obvious appeal, so I decided to create my own, much-improved design.

You are welcome to reuse this circuit, but please keep in mind that the project deals with high voltage. You can get a mean shock, or worse - so proceed with caution.

1. What are GM tubes, anyway?

A Geiger-Müller tube is a fairly simple device consisting of two electrodes separated by noble gas; under normal conditions, the tube does not conduct direct current, and its electrical characteristics are essentially identical to a picofarad capacitor.

The interesting part happens once the electrodes are charged to a sufficiently high voltage, and the gas in between is struck and momentarily ionized by a high-energy particle - be it from terrestrial sources of radioactivity or from outer space. This creates a conductive plasma pathway inside the tube, allowing some current to flow for a brief moment and producing a marked drop in the voltage across the terminals - an effect that can be measured with some external circuitry:

All right, but where to get such a device to begin with? Well, if you are willing to part with $100, brand new GM tubes can be bought from manufacturers such as LND Inc. Luckily for us, though, there's also plenty of surplus tubes dating back to the Cold War, sourced both from former USSR countries and from the US Civil Defense stockpiles. The tube I am using in my design is used Russian SBM-20; it's fairly sensitive, easy to find, and very cheap. You can find it on eBay for about $20.

2. Inverter circuit

My design relies on a salvaged "wall wart" charger capable of delivering around 2 A at 5 VDC; you probably have one laying around, but if not, they are usually available for around $5 or so. Replacement chargers for Android tablets would do just fine.

Alas, most GM tubes need to be supplied with something between 500 and 900 V to operate properly, depending on the model. To deal with this problem, I used a simple, intentionally underpowered Royer topology inverter that can deliver microamp-range currents at few hundred volts:

In essence, there are two general-purpose NPN transistors wired so that they can create opposing magnetic fields in a transformer. When one of them conducts, the reverse current induced in the feedback winding eventually pulls the base of this transistor toward ground, and pushes the other one up; this changes the direction of the field and makes the process repeat again, producing alternating current in the secondary.

The transformer used here is Coilcraft FL2015-4L, but almost any miniature CCFL transformer with a similar topology should do. Be sure to observe the polarity of windings - otherwise, the circuit won't oscillate.

The 22 Ω resistor must be rated for at least 1 W and its value must be exact; changing its resistance will adjust the output voltage and current, which makes sense only when using other transformers, GM tubes, or other power supplies. The remaining transistors, resistors, and capacitors can be substituted freely; in particular, other general-purpose NPN transistors such as 2N3904 should work just fine. The capacitor next to the transformer should be MLCC - do not use electrolytics.

3. The HV side

The inverter circuit outputs AC signal with a frequency of around 70 kHz and peak-to-peak voltage somewhere between 700 and 800 V. Alas, alternating current won't do: the tube requires a steady DC voltage to operate. So, we need a simple circuit on the HV side, too:

The leftmost capacitor and a diode form a clamper, which adds a DC offset to the AC signal. The offset signal is then used to charge the next capacitor to form DC output. The tube is placed between this capacitor and the ground, in series with a 4.7 MΩ resistor; the purpose of this resistor is to prevent excess current from flowing through the gas. This value works for SBM-20; manufacturers of other types of GM tubes may recommend different resistances in their datasheets.

Last but not least, the 470 Ω resistor and a picofarad capacitor sitting between the negative lead of the tube and ground form a sensing circuit: any current flowing through the tube will induce a small, safe voltage across the terminals of the resistor, lasting several nanoseconds. The capacitor is there to stretch that pulse to roughly 200 ns, an interval that can be more reliably detected by the MCU:

The values for the components are not critical. The first two capacitors should be rated for 500 V or more, while the diodes need to have a reverse breakdown voltage over 800 V and reverse leakage current not higher than 5 µA.

With the circuit assembled, the voltage across the terminals of the tube should measure around 500 V, with the losses attributable mostly to diode leakage currents. If the reading is off by more than 50 V or so, it may be necessary to substitute the 22 Ω resistor in the inverter with something else.

4. Logic and LEDs

The lamp uses matched high-intensity red, green, and blue LEDs to smoothly cycle through a spectrum of eight possible colors. The colors change in response to GM tube events; a separate white LED flashes briefly to provide a more readable reading, too.

A low-cost ATmega48P MCU sits at the heart of the LED circuit and drives the LEDs through an array of Darlington transistors (ULN2003A); several capacitors and resistors are used to achieve soft switching for color LEDs:

The 1 uF capacitor should be ceramic and placed close to the MCU; the circuit will probably work fine without it, but especially in noisy applications next to a high-voltage inverter, it's just good hygiene.

Be sure to maintain some separation between the high-voltage side and this circuit; an accidental short or arcing between wires that are less than 1 mm apart is enough to destroy many of the more fragile semiconductors.

Current-limiting resistors for the LEDs need to be selected based on their voltage drop and operating current; any online calculator, such as this one, should do the trick. There is some voltage drop across ULN2003A - around 1.2 V or so - and this needs to be subtracted from the nominal supply voltage of 5 V. Keep in mind that the chip is rated for no more than 500 mA per channel - and requires a heat sink when pushed to its limits.

The MCU runs a fairly simple program, essentially re-implementing the 74HC series logic used in my original design, but with several tweaks:

#define F_CPU 8000000UL #include <avr/io.h> #include <avr/interrupt.h> #include <util/delay.h> /************************** * User-friendly typedefs * **************************/ typedef int8_t s8; typedef uint8_t u8; typedef int16_t s16; typedef uint16_t u16; typedef int32_t s32; typedef uint32_t u32; /************** * MCU pinout * **************/ #define B_TUBE 0 /* GM tube event input */ #define C_RED 0 /* Red LED */ #define C_GREEN 1 /* Green LED */ #define C_BLUE 2 /* Blue LED */ #define C_WHITE 3 /* White LED */ /*********** * Globals * ***********/ u8 cycle_count, /* Busy loop cycle counter */ current_pattern, /* Current color pattern */ turn_off_cnt; /* Counter to turn off white LED */ volatile u8 event_detected; /* GM event, set via interrupt */ /*************** * Entry point * ***************/ int main() { CLKPR = _BV(CLKPCE); /* Enable clock prescaler change */ CLKPR = 0b00000000; /* Clock prescaler: 1 (8 MHz) */ PCMSK0 = _BV(PCINT0); /* Interrupt on pin 14 (PB0) */ PCICR = _BV(PCIE0); /* Enable interrupt 0 */ /* Configure inputs and outputs: */ DDRB = 0b11111110; DDRC = 0b11111111; DDRD = 0b11111111; sei(); /* The basic idea is to just keep counting in a busy loop. The GM tube will trigger an event at random intervals, which will cause us to latch the current counter state and output it to ULN2003N to drive RGB LEDs. This could be trivially done with 74HC series logic, but the MCU gives us the ability to also avoid generating the same output two times in a row and to briefly flash a white LED to signal detection - all without increasing component count. */ while (1) { cycle_count++; if (!cycle_count) { /* Every 256 cycles, we look at a counter used to turn off the white LED, lit up for a short time after registering an event. */ switch (turn_off_cnt) { case 0: break; case 1: PORTC = current_pattern; /* fall through */ default: turn_off_cnt--; } } /* If we registered an event, let's use the current counter to get some combination of R, G, and B as the current lamp color. If the result is the same as the previous pattern, flip the bits for good measure. Turn on the white LED for a short moment, too. */ if (event_detected) { u8 new_pattern = cycle_count & (_BV(C_RED) | _BV(C_GREEN) | _BV(C_BLUE)); if (new_pattern == current_pattern) new_pattern ^= _BV(C_RED) | _BV(C_GREEN) | _BV(C_BLUE); current_pattern = new_pattern; PORTC = _BV(C_WHITE) | new_pattern; turn_off_cnt = 150; event_detected = 0; } } } /***************************** * GM tube interrupt handler * *****************************/ ISR(PCINT0_vect, ISR_BLOCK) { /* We only care about falling edge events (PCINT toggles on both edges). */ if (PINB & _BV(B_TUBE)) return; event_detected = 1; }

Here's the whole shebang after assembly on a perfboard; all the electrical tape on the HV side is there to minimize the risk of accidental shorts:

I used four Osram LRTBC9TP RGB LEDs, operated at roughly 150 mA per color; the diodes are soldered to oversized solid copper wire and potted inside a blob of transparent resin - mostly for heat dissipation.

5. Making the enclosure

The enclosure is a custom-made design that leverages CNC machining and resin-cast parts. The process is explained in detail on this page, so I won't recap all the gory details, but in essence, it starts with CAD:

Once the geometry is designed, the parts are machined in a prototyping board called RenShape 460:

This pattern is used to make flexible two-part molds out of addition cure silicone rubber, Quantum Silicones QM 262, and then cast custom-pigmented polyurethane resin (Innovative Polymers IE-3075). The end result is:

I also did another design without color mixing; this one simply had six individual color bands:

6. Contact

Questions? Comments? Ping me at lcamtuf@coredump.cx.

Your lucky number: 16041437