RSS Feed
Your Ad Here
TOP

iPhone apps for engineers and electronics

Posted by admin on November 24th, 2010

This is a collection of iPhone apps for electronic enthusiasts and engineers.

iPhone apps for engineers and electronics - [Link]



View the original article here

TOP

Active Speaker

This is a simple powered speaker that was originally intended to be used as a simple piece of test equipment. It is based around a small full-range loudspeaker that I'd inherited, which originally came from Radio Spares.
The basic idea was to mount it in a diecast aluminium box, treated to make it as acoustically ideal as possible. Then add a simple amplifier using active equalisation to extend the low frequency response and make the sound acceptable. The unit was intended to be used when servicing audio equipment, but since building this project, I finally managed to fit a pair of phono sockets into the workshop connection panel for doing exactly this...

Enclosure Design:
The drive unit (RS part number 433-309) isn't stocked any more. It's described as a 3 inch 20W 4 ohm full range speaker, but that's all I knew - RS don't even suggest a manufacturer. It's quite well-made, having a large magnet and a treated paper cone with a foam surround and a plastic dust cap to extend the h.f. output. Before proceeding any further, I had to measure the basic TS parameters:

Fs
93
Hz
Qms
2.89
 
Qes
0.69
 
Qts
0.55
 
Vas
1.57
Litres

Next I measured the volume of my spare diecast boxes. Putting these values and the above TS parameters into a calculator showed that the best box to use was one with a volume of 1.59 litres, which would provide a -3dB point of 120Hz, with a system Q around 0.78 - and while writing up this project I took the time to confirm these numbers with WinISD, which was useful confirmation.
The next problem to consider was treating the box. Try the "knuckle test" with the next diecast box you find and you'll find it rings like a bell! Clearly no good for a speaker enclosure. To stop this, I applied a layer of self-adhesive bitumen based damping material, available at car accessory shops. This transformed the box into an acoustically dead enclosure - I must admit that I was rather surprised at just how effective this was...
Next I mounted the speaker into the box. It took a while to get a good clean circular cut-out, but it worked out ok in the end. The box was pre-finished with the grey nylon coating that you can see in the pictures, so I couldn't scratch or damage this. I also mounted the phono socket so that I could connect the speaker to an amplifier.
At this point, the system resonance was 140Hz, not too far from the prediction (which didn't include the volume taken by the driver). I added some stuffing, which lowered the resonance to 132Hz - this works because it causes the driver to "see" a larger volume of air. Next I sealed the box, as I thought I could hear some tiny air leaks, which brought the system resonance down to 128Hz.
Listening to the driver directly from the workshop hi-fi, I was surprised at how good this cheap drive unit sounded. Don't get me wrong, I'm not claiming this was hi-fi or anything, but certainly better than you might expect, and there was no hint of extraneous noises coming from the enclosure. So the next stage was to experiment with the electronics - for this I just used solderless prototype board and played around until I was happy with the sound.
And here's the final result. From left to right, there's the input connector (gold-plated, so it must sound good ;-), the volume and tone controls, the green power LED and the red clipping LED.
Front view (10K) Rear view (9K)

And here are some internal views, showing the damping material and stuffing. Note the gaskets around the driver opening and the edge of the box - as mentioned, these proved to be very necessary. The bass quality can be heard to improve as the screws are tightened! There's similar gaskets surrounding the IEC socket and mains fuse.
Inside (13K) Inside (11K)

This is a closer view of the electronics. The power IC is bolted to a 6mm piece of aluminium, which is held to the front of the box by the potentiometers. The expensive blue pots were the only things I could find with long enough bushes to reach through the aluminium and the front panel - luckily they were "recycled"! The two LED's are connected to the brown wires, and held in place by a small piece of damping material which also stops air leaks.
View of the electronics (38K)

Circuit Details:
The electronics is based around a dual op-amp (LM833) and TDA2030 power amp IC. Click the thumbnail to view the complete schematic..
Schematic of the Powered Speaker - Click to enlarge
As you can see, it's mostly straightforward stuff, although there are one or two unusual bits, such as the tone control and frequency shaping section, and the clipping detector.

Input buffer:
Input section (7K)
This is the input section, starting with an ultrasonic filter that turns over at around 150kHz with typical source impedances. This is just a simple (and essential) measure to stop the input op-amp picking up cellphone noise, etc. From the volume control, the non-inverting op-amp stage has a voltage gain of 20dB. The low frequency -3dB point of this stage is around 13Hz - this might seem unreasonably low for such a small speaker, but the system LF behaviour is formally set by the next stage...

High-Pass Filter:
High-pass filter (9K)
Directly after the input buffer is the high-pass filter. This is a second-order Bessel filter, chosen for its superior in-band phase response and step-response, compromising on flatness of frequency response, which is pretty academic with this sort of loudspeaker. Chapter 5 of The Art of Electronics by Horowitz and Hill gives a really good introduction to active filters
With the values shown, it turns over at 75Hz. The output from the speaker has fallen by about 10dB at this frequency, so there's little benefit to feeding lower frequencies into it - this will just waste energy.

Tone Control and Equalisation:
Tone control (6K)
Following on from the HPF stage is the tone control and equalisation section. This might look slightly strange at first, but the basic idea is to use capacitors to shape the frequency response.
The 22K resistor forms a potential divider with the 4K7 resistor (the one connected to ground). At mid-range frequencies the 2n2 capacitor is open-circuit, and the 120n capacitor is short-circuit. Therefore the attenuation is around 15dB.
But the 4K7 and 2n2 combination bypasses the 22K resistor at high frequencies, providing treble boost. Assuming the capacitor looks more like a short-circuit, the attenuation is only 6dB, or in other words, there is a HF lift of around 9dB.
The 4K7 and 120n combination provide bass boost in a similar fashion. At bass frequencies, the 120n capacitor looks more like an open-circuit, meaning that the 4K7 resistor does not play a part in the potential divider. As the impedance of the next stage is 22K, the attenuation here is also 6dB, so there's a 9dB bass lift...
The tone control is able to remove this bass boost by short-circuiting the 120n capacitor (with the control full clockwise). When the control is fully anticlockwise (bottom of diagram), the 22n capacitor is connected in series with the 120n capacitor to the bottom half of the potential divider, effectively cutting the HF response. With the control in the centre position, it doesn't really play a significant part in shaping the response of the bass and treble boost circuits.
Just to prove all this works, here's a simulation of the complete circuit showing the gain from the input right up the output of this stage. The power amplifier is excluded as this can be assumed to have a flat frequency response. Click the image to see a larger version...
Simulation of the frequency response (11K) - Click to enlarge
The white trace is the response with the tone control in the centre position, the green trace shows the treble-cut achieved with the tone control at minimum, and the blue plot shows the bass-cut that occurs when the tone control is set to maximum. The simulations confirms the numbers discussed above, which were "worked out on the back of an envelope".
This sort of frequency response shaping used to be very popular with transistor radios and TV sets in the "good old days". Ever wondered why old Roberts and Grundig radios sound so nice? Unfortunately, many manufacturers don't seem to bother these days...

Power Amplifier:
Power amp (9K)
The power amplifier stage is pretty much straight from the datasheet. The gain is 11 (21dB), but the 22uF capacitor reduces the gain to unity at DC to prevent DC offsets appearing across the voicecoil. This measure is less necessary with newer chip-amps like LM1875's, etc, so it's common to see this component omitted. The 1n4001 diodes are 'catch' diodes to prevent the inductive load of the loudspeaker causing voltage spikes that might be greater than the supply rails - again these are much less necessary with modern chip-amps that employ measures like "SPiKe" protection - check the datasheets carefully. The amplifier is decoupled with 100n capacitors mounted next to the IC, and as the main power supply capacitors are only a few centimetres away from the IC, this is perfectly acceptable. Finally, there is a Zobel network to ensure the amplifier remains stable with the inductive load of the loudspeaker. This also improves the amplifiers susceptibility to RF ingress.

Clipping Detector:
Clipping detector (9K)
Finally, this is the clipping detector. I had some spare space on the circuit board, and this was an idea that I'd wanted to try for some time now...
The basic problem with conventional clipping detectors is that they trigger at some preset absolute threshold - which doesn't take into account the actual values of the supply rails. As power amplifiers are most often supplied by unregulated power supplies, this is a serious shortcoming. The detector threshold would have to be set up to trigger during worst-case instances of low mains supply and maximum supply voltage sag. But under more favourable conditions, the clipping indication could be triggering several dBs below maximum output.
So this design responds to the difference between the output signal and the supply voltages. Under normal operating conditions, both transistors are conducting, and the LED inside the opto-coupler is on. This means the transistor in the opto-coupler is on, so the BC548 and red LED are both off.
Should the output get within around 2V of either supply rail, the appropriate transistor will switch off. This means the opto-coupler LED will extinguish, hence the 27K resistor can supply base current to the BC548, turning the clipping light on.
This circuit could be improved in a number of ways. For a start, there is no form of "pulse stretching", so very brief transients or HF clipping might not be seen. As there is so much bass boost in the preamp and no tweeters to burn out, I didn't worry about this here. Also, it is relatively tricky to adjust this circuit to respond to different power amplifiers - not all of them can actually get to within 2V of the supply rails under all load conditions. In addition to the resistor values, the number of 1n4148 diodes determine this threshold - adding another diode to each subtracts around 0.6V from the threshold. This is fine at the prototype stage, but a pain to adjust once you've etched the PCB!
Since building this, I've found a similar circuit on Rod Elliots site. Compared to my circuit, I think that the comparator makes it slightly more complicated - I much prefer my opto-coupler arrangement. But I think that the arrangement of the detector transistors is probably better because they can switch off faster, hence it will respond to HF clipping more effectively. Not an issue for this application, but I will be investigating this when I start the power amps for my ATC's

Want to build one?
Following a recent request from an interested constructor, I've scanned the diagram of the Veroboard layout that I designed while building the unit. The original pencil drawing had plenty of corrections as it evolved, so it isn't the clearest diagram in the world. There are no component markings - at the time, the circuit was "in my head"; labels would have just cluttered the diagram.
Also note there are small differences between this drawing and the actual unit - this is because of possibilities which become apparent at the construction stage, obviously there's no point modifying the drawing at that stage because this was a one-off. The track cuts are signified in two ways - most obviously the "X", but also (indirectly) the lines drawn I've drawn to show continuous tracks. Take care, because I've just spotted a missing X!
There are circuit differences too. The layout shows two diodes per transistor for the clipping detector, but on testing, I decided to reduce this. Also, I planned to have Zener diodes to regulate the supply to the op-amp, but these weren't needed in practice. Stick with the LM833 - others might produce pops and bangs when switched on/off (certainly TL082's did, but that's not unusual IME). And be realistic - NE5532's or OPA2134's would be complete overkill! Obviously, the clipping detector is optional.
I'd strongly recommend you follow my approach: build the speaker into a box, and experiment with solderless prototype board until you're happy with the sound. For example, a larger drive unit might benefit from a lower frequency HPF (increase the 82n capacitors). The deliberate dip in the midrange designed to suit my small driver might cause better drivers to lack "presence", in which case, alter the component values around the tone control. Having said that, this EQ should make most non-hi-fi speakers sound bearable, or even "nice"!
Regarding mechanical issues, the aluminium bar was used principally to avoid visible fixings on the front panel - the TDA2030 bolts to the bar, and the bar is held in contact with the case by the two potentiometer bushes. Feel free to omit the bar if you don't mind the screwhead on the front panel, although note that this makes servicing more difficult. Don't forget to insulate the tab of the IC from the case, as it's connected to the negative supply rail. If the front panel is wood, you must arrange for some form of heat sink for the IC - although it can be tested briefly with no heat sink, it must be cooled effectively in use. Should it overheat and fail internally, it will probably destroy the loudspeaker!
If you're tempted to make changes to the layout, don't! Especially don't alter the earthing or power supply arrangements! Doing so will lead to an increase in distortion or maybe even cause the amplifier to "hum". Finally, I'd recommend that you build this very carefully, working your way logically through the circuit as you go. Don't just blindly follow the layout - like me, you'll need to have the circuit in your head (being forced to work out the component values will help here). While this circuit is not complicated, and it doesn't look particularly cramped, there was a lot of work to fit the circuit onto the board. Moving things just one hole might stop other things fitting!
Despite the above, it's not too difficult really. If anyone succeeds in making this work, please send me details of your version, and a picture or two. Good luck!
Click the image for a larger version.
Simulation of the frequency response (11K) - Click to enlarge

TOP

14 watts of power amp

Te audio amplifier shown below provides 14 watts of power, but can provide much more simply by increasing the power supply voltage. This amp was built in 1975 and has worked reliably ever since. The power amp portion was published in Popular Electronics in the mid-1975s. I added a preamp and bass and treble controls. This amp has extremely low distortion and is relatively insensitive to the choice of components.
                   
The power amplifier is actually a discrete power op-amp. As such the gain is set by R18/R23. The pre-amp has a voltage gain of 10, for an overall gain of approximately 150. I recommend non-polarized capacitors for C2 and C9, even though the schematic shows that I have used polarized capacitors. Modern op-amps,with the same pin-out as the op-amps shown in the schematic, can be used in the pre-amp portion.

Download the audio amplifier Orcad Schematic File


The available output power is limited by the power supply. Up to 70 watts output has been achieved with this topology, however parallel output transistors should be used to insure against damage, at higher power levels.


Download the power supply Orcad Schematic File


Examples of Modern Amplifiers

20 watt amplifier using the Philips TDA1554 IC.

Mini power amplifier using National Semiconductor IC.

TOP

VHF Oscillators for Overtone Crystals

VHF overtone crystals can be difficult to use due to the many frequencies at which the crystal is perfectly happy to oscillate. A typical 100 MHz, 5th-overtone crystal will oscillate at approximately 20 MHz, 60 MHz, 100 MHz, and even 120 MHz, not to mention other, unintended modes that such crystals often have. Most VHF overtone oscillators use some sort of tuned circuit or frequency selective filter to select the desired mode and reject the other, equally active modes. The oscillator circuit shown below uses a simple tuned circuit to select the desired mode and is suitable for VHF crystals, including high overtone types.
A tank circuit in the collector of the exciter transistor is tuned to the desired crystal resonance, either by a trimmer capacitor as shown in the schematic or by a variable inductor in place of the 0.1 uH. The frequency of the tank is determined by the 0.1 uH choke, the parallel 9-35 pF trimmer capacitor, the series combination of the 15 pF and 39 pF capacitor and the reactance of the collector of the transistor and other stray reactance. The 15 pF and 39 pF provide a low voltage "tap" for driving the crystal and the output buffer.
In practice, the two selected components in series with the crystal would be replaced with jumpers and the tank would be peaked for maximum signal on the 39 pF, observed with a very low capacitance probe. Alternately, the trimmer may be set to the middle point between the extremes where oscillation stops by observing the output of the gate. Once the optimum tuning is achieved, selected components are added in series with the crystal to center the frequency. Either jumper position may be used for fixed tuning or a mechanical trimmer could be added on one side and an additional selected component could center the tuning range. Splitting the tuning to both sides of the crystal in this manner reduced the voltage levels due to these reactances. Adding inductance in either position will lower the frequency and adding capacitance will raise the frequency. For applications where a fixed value is selected to center the frequency at design time, the frequency may be adjusted for individual crystals by adjusting the tank tuning, as long as the tuning doesn't get close to the point where oscillation stops.
The two schottky diodes in series with the 180 ohm resistor limit the signal swing at the collector, keeping the transistor in a linear range. The resistor tends to remove the diodes' capacitive contribution to the tank which can cause start-up problems. The smaller signal at the 39 pF should be adequate for directly driving fast CMOS logic as shown, without overdriving the input of some "Tiny Logic" types that don't have the robust limiting diodes that AC has. The schematic shows the output directly from an AC gate, typically a 74AC04, but a 50 ohm resistor in series with a 0.1 uF capacitor could be added in series with the output for driving 50 ohm loads. Check the specification of the chosen logic device to determine its load capabilities.
The MPS6511 is a relatively fast transistor but many types will suffice. A 10 ohm resistor is added in series with the emitter to help stabilize the grounded-base circuit.
A quick prototype was constructed to verify the circuit:
Large, leaded components were used to make it easier to trace the circuit. Parts are soldered to little "islands" of pcb material on a tinned copper-clad ground plane. A pcb SMT carrier board holds the 74AC00 gate (I didn't have a 74AC04 handy, so I tied one input of a NAND gate high to make an inverter). Only one input of one of the gates is used and the other input is tied to the positive supply. All the other gate inputs are grounded. The output of the gate drives the 49.9 ohm resistor and 68 pF capacitor that would connect to 50 ohm coax. The crystal is a 100 MHz, 5th-overtone AT-cut manufactured by Croven Crystals.
The circuit adjusts smoothly with a nice peak in amplitude without jumps or sudden dying except when the amplitude has rolled off significantly. Once the large trimmer was set to the middle of the active range, tuning components were inserted in place of the two jumpers on each side of the crystal with no problems observed. A complex tuning network could be added to the crystal circuit with a varactor or trimmer capacitor in place of one of the jumpers and a selected component in place of the other.
(The 470 ohm at the top of the photo is shorted and not needed.)

Here's an simple experimental circuit using the readily available TL592 differential amplifier. In this circuit, the overtone mode is selected by a tuned circuit between pins 1 and 8. The phase shift due to the roll-off of the amplifier, the 100 ohm resistor and 22 pF capacitor, and the frequency of the tank combine to give the necessary 180 degree phase shift. In order to prevent feedback through the crystal's shunt capacitance, a selected inductor in series with a 100 ohm resistor is placed across the crystal. The inductance should be selected to resonate with the holder capacitance of the crystal, typically 680 nH for a 100 MHz crystal. When the value is selected correctly, the oscillator will only oscillate on a crystal-controlled frequency with the oscillation dying when the tank is tuned too far from the crystal's frequency. The 100 ohm is necessary to kill the Q of the inductor.
In operation, a rather large voltage is applied to pin 1. As a result, the differential amplifier is acting like a bandwidth-limited comparator, switching as quickly as it can. The large signal helps to reduce phase noise due to the amplifier's input noise. The crystal may be tuned over a wide range by the inductor and the range is somewhat a function of the amplifier gain. The prototype would tune 30 ppm with the 1k, 15 ppm with no gain resistor, and as much as 50 ppm with a 470 ohm gain resistor. Higher gain (lower value resistor) can lead to oscillation at one of the lower frequency crystal modes. The circuit was tested with a TL592 but the lower noise TL592B should also work. The output voltage is about 1 volt p-p but an additional buffer is recommended for driving a low impedance load. A single AC logic gate could be added as in the previous circuit. The variable inductor could be replaced with a fixed value and a combination of a trimmer capacitor and fixed value could replace the 39 pF.

TOP

Op-Amp Audio Amplifier


schematic

The above circuit is a versatile audio amplifier employing a low cost LM358 op-amp. The differential inputs give the amplifier excellent immunity to common-mode signals which are a common cause of amplifier instability. The dotted ground connection represents the wiring in a typical project illustrating how the ground sensing input can be connected to the ground at the source of the audio instead of at the amplifier where high currents are present. If the source is a power supply referenced signal then one of the amplifier inputs is connected to the positive supply. For example, an NPN common-emitter preamplifier may be added for very high gain and by connecting the differential inputs across the collector resistor instead of from collector to ground, destabilizing feedback via the power supply is greatly reduced.