Posts Tagged Arduino

Cheap WS2812 LEDs: Test Fixture

Given that I no longer trust any of the knockoff Neopixels, I wired the remaining PCB panel into a single hellish test fixture:

WS2812 4x7 LED test fixture - wiring

WS2812 4×7 LED test fixture – wiring

The 22 AWG wires deliver +5 V and Common, with good old-school Wire-Wrap wire passing to the four LEDs betweem them. The data daisy chain snakes through the entire array.

It seems only fitting to use a knockoff Arduino Nano as the controller:

WS2812 4x7 LED test fixture - front

WS2812 4×7 LED test fixture – front

The code descends from an early version of the vacuum tube lights, gutted of all the randomizing and fancy features. It updates the LEDs every 20 ms and, with only 100 points per cycle, the colors tick along fast enough reassure you (well, me) that the thing is doing something: the pattern takes about 20 seconds from one end of the string to the other.

At full throttle the whole array draws 1.68 A = 60 mA × 28 with all LEDs at full white, which happens only during the initial lamp test and browns out the supply (literally: the blue LEDs fade out first and produce an amber glow). The cheap 5 V 500 mA power supply definitely can’t power the entire array at full brightness.

The power supply current waveform looks fairly choppy, with peaks at the 400 Hz PWM frequency:

WS2812 4x7 array - 200 mA VCC

WS2812 4×7 array – 200 mA VCC

With the Tek current probe set at 200 mA/div, the upper trace shows 290 mA RMS. That’s at MaxPWM = 127, which reduces the average current but doesn’t affect the peaks. At full brightness the average current should be around 600 mA, a tad more than the supply can provide, but maybe it’ll survive; the bottom trace shows a nice average, but the minimum hits 4.6 V during peak current.

Assuming that perversity will be conserved as usual, none of the LEDs will fail for as long as I’m willing to let them cook.

The Arduino source code as a GitHub Gist:



Vacuum Tube Lights: Poughkeepsie Day School Mini Maker Faire 2016

Should you be around Poughkeepsie today, drop in on the Poughkeepsie Day School’s Mini Maker Faire, where I’ll be showing off some glowy LED goodness:

21HB5A on platter - orange green

21HB5A on platter – orange green

The 5U4GB side lighted dual rectifier looks pretty good after I increased the phase between the two LEDs:

5U4GB Full-wave vacuum rectifier - cyan red phase

5U4GB Full-wave vacuum rectifier – cyan red phase

A gaggle of glowing vacuum tubes makes for a rather static display, though, so I conjured a color mixer so folks could play with the colors:

Color mixer - overview

Color mixer – overview

Three analog potentiometers set the intensity of the pure RGB colors on the 8 mm Genuine Adafruit Neopixels. A closer look at the circuitry shows it’s assembled following a freehand “the bigger the blob, the better the job” soldering technique:

Color mixer - controls

Color mixer – controls

The blended RGB color from a fourth Neopixel backlights the bulb to project a shadow of the filament on the front surface:

Color mixer - bulb detail

Color mixer – bulb detail

It’s worth noting that the three Genuine Adafruit 8 mm Neopixels have a nonstandard RGB color layout, while the knockoff 5050 SMD Neopixel on the bulb has the usual GRB layout. You can’t mix-n-match layouts in a single Neopixel string, so a few lines of hackage rearrange the R and G values to make the mixed colors come out right.

An IR proximity sensor lets you invert the colors with the wave of a fingertip to send Morse code in response to (some of) the vacuum tubes on display nearby. The sensor glows brightly in pure IR, with all the other LEDs going dark:

Color mixer - controls - IR image

Color mixer – controls – IR image

The switch sits in a little printed bezel to make it big enough to see. The slight purple glow in the visible-light picture comes from the camera’s IR sensitivity; you can’t see anything with your (well, my) unaided eyes.

The “chassis” emerged from the wood pile: a slab of laminate flooring and two strips of countertop, with a slab of bronze-tint acrylic from a Genuine IBM PC Printer Stand that had fallen on hard times quite a while ago. Bandsaw to size, belt-sand to smooth; nothing particularly precise, although I did use the Sherline for coordinate drilling:

Color mixer panel - drill setup

Color mixer panel – drill setup

That’s laying it all out by hand to get a feel for what it’ll look like and drilling the holes at actual coordinates to make everything line up neatly.

Hot melt glue and epoxy hold everything together, with foam tape securing the two PCBs. Those cap screws go into 10-32 brass inserts hammered into the laminate flooring strip.

There’s no schematic. Connect the pots to A0 through A2, wire the Neopixels in series from D8 with the bulb LED last in the string, wire the prox sensor to D9, and away you go.

It’s fun to play with colors!

The Arduino source code as a GitHub Gist:


Vacuum Tube LEDs: Mogul Base for 500 W Incandescent Bulb

This obviously wasn’t ready for prime time, but it demonstrated feasibility with a socket on a base assembled for something else:

500 W Incandescent - backlit light

500 W Incandescent – backlit light

I recently salvaged a heavy aluminum lid that looked like a perfect complement for that bulb:

Mogul base - bulb - blue phase

Mogul base – bulb – blue phase

The light comes from a rectangular knockoff Neopixel in a sidelight mount:

Mogul base - sidelight curing

Mogul base – sidelight curing

That’s epoxied to the rear of the bulb, below the equator, where it casts the best-looking shadow of the filament and support structures on the inside of the bulb. Actually, it’s taped in place for a week’s worth of burn-in to see if it survives.

The Arduino Nano fits inside a small base below the ceramic Mogul socket:

Mogul base - Arduino Nano holder

Mogul base – Arduino Nano holder

The braid exits through a hexagonal trench recessed into the top surface, with a dollop of epoxy holding it in place:

Vacuum Tube Lights - Mogul Base - top - solid model

Vacuum Tube Lights – Mogul Base – top – solid model

The underside has holes for three 10-32 brass inserts:

Vacuum Tube Lights - Mogul Base - bottom - solid model

Vacuum Tube Lights – Mogul Base – bottom – solid model

The center insert is the only thing holding the entire assembly to that aluminum base; I’m not convinced that’s enough, but it’ll suffice for now.

The “computer” certainly gets lost under the ceramic:

Mogul base - ceramic socket connector

Mogul base – ceramic socket connector

The base is slightly smaller than the ceramic to match the flat part of the lower surface; if it came all the way to the OD, you’d see an unsightly notch.

The two screw heads buried down in the recesses thread into the outer brass inserts in the printed base. The ceramic Mogul socket mounts atop that connection block, with another pair of screws making both electrical and mechanical connections to the metal plates-with-screws that used to terminate the incoming power wires.

It’s running the same Morse code firmware as before, with the Morse output turned off, because who needs a giant blinking bulb?

The OpenSCAD source code of the base as a GitHub Gist:

The original doodles with some dimensions:

Mogul base - dimension doodles

Mogul base – dimension doodles

1 Comment

Vacuum Tube LEDs: 6H6GT Dual Diode

Having accumulated a set of octal tube base clamps, it’s now a matter of selecting the proper clamp for each tube:

Octal tube base V-block clamps

Octal tube base V-block clamps

The process of shell-drilling the tube base, drilling the hard drive platter, printing a tube socket and case, wiring up the Arduino and base LED, then assembling the whole thing requires a bit of manual labor, assisted by some moderately exotic shop machinery.

The getter flash atop this small 6H6GT dual diode tube rules out a cap and there’s not enough space for a side light:

6H6GT - on platter

6H6GT – on platter

Fortunately, the base LED completely lights the internal glass:

6H6GT - purple phase

6H6GT – purple phase

The slowly changing color would make a fine night light:

6H6GT - cyan phase

6H6GT – cyan phase

It must be Art!

, ,


Vacuum Tube LEDs: 5U4GB Vacuum Rectifier with Sidelight

A larger version of the V-block clamp accommodates the 35 mm = 1-3/8 inch octal base of a 5U4GB Full-Wave Vacuum Rectifier tube:

5U4GB - spigot milling

5U4GB – spigot milling

The evacuation tip nearly touched the inside end of the base spigot!

I had to cut the shaft and half the body off the shell drill in order to fit it into the space above the tube base and below the chuck:

5U4GB - base shell drilling

5U4GB – base shell drilling

A slightly larger shell drill would still fit within the pin circle, but the maximum possible hole diameter in the base really isn’t all that much larger:

5U4GB - base opening

5U4GB – base opening

The getter flash covers the entire top of this tube, so I conjured a side light for a rectangular knockoff Neopixel:

Vacuum Tube Lights - side light - solid model

Vacuum Tube Lights – side light – solid model

There’s no orientation that doesn’t require support:

Vacuum Tube Lights - side light support - Slic3r preview

Vacuum Tube Lights – side light support – Slic3r preview

A little prying with a small screwdriver and some pulling with a needlenose pliers extracted those blobs. All the visible surfaces remained undamaged and I cleaned up the curved side with a big rat-tail file.

I wired the Arduino and Neopixels, masked a spot on the side of the tube (to improve both alignment and provide protection from slobbered epoxy), applied epoxy, and taped it in place until it cured:

5U4GB - sidelight epoxy curing

5U4GB – sidelight epoxy curing

The end result looks great:

5U4GB Full-wave vacuum rectifier - side and base illumination

5U4GB Full-wave vacuum rectifier – side and base illumination


It currently sends Morse code through the base LED, but it’s much too stately for that.

, ,


Vacuum Tube LEDs: Now With Morse Code

Adding Mark Fickett’s non-blocking Morse Arduino library turns the tubes into transmitters:

21HB5A on platter - orange green

21HB5A on platter – orange green

The plate cap LED blinks the message in orange, while both LEDs continue to slowly change color as before.

You define a Morse sender object (C++, yo!) by specifying its output pin and code speed in words per minute, dump a string into it, then call a continuation function fast enough to let it twiddle the output bit for each pulse. Obviously, the rate at which the callback happens determines the timing granularity.

However, setting a knockoff Neopixel to a given color requires more than just a binary signal on an output pin. The continuation function returns false when it’s done with the message, after which you can initialize and send another message. There’s no obvious (to me, anyhow) way to get timing information out of the code.

The easiest solution: called the Morse continuation function at the top of the main loop, read its output pin to determine when a dit or dah is active, then set the plate cap color accordingly:

LEDMorseSender Morse(PIN_MORSE, (float)MORSE_WPM);
Morse.setMessage(String("       cq cq cq de ke4znu       "));
PrevMorse = ThisMorse = digitalRead(PIN_MORSE);
if (!Morse.continueSending()) {
ThisMorse = digitalRead(PIN_MORSE);
if (ThisMorse) {             // if Morse output high, overlay
PrevMorse = ThisMorse;;               // send out precomputed colors
<<compute colors for next iteration as usual>>

I use the Entropy library to seed the PRNG, then pick three prime numbers for the sine wave periods (with an ugly hack to avoid matching periods):

uint32_t rn = Entropy.random();

Pixels[RED].Prime = PrimeList[random(sizeof(PrimeList))];

do {
  Pixels[GREEN].Prime = PrimeList[random(sizeof(PrimeList))];
} while (Pixels[RED].Prime == Pixels[GREEN].Prime);

do {
  Pixels[BLUE].Prime = PrimeList[random(sizeof(PrimeList))];
} while (Pixels[BLUE].Prime == Pixels[RED].Prime ||
        Pixels[BLUE].Prime == Pixels[GREEN].Prime);

printf("Primes: (%d,%d,%d)\r\n",Pixels[RED].Prime,Pixels[GREEN].Prime,Pixels[BLUE].Prime);

In the spirit of “Video or it didn’t happen”: YouTube!

The Arduino source code as a GitHub Gist:



Vacuum Tube LEDs: Fully Dressed 21HB5A

Black PETG definitely looks better than cyan for this job:

21HB5A - Black PETG base - flash

21HB5A – Black PETG base – flash

Holding the plate cap to the tube with a thin ring of opaque epoxy cuts down on the glare under its edge:

21HB5A - Black PETG base - cyan phase

21HB5A – Black PETG base – cyan phase

Fire in the bottle!

21HB5A - Black PETG fittings - punched drive platter - purple phase

21HB5A – Black PETG fittings – punched drive platter – purple phase

It’s still running basically the same Arduino code as before, but I have some ideas about that