Welcome to Valvetron

This is an occasional blog, describing projects I've worked on. Some even have pictures.

I'm John Baustian. I design and build electronic things to solve problems. Got a problem you need to solve? Send me an email.

I was asked to help refurbish a prop from the film 2010. There were two parts that I worked on: a digital readout (), and a set of chase lights (). The digital display would be static, which made for a simple design, just a resistor for each LED segment, and a 9 volt battery, I was concerned that making connections could be problematic, given the age of the parts (2010 was released in 1984). I tried soldering the pins, but it appeared that the plating was mostly gone. I thought of wire-wrapping, since that would provide more surface area to get a usable connection. I wire-wrapped wires to each of the display pins, then ran each wire to a separate board for the resistors. This worked well, with all but one digit lighting up.

The chase lights were a string of ten LEDs in a line. The two in the middle would light, then move out to the ends. The client provided a chase light kit from All Electronics. At first I thought I would need something like an Arduino, but I later realized that, with a few modifications,the kit would be all I needed. The kit uses a 555 timer to drive a CD4017 decade counter. The CD4017 provides a one-of-ten output, with each output going to an LED. The CD4017 also has a reset input, which allows shortening the sequence. I connected the LEDs in pairs to outputs 0-4, and connected output 5 to the reset input, with the LEDs arranged on a small circuit board

    (4)(3) (2) (1) (0) (0) (1) (2) (3) (4)

The 0 LEDs light first, then 1,2,3,4, then back to zero. The circuit board in the kit is a bit on the large size, such that it would be tricky fitting it into the prop. Since the LEDs would be on their own board, spaced to fit in the panel of the prop,that part of the chaser board could be cut away, and by re-routing a couple of wires, I was able to cut away one side.

The client was thrilled by what I was able to do.

Here it is in action.

20 milliamp current source

This is a handy little box for testing LEDs, especially LED arrays. It is built into a plastic electrical junction box, available from your local hardware store or home center, and cheaper than a regular project box. It has red and black banana jacks on top. (I happen to have a goodly stash of banana jacks in various colors.) Inside are four 9-volt batteries, and an LM317 wired as a current source.

To test a single LED, you can use a lithium coin cell. Three volts light up most any LED, and the current output of the cell is limited, so you don't need a resistor. Small keychain LED lights are made this way. Large seven segment displays and other LED arrays have several LEDs wired in series, and thus need a higher voltage to light, and the current needs to be limited to a safe value.

This little box provides more than 30 volts, which will light a string of several LEDs, and the regulator limits the current to 20 mA, which is a safe value for most LEDs.

LEDs, quick and easy

You don't need a BSEE to make LEDs light up and stay lit up, i.e., not burned out. You do need to limit the current through the LED. The more current you have, the brighter the LED will be, but too much current for too long means a dead LED. A resistor is the simplest way to limit current. Just put one in series with your power source (a battery, for instance) and your LED. So, what value of resistor do I need? The formula to calculate the proper resistor is

resistor value (in ohms) = (Supply voltage - LED voltage)/LED current (in amps)

If you are connecting a bunch of LEDs together or you are driving an LED near or above its rated current, you should use this formula. On the other hand, if you just want to light one LED, there is a simplification. Modern day LEDs are bright enough that they don't need to be driven hard to be usable. Simply multiply the supply voltage by 100 and select a resistor close to this number. For example, a supply voltage of 12 volts would call for a resistor of 1200 ohms, 24 volts would call for 2400 ohms, and so on. If the value you get is not a standard resistor value use a standard value of at least 90%. For 24 volts or less, a quarter watt resistor is adequate; a half watt resistor is good for up to 48 volts. For an animated demo, you can go here.

Arduino Projects

I don't have pictures of these, but I will describe them as best I can.

Waffle Cannon

The Waffle Cannon was built, apparently, as a theme park attraction. The Cannon used compressed air to fire a series of plastic waffles through the air, accompanied by flashing lights and sound effects. My client asked me if I could program the Arduino microcontroller which would control the functions of the Waffle Cannon. The loading and firing functions of the Cannon were performed by solenoids connected to a relay board, which in turn was connected to an Arduino Due. The Arduino received inputs from the firing button and from a wireless controller controlled by the operator, and sent outputs to the relay board, to an LED display, and to an Arduino Uno,configured to play sound effects. It worked like this. The operator would press a button and a sound effect would play, indicating the Cannon was charging up and at the same time a line of LEDs would display a countdown sequence. At the end of the sequence, the firing button was enabled, and the young person at the trigger could fire a shot. When the firing button was pressed, the various solenoids were activated to fire the Cannon and reload. At the same time,a firing sound effect played, the firing button was disabled and the LEDs again counted down, at which time the firing button was enabled, completing the cycle. All of these functions needed to happen concurrently and seamlessly. I accomplished this by creating several state machines in the software, which enabled several functions to be operating apparently simultaneously.
Here is the Arduino code and the associated header file.

Twinkling LEDs

My client for this project is a builder of magical illusions. He needed an array of LEDs appear to twinkle like stars. There are LEDs available that flicker like a candle, but the flicker was too fast, and not adjustable. I was able to use the six pulse-width modulation outputs of an Arduino to provide six channels of LEDs with random brightness levels, and with a variable twinkling rate.
Here is the code.

Here are two demos of the flicker effect.

The display uses six bi-directional red/green LEDs, wired such that if the common is connected to ground, they light up red, and if the common is connected to +5 volts, they light up green.