- Published: Monday, 20 June 2016
- Written by Jon Chandler
- Hits: 3856
My FAA Wake Turbulence Timers have been installed at 10 test sites for a year. The evaluations from the Air Traffic Controllers who have used them are favorable, but one requested feature was a volume control for the piezo beeper used to signal the end of the countdown period. In some towers, the beeper was just the right volume, but in quiet towers, it was way too loud. This didn't seem like a difficult problem to solve.
The beeper used was actually a magnetic beeper - it's an active beeper, requiring only the application of 5VDC to sound. An active piezo beeper could just as easily be used, so I started with a search for controllable-volume piezo beepers. There are indeed piezo beepers with a volume control - a mechanical shutter to control the size of opening of the sound exit. Beepers of this type are huge and not suited to my application where the maximum beeper diameter is about 16mm.
Note: For more information about the Wake Turbulence Timers, please visit the website that has been created to provide information to Air Traffic Controllers. This site was created to spread the word about the timers and to break the log jam in the approval process.
Next, I searched for an electronic means of controlling the volume. I found some discussions about controlling the volume of a driven element - a beeper that contains no driver and is driven with a square wave. By controlling duty cycle, it's possible to obtain some degree of volume control. The range of volume control is limited and I didn't want any additional burden on my microcontroller, so this option was out.
With some degree of naiveté, I thought the simple answer would be to drive an active beeper with a PWM signal and vary the volume by changing the duty cycle. If the beeper is only on half the time, it should be half as loud, right? I connected a beeper to the PWM output on a TAP-28 board and convinced myself that the idea had merit and should work.
On the Wake Turbulence Timers, all of my port pins are in use, with the exception of the two pins on the ICSP (In Circuit Serial Programming) connector. My concept was a small board that could hang off this connector, with a PWM chip (PCA9633) controlled by the I2C. The normal beeper 5-volt signal would enable the output of the chip, and a PWM signal would drive the beeper via a transistor. The level would be set via I2C when the timer isn't running, and no changes would be required to the code to make the beeper beep.
One difficulty with hanging the volume control board from the ICSP connector arises from the orietation of that connector between the two primary versions of timers. It was never envisioned to use this connector for anything but programming the timer, and the orientation of the connectors is reversed between boards. My solution to this problem was to install the 6-pin header on one side of the board or the other depending on which version of the timer it would be used with. This meant some extra work setting up the board, but eliminated having two different versions.
The result is a small board with one chip on it - an I2C PWM chip for driving LEDs (there's also an inverter to change the sense of the enable signal and a transistor to drive the beeper). To cut to the chase, testing a beeper with this board when I got it back revealed there was a small range of volume control...with a large pitch change across the range and generally crappy sound. Back to the drawing board.
Additional searching turned up a section on controlling piezo beeper volume in a Malloy Application Guide. It is possible to use PWM to control piezo beeper volume after a fashion. If the PWM signal is used to create a variable DC voltage, the volume of the beeper will vary with applied voltage. But the usable range is small, and it depends on varying the voltage over the entire operating range of the beeper.
A possible solution would have been to use a DC-DC convertor to make 20VDC and then use PWM to vary the voltage to the beeper over a 3 - 20 volt range. This seemed like an complex approach to provide a marginal solution at best.
My next plan was to build an audio circuit to drive a speaker with a tone. Research found the Keterex KX1400 Audio Playback IC. This chip can play back an audio file (something I needed for another project) or a tone from a built-in tone generator. It includes volume control and a power amp. All that's needed is a speaker. Perfect, or so I thought. Keterex sold the design to another company and these chips are no longer made.
Next on my list of ideas was the MSLOSC chip from Mixed Signal Integration. This chip is a programable sine wave generator and includes volume control over a 63dB range. All that's needed is a power amplifier chip. A two-chip solution to my problem. Not bad. There are two chief limitations to using this chip in my design. The first was it uses a 3-wire serial interface; I have only 2 port pins available on the ICSP connector. I do have one additional pin available that's brought out to a 2-pin header for selecting options, but using it would have created a spaghetti monster of cables to connect the board. The other limitation is that these chips aren't available in small quantities; MSI offered to supply them in smaller quantities, but those quantities were still more than the FAA would commit to buying.
I decided the way to get what I wanted was to roll my own. Start with a square wave oscillator, run the signal through a digipot to control the level, integrate the square wave to a triangle wave (which rolls off the high frequency components of the square wave, making a more pleasant sound) and run the output through a power amplifier chip to a minature speaker. That sounds do-able. There are many options for the square wave oscillator, the simplest being a 555 timer.
I came across the perfect choice for the oscillator, Linear Technologies LTC6904 I2C-programmable-frequency oscillator. I didn't really need a programmable frequency oscillator, but knowing my audience, I knew whatever frequency I selected, someone would probably complain about it. The LTC6904 frequency is programmable from 1KHz to 68MHz; obviously I only need a small part of that range for what I'm doing but it would serve the purpose well. This chip also has an enable input, perfect for triggering the beeper output. A On Semiconductor CAT5171 digital pot was used along with a TI LM4861 1.1w audio amp chip. A PUI AS01508MR-R 15mm speaker capabile of 1.8 watts was used for the output.
You might question whether 1kHz was a low enough frequency range was low enough for the oscilator. Two considerations entered into that choice. First, the existing beeper frequency was 2.2kHz. A bigger factor was the usable frequency range of a 15mm speaker. As the plot shows, below 1kHz, the speaker response falls off rapidly.
My analog design skills aren't quite as good as my digital skills, so the first design was defficient in several areas. The first board did not work well for a variety of reasons, notably, the LTC6904 is not capable of driving much load and a buffer stage was needed between the digital pot and the integrator stage.
Rev 2 of the board corrected the deisgn issues and was sent for fab. A major improvement to the design was a change in the mechancial arrangement; instead of a single 6-pin receptacle, a 2x6 dual row receptacle was used. When used with a keyed header on the timer boards, this design forces the correct connections to be made without any extra work. Further testing of the first board and code development showed another issue. I switched off the oscillator to control the beeping of the circuit. With the board piggybacked against the timer display board, a lot of noise was picked up from the multiplexed signals when the beeper should have been off. It was quite a racket and varied with the display. When the beeper was activitated, the sound was quite good - attention-getting but pleasant.
The solve this problem, rev 3 was laid out and sent off to fab before rev 2 was even received. Instead of switching the oscillator on and off to control the output, the AMP was switched, using its enable input. Fortunately, this come be accomplished without moving any of the components on the board so a new solder paste stencil didn't have to be made.
Rev 3 worked quite well...at mid-volume levels and higher. The tone was attention-getting but pleasant, and the volume steps from the midpoint up were evenly spaced. Table 8.1 in the Microchip datasheet for the MCP454x digipots explains how to get even logarithmic steps from a linear digipot; I should have been able to achieve a 48dB range in volume with fifteen 3dB steps. Below the midpoint however, there was little change in volume. I quickly recognized the problem. The oscillator feeds the digipot, providing a variable level to the integrator stage. The integrator stage doesn't handle low levels well.
Rev 4 was clearly needed; conceptually a minor change. The integrator stage should be before the digipot, so that it's alway operating on a full-level signal. The ends of the board stayed the same, but the middle section had to be re-arranged.
And the result? Rev 4 works exactly as originally conceived. Approximately a 48 dB range in volume levels with a pleasant sounding tone the result. I'm allowing adjustment of the frequency of the oscillator from 1kHz to around 5kHz to match the range of the speaker and the working range of the integrator circuit. The beeper is activated when the amp is enabled; these is no popping or other noticable noise when the amp is enabled/disabled. Rev 4 achieves the desired results quite well.
The original design idea used a single I2C PWM chip and a few other components. Revision 1 used 5 chips (oscillator, digipot, opamp for the integrator stage, amp and inverter for the enable input) plus 16 resistors and capacitors. Rev 2 - Rev 4 all use the same parts, 6 chips (oscilator, digipot, opamp for the integrator stage, opamp voltage-follower buffer, and a dual buffer for amp enable and oscillator buffer) plus 19 resistors and capacitors. It's almost unbelievable that the board to provide a variable-volume beep has a BOM the same size as the rest of the timer!
You may have noticed in the pictures. The boards went from green to red to blue...the piles of less-than-useful boards were getting hard to differentiate!
I could have settled for Rev 3 with a limited range of volume control and in most cases, it would have worked fine. But since this board will be duplicated 30 times more after the initial batch of 10 boards is delivered and potentially a thousand times more when approvals and funding are received, it made sense to me to do it right.
Projects don't always proceed as planned, but if the problems are analyzed and understood, each revision to a design can be an improvement. The revisions, in addition to just making the circuit work correctly included a significant improvement in connector design. The original concept required soldering the header on one side of the board or the other depending on which version of the timer it would be used with. The dual-row improvement eliminated that requirement and eliminated the possibility of plugging in the board backwards.
This design is also effective. Upgraded firmware is required to use this add-on board. But the firmware recognizes if the board if installed. If it's not, the orginal beeper works as expected. The firmware in all of the timers can be upgraded to get the necessary updates in operational charaacteristics without requiring installing the audio beeper replacement board.
One additional comment about assembling these small boards. The LTC6904 is in an MSOP package with 0.65mm lead pitch; I could not find a similar part in a larger-size package. The CAT5171 is in an 8-lead SOT23 package, also with a 0.65mm lead pitch. I usually use my solder paste dispencer to apply solder paste, but it's not possible with such fine-pitch parts - a stencil is the only way to deal with parts this small.
Elecrow makes high quality stainless steel stencils. When ordered with a batch of boards, the price is very reasonable at around $16. I have paid much more to have stencils cut from Kapton film - these work but don't have nearly the durability of a stainless stencil. Eagle and most other PCB layout programs make a paste layer when the Gerber files are generated. When ordered with your boards, they make several design decisions based on the board, resulting in a high quality stencil.