I enjoy listening to the Macrofab Engineering Podcast. During episode #62 host Stephen Kraig gave the listeners a design challenge (link). It was to design a system to have a ring of 16 - 32 LEDs around a double gang potentiometer to be used in a synthesizer. He gave a few more details like a 1.2" cube space constraint and basically left the rest up to the listeners. I heard this and it piqued my interest so I thought I'd have a go at it.
Stephen mentions that he might use something close to 20 of these in his synth so I didn't really want to go the way of an independent microcontroller on each board that would need to be flashed and updated to make any changes. I then started to think about how I could do this with discrete digital logic. A 4-bit demultiplexer seemed like a good way to drive 16 individual LED's and a 4-bit binary counter with a carry out bit could be a simple traffic cop to synchronize the signal order with the demux output select pins.
Stephen only wants to provide 5VDC and ground so the clock signal must be produced on the board. I found a crystal oscillator made to run at 32.768kHz that could do what I needed. In reality that speed is much faster than the circuit really needs to run, but it shouldn't be a problem. As a result each LED will have a PWM frequency of 2.048kHz with a 1/16th duty cycle. My idea is to offset the ON pulse to each LED so that the counter's current state indicates which LED is selected. 0000 is the first LED, 0001 the second, and 1111 is the 16th LED. This means that lighting the full sequence of 16 LEDs will take 1/2048Hz or 488μs.
This is the point where I started to get a little creative. I decided to use a monostable multivibrator (a pulse generator) to create a pulse that would keep the enable pin of the demux chip high. The pulse width will be adjustable and this selectable time to hold the enable pin high is what controls how many LEDs light up. One of the potentiometer's contacts will be connected in series with a fixed resistor to create the resistance controlling the pulse time. The potentiometer at full value will result in a pulse width close to 488μs while all the way down will be as short as possible. This allows for an interesting phenomenon that the leading LED in the sequence will not necessarily receive it’s full 1/16th duty cycle but will instead receive a portion of that relative to the pots position in that LED’s respective 1/16th of the full 300 degree throw. This means if the pot is turned to 20 degrees the second LED will be dimly lit, but at 35 degrees it will be at almost full intensity. In order to keep all of the timing in order the pulse will trigger off of the falling edge of the carry out on the counter.
The demux chip doesn’t have to current capacity necessary to drive 20mA through the LEDs and they’re already starting with 1/16th duty cycle so I can’t really sacrifice intensity to save current. I initially thought about a 16-bit buffer to handle the additional current, but I’m beginning to convince myself that discrete transistors will work better.
This all leads to this schematic (buffer/transistors solution not pictured):
I perused my prefered online distributer and found these prices for the important components:
- NL27WZ14DFT2G Inverter - $0.1741 each @ 10+ qty
- AB26T-32.768KHZ Crystal - $0.1588 each
- DM74ALS163BM Counter - $0.0399 each @ 10+ qty
- CD4514BM96 Demux - $0.5785 each @ 10+ qty
- CD14538BPW Multivibrator - $0.3952 each @ 10+ qty
- MC74LCX16244DTG Buffer - $0.3968 each
There are of course many things like current limiting resistors and decoupling caps that are necessary, but being an electronics manufacturing house Macrofab has options and pricing for these items that make their cost pretty negligible. I also omitted LEDs because they are expensive from large online distributers and it is possible they have some house parts that would work for much more reasonable prices.
From this point I was able to design a board for the LEDs, but I did not have enough time to design the other board to contain the logic portion of the circuit.
Needing to focus my time on other more important things (like finals) as well ask a few questions related to integrating the board into the synthesizer prevented me from finishing the design so I sent it to them in this state and hope they enjoyed it.
A continuation of this can be seen here.