Posts Tagged ‘electronics’

Motors Demo

25 October 2017

motors-demo-20171025-2-cropped

I don’t use motors much in my projects, but they are everywhere now on our very mechanical world. So I am always running into them, and had a bunch set aside mostly from tearing down old printers. I have been particularly interested in stepper motors, as I had read about them a long time ago, and they are used a lot in industry.

Stepper Motors

This isn’t going to be a huge technical article, but: Stepper motors are used for positioning in all sorts of equipment, computer printers just being one example. They are designed to be moved an exact rotational amount (by counting the step signals sent to the motor) and to hold that position while energized.

The ordinary stepper motor is driven by two overlapping signals, as mentioned in my recent post about SerDes design. Finding new data about how these motors are driven inspired me to take another shot at creating a working driver. My previous attempt, based on sine waves amplified by audio amps, had not been successful.

Design by Numbers

Here is a rear view of my project, with numbers added to match the discussion below:

motors-demo-20171025-4-cropped-annotated

  1. AC terminals and connectors. I like to run my projects off AC-powered supplies. I get them cheap from thrift stores. Usually they are “wall warts” or otherwise portable / external power supplies, and I remove the plastic cover and use the board inside. Sometimes I keep half the cover if it helps for mounting purposes.The funny thing about all modern power supplies is that the first thing they do is convert your AC power to DC. Then they step down the DC (about 120V in the US, about twice that in many other places) to the power supply voltage. Most of these modules provide good regulation, because that’s built into the controller electronics, and it helps protect people and equipment.
  2. I stacked the two power supplies I used. The top one runs my control electronics. Most of it is 5V, but I also have some 12V relays.
  3. I used a 9 volt 3-1/2 amp module to run the motors. These are a little hard to find, so when I run across one I grab it for later use. 5V supplies are ubiquitous, as they are used now for phone chargers (phones generally have 4V batteries). But other voltages and power levels can be more scarce.
  4. Next in line is a board that monitors the motor supply for voltage and current output. You can buy panel meters with these features built in, but I built my own, as it’s not too hard. It then feeds generic panel meters. The hardest part to get right on this board was the current shunt. I used a bunch of SMT (surface mount) resistors in parallel.
  5. The motor driver module was purchased online from China. This particular one had some problems, and I basically had to repair it before I could use it. That sometimes happens with cheap stuff from China. They had installed the wrong part to function as a 5V auxiliary supply. It was supposed to be a fixed-voltage part and an adjustable-voltage part was installed. So I had to lift the adjustment pin off the board and add some components to get my 5V output.One of the drivers was also poorly soldered, so I went over the solder joints and added more solder as needed.

    The board uses a part that has been around for a long time (LM298). It is designed to drive stepper motors. It has four logic-level inputs (plus enable) and four power outputs. It can work up to 48V. I had planned to add a second higher-voltage motor driver supply to the project, but all the motors worked fine with 9V, so I left it out.

    You have to feed the driver the correct signals, and I made two more boards to do that. One board provides the four steps needed to generate the “quadrature” drive pattern and a pulse-width-modulated (PWM) signal to vary the amount of drive. The other board converts these signals to those needed to feed to the driver board.

  6. Another board just gets all the connections right.
  7. I used a four-position rotary switch to select between four different motors. Only one is a stepper motor. The ordinary DC motors are very easy to power on; you just apply power. You can modify their speed somewhat by changing the drive voltage or using a PWM signal which essentially does the same thing. I used one driver IC on the driver board to power the DC motors. I paired up the four drivers to make two. I can run the load in forward, reverse or braking mode.
  8. Here are the front panel controls for stepper speed, PWM, and forward – brake – reverse.
  9. Cheap panel meters from China indicate the drive voltage and total current being used. They have a nice auto-ranging feature which makes them usable up to about 50 volts input. Their electronics run on 5 volts. These digital meters only have three decimal places, but that was enough for this application.

Closing Comments

The biggest problem with motors is having them stall out due to mechanical overload, which can ruin both the motor and the drive electronics. As these motors are running no-load, that’s not a problem. You can grab the motor shaft with your fingers if you want to, and see what mechanical loading does to the current draw. But for real use, the electronics should include overcurrent protection to turn the power off if the motor stalls. Many industrial motor drivers also monitor motor temperature, which is another way to tell that something is going wrong with your motor.

I am very happy that I was finally able to get my stepper motor to run (both forwards and reverse!) and at a variety of different speeds. It turns out steppers are a bit sensitive to what speed you drive them at. Try to go too fast and they just won’t run. Go too slow and they use too much power (though there are ways around this). Most steppers have an optimum speed, and in most applications, you will see them operated at a constant speed, or maybe two, high and low (like in a scanner).

The driver module was designed for robotics hobbyists. It’s a neat design, but not well-documented. I had to look up the datasheets for the various parts used to get details. This is par for the course in hobby electronics.

Advertisements

In search of a better SerDes

17 October 2017

Oh no! Another dry technical article! True, true. Just pass it by if you’re not interested.

Serdes sounds like a Greek word, but it isn’t really. There are some people with the name Serdes, but it is uncommon. I learned it as an engineering acronym thus (lightly edited):

A Serializer/Deserializer (SerDes) – usually pronounced “sir-deez” – is a pair of functional blocks commonly used in high speed communications to compensate for limited input/output. These blocks convert data between serial data and parallel interfaces in each direction. The term “SerDes” generically refers to interfaces used in various technologies and applications. The primary use of a SerDes is to provide data transmission over a single/differential line in order to minimize the number of I/O pins and interconnects.

https://en.wikipedia.org/wiki/SerDes

Electronic Art

I am trying to work out some cool things to do with LED arrays that would respond to environmental or observer inputs. There are many pieces to such a system. This includes the possibility that the display itself may be some distance from the electronics that collects the input signals and decides what the display should do. The same way a computer monitor can be separate from the computer. And in this case, the two are connected with a cable.

Some of us remember the old printer cables. They were thick, had up to 25 separate wires in them, and couldn’t be much longer than 15 feet. I could probably use such a cable in my projects. But that’s a lot of bulk, and it comes with many limitations. Those cables connected a parallel port on the computer to a parallel port on the printer. There were usually 8 data lines plus a bunch of handshaking signals to make it so the computer would not send data faster than the printer could print it out. If you wanted to get a lot of data back from the printer, you could add another 8 data lines going in the opposite direction.

8 bits can encode into 256 different numbers (0 to 255). That’s enough for an alphabet – both upper and lower case – and a bunch of other symbols. Each symbol has a number “code” that stands for that symbol. Both ends of the line have to use the same code system.

An 8 bit parallel system could go pretty fast; millions of symbols per second. But try pushing parallel data through a long cable that fast and you will quickly run into problems. You would need to shield the cable so external signals won’t interfere with it, and so it won’t radiate signals into external equipment. And the wires in the cable, when they get quite long, resist fast signals going through them in at least three different ways (resistance, inductance and capacitance). So if you want to send data fast through a long cable, you have a whole hardware design challenge on your hands.

SerDes concept

Illustration of the SerDes concept. Original graphic by Grégoire Surrel – Own work, CC BY-SA 4.0

The solutions to these problems usually involve reducing the number of wires carrying signals (ideally just one pair would be enough) and creating special hardware interfaces that alter the signals so that they will make it through the cable successfully, even though the cable presents various barriers to proper transmission.

A standard solution for many years was the “RS-232” serial cable. In this system the signal is amplified to make it more resistant to interference and cable attenuation. And the signal is “serialized” so it only has to use one pair of wires. That means each symbol of 7 or 8 bits would be transmitted as a sequence of bits that would have to be reassembled into 7 or 8 parallel bits at the receiving end. That was an early SerDes system. But we didn’t call it that in the old days. The acronym only came into wide use after the internet and its various forms of information exchange came into wide use. The term commonly refers to high speed data transmissions, but the basic concepts are the same regardless of data rate. My projects use quite low data rates just to make sure I don’t run into too many design problems and can use cheap parts.

The RS-232 standard could probably work for me, but I wanted to try another more modern data transmission standard, TIA-485. (RS = Recommended Standard, as published by the EIA, Electronics Industries Alliance, but now taken over by the TIA, Telecommunications Industry Association). This standard uses two wires for each signal plus a third wire used as a ground (zero volts) reference. The signal is transmitted in an attenuated form, differentially. That means a “zero” would be transmitted by putting maybe 3-1/2 volts on one wire and 1 volt on the other. And a “one” would be transmitted by reversing those. Smaller signals in a cable create less external interference and are easier to pass through longer cable lengths.

I have a connector that is used for MIDI (Musical Instrument Digital Interface) that has five pins, which means it can carry two differential serial signals (or 4 RS-232 signals) plus a ground reference wire. I wanted to use this connector and a 5-wire cable, but there was one problem:

SerDes Timing

Just as in the old parallel printer cables, where handshaking signals were necessary to tell the printer when a symbol to print was put onto the connecting cable, and tell the computer when the printer was busy, serial systems also need a way of at least telling the receiver when the transmitted data is good, how fast it is going, and when an entire symbol has been sent. This requires, minimum, clock and end-of-symbol signals for data rate and data synchronization. In the RS-232 system, the data rate had to be set at both ends in advance. And the end-of-symbol signal was coded into the data stream. It takes a computer to figure out how to decode this data stream, but if you send all three signals separately, you don’t need any computing at the receiving end. Deserialization can be done with one piece of hardware called a shift register.

But I can’t transmit three signals over a five-wire TIA-485 cable, only two. So I thought I’d figure out how to combine the three signals into two so that my system could work with the hardware I have. I devised a rather simple system to do this, and built an initial working system several years ago for my “Christmas” project (Christmas because it used strings of holiday lights for the visual display). Recently I have built two more systems that use this method.

Glitches

I like to re-design systems each time I build them. This is partly because I might not have the same parts available that I used in an earlier design. Or it might be just to explore different ways the problem could be solved. All the heavy work in my SerDes system is on the transmitting site. The receiver is very easy to make. And for this transmitter design I wanted to use counters to run ICs (integrated circuits, now often known as “chips”) called multiplexers. You put parallel data on the 8 inputs of a multiplexer, then tell it which input to put on the output using a counter. And if the counter repeats a regular pattern (as most do) then the parallel data at the inputs will come out of the output in a predictable serial sequence. And so you have achieved serialization.

In my first design I was getting “glitches” at the outputs of some of my multiplexers. This is because I was using “ripple” counters. In this type of counter, the counting outputs don’t all change at exactly the same time. They might be a little off (usually much less than a microsecond, but that’s enough time to cause trouble). In other words, when changing from count 1 to count 2 for instance, the ones bit has to change from one to zero, while the twos bit has to change from zero to one. If the twos bit lagged a little, both outputs might be zero for a split second, telling the multiplexer to go to the wrong input. Such glitches can be filtered out, which is what I did in the first design. But in the second design I decided to try a different counting scheme, where only one counting bit would change at any one time. This should make counting glitches impossible (it does). But it means the count is no longer in number sequence. In other words to do this with a 4-count pattern, you have to use the pattern 0-2-3-1 (or 0-1-3-2) to get a glitchless count. This different sequence is not a problem when using a multiplexer, though it is more confusing to design if you are used to using ripple counters that count 0-1-2-3 (etc.).

I looked at the waveforms associated with this kind of counting, and they were just two square waves offset by one count. I found a PDF online that describes how to implement this kind of counter. It’s called a “quadrature” counter, and it’s pretty simple to do. Getting a similar sequence of 8 is a little more tricky, but basically just interleaves a quadrature signal with a square wave. I built my second system this way and it works fine (though I had to scratch my head a bit to get the input sequence right, as it is sensitive to the place value given to the various counting signals).

quadrature waveform illustration

A four-count pattern implemented using a quadrature counter.

What form should the data take?

So I now have a hardware system that can be used with either 2 TIA-485 signals over quite long distances (if the cables are made well) or with 4 RS-232 signals (but not the RS-232 encoding system). The RS-232 version is much easier to build, but does have distance and speed limitations compared to the TIA-485 system.

The original intention of the system was to enable transmission of 8-bit-wide signals that would be used to control an array of LEDs. But it could also be used to transmit serial control streams of any bit length. This means a wide variety of displays could be controlled, as long as they didn’t have to change at a very fast rate. In other words, we’re not talking about full-motion video, like TV, but that’s not the sort of display I’m working with. My average display contains less than 100 LEDs, while a modern TV screen contains millions.

I have also tried transmitting analog data using digital serial techniques by using pulse-width encoding, which is very simple to implement in hardware. This gives me the option of using digital data transmission instead of long analog signal lines. This may come in handy in some of my projects.

Electronics Design Case Study – ADSR

23 September 2017

ADSR module homemade

This is a technical article and if you have no particular interest in electronics design feel free to skip it. It will get into some terminology that won’t all be explained in the text…

Music Synthesis

My interest in synthesizers goes back to my early days studying electronics. I always wanted to make my own synth.

But by 1983, MIDI had come out, and I was in the Sea Org.

MIDI stands for Musical Instrument Digital Interface. Musical instruments were an early target for embedded controllers (software-controlled electronic circuits) for many reasons. This ended (mostly) the era when synthesizers were controlled by analog (continuous) signals. Voltage sources were terrible when it came to keeping all the electronic instruments in an ensemble in tune with each other. So tuning was an obvious feature to turn over to the digital world, where crystal-controlled oscillators could stabilize pitch to within a few parts in a million.

The advent of digital signal processing meant things like voltage-controlled filters and unusual effects like ring modulation could be implemented with algorithms instead of hardware.

Voltage-controlled amplitude, however, is so straightforward in the hardware realm that it remains somewhat popular. A basic part of synthesizing a real-world note or sound is approximating its amplitude envelope. This envelope has long been analyzed by acoustics engineers into four parts: Attack; Decay; Sustain and Release. If you play a note on a stringed instrument you can easily see each of these parts in action. How hard and fast you hit (or pluck) the string determines the initial attack and to some extent how that attack decays. Then if you don’t damp the string it will continue to ring until it is damped or played over. This is sustain. And when it is damped, the sound will die out, which is the release phase.

There are many many possible ways to imitate this amplitude envelope with electronics. The most common methods use parts that I had run out of (1 Meg-ohm potentiometers) so I decided to try an alternative design of my own creation.

Design Requirements

Most traditional ADSRs take a “gate” signal from a keyboard which tells the electronics how long the key is being held down (“note on” in MIDI). My electronic art projects use sensors, not keyboards, so I couldn’t rely on a gate signal to determine how much sustain the sound would have. I also kind of wanted a circuit that could be adapted so that each part of the envelope could be controlled by a separate sensor. That means it couldn’t just use pots, like the super-simple designs do. I also wanted to try straight-line segments rather than the traditional curved segments you get using just resistors and capacitors, even though this is less “realistic” for decay slopes.

I had a front panel I was reusing from an earlier project, and originally loaded it with just three pots – all that seemed to fit – which is two less than you need to control the five main parameters of the envelope. But I thought I could skip setting a sustain level, and use one pot to control both decay and release slopes. This panel had to fit into a eurorack-style chassis I had put together earlier, with power coming in the front.

The unit was also to include the voltage-controlled amplifiers, using an IC I had never worked with before.

First Try

I decided to use an op amp integrator at the core of the design, as it would give straight-line slopes and could be dependably controlled. However, I wasn’t sure how to set up my 100K pots to imitate a wider range of resistance. I used three comparators and a couple of flip-flops to detect voltage levels and turn the various slopes on and off.

Mounted at the bottom of the front panel was a backplane board that has become standard in most of my designs. Circuit boards then plug into this backplane, which ideally handles all the interconnects. Front panel parts that could not be mounted directly on the backplane board would be wired down to the backplane using jumpers.

I made the envelope generator board first and then the VCA board. The VCA datasheet was confusing at first, but by wiring an actual circuit I was able to figure out what was going on. This VCA could accept a wide range of control voltages (0 to 30 roughly), but they were referenced to the negative voltage rail! So I needed both an amplifier and offset for my envelope, as it would go from 0 to 5V only, my standard range for control voltages. I realized at this point that I would need a sound source to test this with, and it would also be nice to monitor the envelope waveform on an analog meter. I then spent about a day creating an oscillator and a meter for these purposes.

An incomplete design with too many questions about “will it work this way?” resulted in my running out of room on my envelope module. To solve this I piggybacked an extra module onto the main one. I got some sort of envelope out of this design, but the pots worked only over an extremely narrow range of their total rotation. I had to decide whether to stick with these pots and basic design, or start over.

Second Try

I looked around at what my alternatives were. I had a nice set of six quite small 5K pots from an old piece of audio equipment. They would all fit into the panel if I drilled new holes for them. So I decided to go for it. Five of these pots went onto a new backplane board. I modified this board to hold circuitry and figured the majority of my new design would fit on this board, with the rest put on a new plug-in module on the original backplane.

Now that I was beginning to recognize that this was a challenging project, I went to a build a section and test it approach to my work. 5K pots could only yield 1:100 output variations (comparable to using a 1Meg pot in series with a 10K resistor) by using the turn-on “knee” of transistors to stretch out the transfer curve. I have used this before so didn’t bother to work it out in complete detail, or plot the curves graphically, but below gives you a graphical idea of what I’m referring to:

transistor turn-on graph

Using a curve found on the internet, note that a 0.1 change in input voltage produces a ten-fold change in output current. Extend this input range a little more and you can squeeze out a 1:100 input/output ratio, or even more.

I built my current sources and sinks using discrete transistors. This gives worse consistency and stability than using matched pairs or some specialized IC, but usable for my purposes. I built one and tested it. I gave me a range of 50 to roughly 1500 microamps. This was good enough. I put the rest on the board, then added a dual timer (LM556) and some inverters and connected it up to run continuously (astable mode). I powered up and checked with my oscilloscope. This part of the design worked fine. The timers have two comparators and a flip-flop inside each of them, so this decreased my parts count.

I thought that I could get the timers to stop after just one cycle using some sort of edge detection scheme. But it didn’t work. I was using two timers so that the attack-decay and sustain-release cycles were separate and could be put in sequence. But my difficulties in making the circuit cycle just once and stop caused me to rethink this approach.

The next day I rewired the timers for one-shot (monostable mode) operation. Now the timers could be triggered by my sensor, fire – producing the envelope waveforms – and would then stop, waiting for a new trigger. I used two control flip-flops with NAND gates (CD4093B) to lock out new trigger signals until the current envelope had finished. I really needed only one flip-flop, but the package (CD4013B) has two in it, so I used one for each of the timers.

Next I had to get all the analog levels of the envelope right. I put this circuitry on the new module board. I only needed 8 wires to connect the new envelope module to this analog module. It has six opamps and a comparator. The comparator detects when the envelope signal goes to zero, and resets the flip-flops so they can allow in another trigger signal. This circuit wasn’t working at first. What was wrong? The envelope waveforms were only going down to 0.5 volts, not to ground. I had the comparator set below this, so it was never firing. I was powering my envelope generator with only ground and +12V. The current sinks (set up as mirrors for my current sources) could only pull the load capacitors down to 1/2 a volt. I compensated for this by adding some offset to my summing opamp. I set the output to go a little below ground so the comparator would for sure fire. I had to find a missing wire on the envelope board before I got the unit totally working. It’s not perfect, but it now works as it was designed to work, and will serve it purpose in helping me develop electronic art that uses sounds.

Electronics Project – Technical

21 December 2015
V-I box front panel

Front panel for my “V-I Box” – reused Extron video equipment.

This is a technical article about a project I recently finished (for the most part). It doesn’t work that well, but it is quite complex so gives me a chance to cover several topics while talking about just one project.

V-I Box

V stands for voltage, named after Volta, an Italian.
I stands for current (French intensité de courant) as used by the French scientist Ampère.

In electricity and electronics, any component will have a characteristic “V-I Curve” showing the relationship between voltage across the component and current through the component. These days, we usually use “curve tracers” to get this graph, but you can also plot it a point at a time using a variable power supply.

Last year I had constructed such a variable supply for a little presentation I gave at work about transistors. Later I made another one to use to demonstrate the operation of vacuum tubes. I wanted to preserve these projects (and the parts used in them) in a more compact space, so I decided to squeeze them into an old Extron (video processing equipment maker headquartered in Anaheim CA) enclosure. The photos show what resulted.

The design is far from ideal but retains most of the features of the older designs, while making some changes to increase the current capacity of the lower voltage source and keep part of the Extron front panel.

Following is a discussion of some of the features of this project.

V-I box guts

Inside my project…

Creating a 1-250V variable supply

I was not prepared to create a supply that could ramp from 1 volt to 250 volts in one smooth transition, so had procured several power supplies, 4 50-volt supplies, a 25-volt supply, and a 1-25 variable supply in the form of a DC-DC converter.

I then had to create logic that would switch through the supplies in 25-volt steps. As part of this scheme, the supplies are put in series (or “stacked”) with each other. This is only possible because most power supplies (not some of the old tube ones, though) use isolation transformers so that the output and input can be at different DC levels. This isolation usually works up to at least 1,000 volts.

The high-voltage sub-system receives a binary code (from 0 to 255) and must decide how to connect the supplies to get a supply voltage about equal to the value of the code supplied.

To implement this I used 4 relays using 5-volt coils, so I could use logic signals to switch the voltages. The DC-DC converter was a cheap one using a potentiometer to set its output value. To make it variable by remote control, I had to set up a control loop using an op amp to drive an optical isolator. The output transistor of the isolator would server to replace the potentiometer.

Other voltage sources

My earlier designs had two other voltage sources, one to bias the tube grid or transistor base or gate, and another for the tube heater. I used a low-power op amp to supply the bias voltage, as hardly any current drive is needed, and I thought +/-10V would be a sufficient range.

I had used a variable linear voltage regulator for the heater voltage, but in this design decided to leave that out and just make my 5V control electronics supply available for that use.

I also needed a supply to run my DC-to-DC converter. It is a buck converter, so I needed greater than 25V. And I only had +/- 12V rails and +5V available from my control electronics power supply. So I used a boost converter driven by the +12V rail to get about 30V which I fed to the buck converter.

Measuring voltages

Providing panel meters for measuring instruments is always a challenge. Today the most common design uses a microcontroller with an A-to-D (analog-to-digital converter) driving an LCD (liquid crystal display). However, I had already purchased a bunch of little modules for the earlier boxes and wanted to use the. So I fit four of them into the new panel. All they do is display the input voltage when powered by at least 5V. These modules have about 370K input resistance and can display up to 99.9 volts. You can get all kinds of different ranges. As I wanted one display to show the entire range of output voltages, I had to divide the input by ten and settle for 25.0 maximum readout. The other module is used for the 1-50V segment of the output supply, and operates at full 3-digit precision. The bias voltage is displayed on the LCD that came with the original equipment.

Measuring currents

In modern electronics, currents are always measured by converting them to voltages first. The old analog current meters responded directly to input current. To convert a current to a voltage, just pass the current through a known resistance, then measure the voltage drop across the resistor. This may then be amplified if needed. In my case, I needed to amplify the signal so that I could use my little voltmeter modules as current meters. (You can also get modules that have this capability built in.)

For the “heater” (+5V supply) current, I used a 0.2 ohm resistor. This would drop 1 volt at 5 amps, so I needed to amplify it to give my meter a range of up to about 3 amps (reading of 30.0). I used an op amp in “quasi differential” configuration to get this reading, so I could put the resistor in the high side of the 5V rail.

For the main supply I used a 4 ohm resistor, as I expected to draw only about 30ma maximum (30.0 reading) from this supply. 30mA through 4 ohms gives a voltage drop of 120mV, so I had to amplify this by a gain of 250. I used an op amp in non-inverting configuration for this purpose.

I used the 30V supply driving my DC-DC buck converter to power these op amps. This was close to their maximum supply rating of 32V!

Front panel controls

The front panel that came with the Extron equipment had an LCD, some pushbutton switches, and 4 little knobs. The knobs felt like potentiometers, but they turned out to be rotary encoders. Instead of replacing them (would have been a lot simpler) I decided to use an Arduino to make the rotary encoders function like digital potentiometers. This was handy for controlling the high voltage supply, but was overkill for the other variable supplies.

It took some fiddling and internet searching to get some workable code for the encoders, but once I got it, they worked satisfactorily. In order to convert the digital values back to control voltages, I had to send them out to a 32-bit shift register and then run R-2R ladders from those 4 8-bit outputs to get analog values. As the bias voltage needed to be bipolar, I wrote the code to display “0” on the screen when it was outputting 127. That made the control voltage for -10v about 0.5 volts, and the control voltage for +10V about 4.5 volts. So I had to provide my op amp with a gain of 5 and an offset of -2.5 volts.

One of the knobs controls the LCD backlight, which has to be pulse width modulated. I found a cute little voltage-to-duty-cycle circuit on the internet which I used for this purpose. I could have used the Arduino, but had run out of PWM outputs.

The LCD

The LCD is run in 4-bit mode using the standard LCD library for Arduino. This requires 6 control pins, not counting the backlight and contrast circuits. Fortunately, the front panel LCD was a totally standard model and interfacing it to the Arduino was no problem once I found its pinout on the internet. (It doesn’t use the more common single row of 16 pins, but rather the less common double row of 14 pins to one side.)

System noise and a mitigation strategy

Worst case, this system could attempt to switch 4 relays on at the same time. Relay coils are highly inductive loads and these coils draw about 70mA each. This can produce a lot of noise on the 5V line, and was causing my system to oscillate or reset under certain conditions. Though I haven’t taken all possible steps to reduce this problem (such as running the Arduino on an isolated rail), I did create a circuit that detects whenever there is a change in the signals that run the relays, and then applies them in sequence to the relays over several seconds, rather than all at the same time. This does give the system a more sedate personality, though I have not eliminated unwanted resets.

The relays with sequencing circuits are in the upper-left side of the enclosure, as it is pictured. The 4 50-volt power supplies are underneath them.

Making connections

In a complex project, connecting all the sub-assemblies together is a huge issue. I am trying to get better at this by standardizing on .1-inch spaced headers and connectors for most applications. I have a source of cables using these connectors which can carry quite a lot of current. Most such cables are extremely flimsy and only good for signals, not power.

For the main power connections between the supplies and the front panel, I used do-it-yourself high current connectors with locking plastic housings. I used to get these at Radio Shack, but making them myself from parts isn’t too bad.

I also use old-fashioned terminal blocks for higher voltage or higher power connections. These require the use of crimp-on lugs which are not cheap. However, if you know how to use the crimping tool, and fit the wire to the correct lug barrel size, they work very well. I used to use soldered lugs for this purpose, but the terminal block strategy keeps things more modular.

Ending cycle

I spent many hours over a number of weeks on this project, and all to preserve some hardware that I hardly ever use. So it’s time to move on to projects more along my main purpose of electronic art. I’m hoping this write-up will assist me to take my attention off this cycle of action and start some new ones.

…starting to come together…

1 November 2015
interactive art rack

Equipment rack for interactive art projects.

The idea of making interactive art didn’t occur to me until rather recently. I got into electronics via audio – amplifiers and the like – and then started getting interested in music synthesis. Later I got into measurements, digital control, and computers.

During my Sea Org years I realized that not many people knew about basic electricity and electronics, yet Hubbard was using examples from those subjects in his books and lectures. So that gave me the idea of a learning lab centered around electronics. The Exploratorium in San Francisco is an example of an interactive learning environment. I wanted to do something like that at home.

It was not until 2009, when I had a lot of time on my hands but not much cash, that I started buying used gadgets at Goodwill and re-purposing them at my workbench. It was at this point that I started working on interactive “art” designs – possibly inspired by Halloween.

Making interactive art installations using electronics is certainly not an original idea with me. There are lots of examples out there, from merely cute to ponderously imposing. I was thinking in terms of something someone might have in a room at home, that would sort of “wake up” and start doing things when people came in. The development of such a system, though, was a lot more involved than I originally imagined. I still don’t have a fully interactive “dream” system up and running. But I have lots of pieces of one, and I needed a way to tie them all together.

The numbers of inputs and outputs that would probably be needed to develop such a system was difficult for me to confront. I imagined something like the old MOOG synthesizers – a mass of patch cables. But nothing seemed to come together until I purchased a used Extron video switching system for the aluminum enclosure, and found out what the back panel looked like. More signal connectors on one panel than I’d ever seen before! Finally I started working on a couple such panels to modify them to do what I thought I would need. It was not the easiest project I’ve ever attempted, but it’s beginning to be actually usable.

Technical details

I have chosen the 19-inch rack-mount form factor for my work. It is the most widely-used mounting system for professional equipment. The average rack cabinet, however, is designed for enclosures that are rather deep (more than a foot), while the things I am making are quite shallow (less than 1/2 a foot). But moving beyond the 19-inch equipment rack is another project.

Let’s go through the equipment in the top photo:
1) A row of four voltage-controlled fans, inspired by a TED Talk I saw of a guy who did some amazing things with remote-controlled fans.
2) Example of a piece of used equipment, not yet re-purposed.
3) A system for developing Arduino projects, made from a used enclosure, of course.
4) My matrix of connectors, used to route various control signals to displays or similar devices. You can see that this isn’t finished yet; none of the controls have knobs!

So far I only have a few displays and sensors to experiment with. But several others are just waiting to be finished.

Audio in or audio out?

In another part of the room, my audio rack has been newly re-assembled.

While my interactive art focuses on sound and motion as inputs and light patterns as outputs, on this rack the output is sound. That means it includes two speakers and a stereo amp, effects to be applied to sound inputs, and the beginnings of a synthesizer. Also included is my latest version of my “LED oscilloscope” and tone generator.

audio rack

Equipment rack for audio projects.

Everything is made from used gear re-purposed for what I want it to do. And all these projects are in a constant state of re-development. I keep older gear until I find or make something better to replace it with. The older stuff gets trashed or re-used inside newer projects.

Organize or perish!

The decision to organize better did not come easily. Organizing and rebuilding old equipment takes time, so I can only do so much of it. But it is a rock-solid basic ingredient to making any activity viable. So I’ve been pushing it forward, and wanted to document the current scene.

My Bench Gets and Upgrade

27 September 2015

My work bench may one day be an important source of income for me. In some ways it is already, as that’s how I keep up with electronics, which is partly why I was able to land my current job.

So I have been investing in it a bit. I recently procured a tool cabinet (made of steel sheet metal) to help me get more control over my storage problems. And I have pushed by “tower #3” – the Tower of Power with Bungalow – up to an operational status.

Unlike my previous two towers (see Tale of Two Towers), this one resides in a rear corner of my bench, and only a small desktop unit (the bungalow) is within reach. All the contraption does is supply power for my projects before the boards are assembled into self-powered enclosures. I decided that this was the most-needed function. Another bench-top unit houses a couple of digital multi-meters and a continuity tester. I use these all the time.

The “work bench improvement project” continues with various efforts to consolidate parts storage, create modules for prototyping, experimental, and demonstration purposes, and throw away redundant and trashy stuff. The current effort focuses on finishing projects that I started earlier.

A Tale of Two Towers

19 April 2015

No, it’s not another 9/11 exposé.

This is a little long-delayed article on making electronic equipment for a hobbyist workbench.

Here’s a view of my two towers:

the two towers on my workbench

Inception

I have designed and built a lot of test equipment for my hobby. I still do.

But a lot of it I end up hardly ever using, or using just once. I had a need. I built something to fill the need. It filled the need. And the need never returned. Or so it seemed.

But some needs kept coming up. A quick source of power. Need to measure a voltage. Need to measure a current, or a resistor, capacitor, sometimes even inductor. I had created a lot of different solutions for these basic needs and usually put them in some sort of horizontal enclosure. This was the standard approach. However, if I put the thing close to me so I could use it, it blocked access to the rest of the bench. And if I put it further away, I never used it, opting instead for something portable that I could put on the bench temporarily then put back somewhere else.

So one day (a year ago?…hard to say when for sure) I got the idea of trying a vertical arrangement. Maybe this was the compromise design that would keep the tools I needed the most close at hand without blocking my access to the rest of the bench.

I started on Tower One. I had a piece of plastic I was going to use for some sort of rack-mount project (19 inches wide) so I just turned it on its end and made a cabinet out of it.

tower one

Tower One

I wanted all the stuff I had put in past designs in this one. A bunch of power supplies, including a variable one. At least one meter. A selectable voltage divider and a bunch of current shunt resistors. And a signal generator. And since I was getting into Arduino, the signal generator would run on software.

I also wanted to include a “patch bay” that I could use to change cable connector types, as this was a constant problem.

And I came up with something.

It worked pretty well.

But after sitting on my bench for six months or so, it was obvious there were parts of it I hardly ever used. The minus supplies were one thing, but didn’t matter that much, as they didn’t take up that much space. The whole top section was not being used, either. The other parts were being used a good deal, but I wished I could monitor voltages and currents easier.

So I decided to build Tower Two.

tower two

Tower Two

I wanted to make this tower half the height of the other. I had a hard time finding a good enclosure, but finally decided to take the front panel of a rack-mount enclosure that I didn’t want and cut it in half. I used both halves, with a hinge between them. One half had the power supplies in it and the other half the rest of the electronics. I expanded my Arduino application to monitor 4 power supply outputs at the same time.

(I didn’t photograph the towers with the displays on because I thought they would just glare and look bad.)

I had to find a little stand to sit this on to get it up to near eye level, and settled on an old plastic speaker cabinet that was the perfect fit.

I simplified the “patch bay” to a few most essential connectors.

Result: I use the new patch bay all the time, but for some reason prefer the power supplies in the other tower. That’s probably because my current metering didn’t work out very well in the new tower.

I still use other tools quite often, including a little Radio Shack multimeter that I modified to work off an AC adapter, and a cute capacitor meter that I found online and installed in a rack-mount enclosure that sits to one side. This capacitor meter is very cool, as I often want to know cap values with more precision than they are marked – or can’t read the markings.

The Bench

This is probably the most productive bench I have ever used.

The Radio Shack temperature-controlled soldering iron is really nice, I have all my hand tools pretty well organized, and I don’t try to make it double as a table to eat at, as I used to with past workbenches in other apartments.

Yet the look of it is not yet that great, wouldn’t you agree? It still looks pretty messy.

my workbench

Part of my workbench in a unusually cleaned-up state.

Electronics Projects Update

28 July 2014
vacuum tube demo

Vacuum Tube Demonstration Project

Here’s a project I’ve had in mind for quite some time that has finally come together. The inspiration came from the item on the right; an LED lamp made in the style of a camping lantern. “I should put a vacuum tube inside that,” I thought, “you could look at it without worrying about hurting it or yourself.”

At the time I thought I could squeeze all the electronics needed to power the thing inside its bottom battery compartment. But I gave up on that; too cramped. So recently I finally put together a separate box that has all the power supplies needed plus some meters to show you what’s happening.

The display at the top left gives the approximate value of “B+” divided by ten. Below it is the voltage on the plate, also divided by ten. There is a 6,000 ohm resistor between B+ and the plate (or anode). The top right display shows heater voltage, measured directly. And below it is grid voltage, which is actually an inverted copy of the actual grid voltage, which is negative.

Here we have the heater at about 5 volts, the grid at about minus 3.5 volts, and B+ at about 136 volts. The plate is at 96 volts indicating that the tube is conducting about 136 – 96 / 6,000 amps = 6.7 milliamps. This tube is actually rated for 6 volts on the grid, a B+ of about 200 volts and plate currents of up to 30 or 40 milliamps. So I’m not stressing it (or my box) out too much.

Almost all of the materials used in this project are used. The enclosure still has its original panel label on it; a very nice aluminum enclosure. The electronics inside were cool for their day but have almost entirely been replaced with computerized equipment. The power supplies (4 – 48 volt switching supplies plus an 8.5 volt switching supply for the heater) are all used. The digital meters are new, as are most of the control electronics (but purchased from surplus suppliers Jameco and All Electronics).

I was glad to get this one materialized, as it was harder than I thought it would be.

Electronic Percussion

electronic percussion project

Electronic Percussion Project

Here’s a skimpy shot of the beginnings of an electronic percussion instrument. Most of this is new equipment, but not expensive. What you see here includes a stage rack made of black aluminum tubing, one of two BOSS percussion pads which I have had for a long time, and two new KAT pads. Each of the KAT pads has 4 sections, so the whole instrument has 10 striking surfaces in all. All the pads output audio samples of some preselected sounds. The two KAT pads also output MIDI control signals, so I can attach them to a synthesizer and play any sound I want.

Also hiding underneath these pads are used tube clamps from All Electronics. These are an important part of the project as I did not know how I would secure the pads to the stand. The clamps required adapter plates to convert from the hole pattern on the clamps to the hole pattern on the pads. For these I employed 1/8-inch-thick aluminum that was also being sold as used/surplus.

Inspiration

One of my inspirations for building an electronic percussion instrument was Gamelan Sekar Jaya, which I participated in for a year in 1980. There is the backside of I Wayan Suweca, the Balinese teacher who showed us all how to play our parts. At center-left (looking up) is Michael Tenzer, the original mastermind behind this gamelan, who bought the instruments in Bali. He’s now a music professor at the University of British Columbia.

sekar jaya berkeley 1980

Gamelan Sekar Jaya early rehearsal in Berkeley 1980

Voltage indicator

4 April 2014

This post is an experiment for me.
I don’t usually describe how I do my design work.
The objects, generally speaking, are not that photogenic, and electronics is a bit of a dry subject. But some people just aren’t familiar with it, and they should be. This is the age of electronics on earth.

most of my patch bay

My patch bay – right side.

Design opportunity and goal

While some electronics designers work within the framework of marketable consumer or industrial products, I don’t. It’s strictly “for fun” you might say. But any designer requires opportunities to do his or her work. After all, you can always buy OTS (off the shelf) if the item you want has already been designed.

I had made a “patch bay” – a kind of interconnection panel where lots of signal connections come together at the same place – for signals used to control my displays. I had purchased a blank piece of aluminum from a local welding shop, cut a slot down the middle (don’t ask me how) and drilled a bunch of holes in it for switches and connectors, then started loading it up with circuit boards.

But on the far left end I had four holes where nothing really seemed to fit: A design opportunity! I decided I wanted a voltage indicator that used four LEDs that got brighter as the monitored voltage got closer to each one’s center setting. The usual bar graph, of which I had made many using a commonly available part, uses ten LEDs that just go on when the input voltage goes above their set point, and off when it goes below. There is also a “dot mode,” which I like to use because it uses less power, where the LED whose set point is closest to the input voltage is the only one that goes on.

I didn’t want to use ten LEDs in the usual way. I wanted to use only four and have them get brighter and dimmer, the way my light panels are designed to do. I wanted each one a different color, but I only had three colors on hand, so the middle two are green, the top is white and the bottom is red. The red LEDs I have are a good deal less bright than the other colors, so I had to try to compensate for that, too.

patch bay left side

My patch bay, left side.

Dot display IC (integrated circuit)

I decided to use the dot display IC as the central component in this project. The two bottom outputs would go to the red LED. The next three to the lower green. The next three to the upper green, and the top two outputs to the white LED. You can set up the IC for so much current per output. Old LEDs required 20mA (milliamperes) to be bright. But modern LEDs only need 2. I tried limiting the current through the LEDs using series resistors. The brightest LED (white) would get a big series resistor (7K – kilohms) the green ones would get smaller ones (I think I used 1.5K) and the red would get the smallest series resistor, something like 100 ohms. These values were arrived at experimentally, and weren’t perfect, but good enough for this project.

How do you get an LED to get brighter and dimmer? You can simply drive it with more or less current. But almost exactly the same effect can be achieved by turning it on and off rapidly using a technique called “pulse width modulation” (PWM). This works because the body only takes a picture of its environment about 100 times a second. So any light flashing at about that rate or faster will appear constantly on. In technology, this is most commonly experienced when watching video monitors (or films). The picture on them only changes 30 to 70 times a second, but the motion appears continuous.

To do this with my dot display IC, I would have to make the input move back and forth through the set points of each of the dot outputs. I decided to use a “triangle wave” for this, and here it is:

triangle wave

This image is from my USB oscilloscope. There is a grid with the vertical and horizontal scales shown by the knobs. The period of this waveform is about 10mSec (milliseconds) and the amplitude is about 800mV (millivolts) peak-to-peak. So it’s oscillating at about 100 Hz (Hertz, cycles per second) and it’s about a volt high. The entire scale of my meter is 2.5 volts, so this signal should activate about 4 outputs at one time, with the one at the center of the oscillation the brightest.

I coupled this signal to an amplifier through a capacitor, then made the DC (direct current – not oscillating, or changing very slowly) level of the amplifier equal to half the input signal (0 to 5 volts). This created an input signal to the dot display IC of a triangle waveform going up or down depending on the slowly-changing DC level being measured, centered at zero to 2.5 volts, the input range of the dot display IC.

Does it work?

With the input set lower (see knob) the red LED is brighter than the lower green (by a little).

low input display

With the input set higher, the white LED is brighter than the top green.

high input display

The effect is quite noticeable, particularly to the eye (less to a camera). I was pretty happy with the outcome.

Limitations of measuring instruments

The range of voltages I use for my analog projects is zero to five volts, so that’s the only range my indicator needed to have. Since the electronics run on +7V and -5V, they can’t put out much more than 5 volts anyway.

But I noticed a funny thing happening with my USB oscilloscope when I didn’t connect it to my signal through a capacitor (to block the DC component of the signal).

clipped triangle wave

It was “clipping” off the top of the waveform! My cheap little USB oscilloscope only has a display range of plus and minus 5 volts! (at least at the settings I was using). This is a very small DC range for a professional oscilloscope, where more like plus and minus 50 volts is what is expected. This little scope had no DC offset built into the front end (all good scopes do) so if the signal goes beyond certain limits, it just disappears.

Here is a trace of the 12volt square wave that creates the triangle wave. Notice that it stops at a little under 5 volts. This means I will have to build a more compliant front end onto my scope if I want to see the entire waveforms in my 8-12volt projects.

clipped square wave

Comments?

I hope this post gives some small insight into the electronic design process. I kept it conceptual. The hardware details are VERY dry. You just look up the data sheets of the parts you decide to use and figure out how to connect the correct pins together. There are certain real-world considerations to take into account, such as using bypass capacitors on the supply pins so signals don’t get into the circuit in unexpected ways. And you have to know how to solder if you want to make a permanent circuit board. Solder is hot metal and it has stuff inside that smells pretty bad when it burns, so a lot of people don’t like it and I don’t blame them. It’s a great technology for military equipment, but hobbyists could probably get by with conductive glue.

Anyway, I rarely get real comments on this blog and would appreciate some. They don’t appear immediately; I have to go through them and approve or disapprove them.

Bye for now.

Real Rack Equipment Project

4 June 2013
Fluke rack equipment

Fluke 801BR and 803BR Vacuum Tube Voltmeters

My plan for securing my projects in better enclosures is to purchase used rackmount equipment, gut it, and use the front panel and chassis (modified as needed) to house my own projects.

The first shipment just came in. Two old Fluke differential voltmeters (means you can dial in a voltage, and the meter will tell you the difference between the voltage you are measuring and the voltage you dialed in) from Fair Radio Sales in Lima, Ohio. These both run on vacuum tube electronics (dating probably from the late 1950s) which make them too big and heavy. But removing the tubes should make them much smaller and lighter.

I have two more such units coming in. And that should do it for the time being.

Though I got these units primarily for the all-aluminum rack-width front panels (which can cost almost as much new as these cost), this equipment has a nice look to it, don’t you think? It’s rendered in classic Navy Grey with the old fluted knobs (two set screws each!) and shiny chrome handles. A classic retro look.