This is only a preview of the January 2022 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
Balanced Input and
Attenuator
for the USB
Part 2 – by Phil Prosser
As described last month, this add-on board for the USB SuperCodec
provides two balanced inputs with four attenuation options: 0dB, 10dB, 20dB
and 40dB. It will fit in with the SuperCodec (in the same instrument case),
resulting in a sleek all-in-one recording and measurement instrument. Now
let’s get onto building it!
A
ll of the components shown and described
in the circuit last month fit on a single PCB which is
quite quick and straightforward to build. The wiring
to connect the two boards isn’t too difficult to make up either,
consisting of one stereo shielded cable and one three-wire DC
supply lead. The case end panels need to be drilled differently than what was described for the original SuperCodec.
The first step in assembly is to mount all the main components on the printed circuit board. Before assembling it, if you
have an accurate resistance meter, you may wish to measure
the 0.1% tolerance resistors and find the best matched sets
among those you have purchased. However, that is optional.
As long as they meet the specified tolerances, the performance
of your unit should be close to that of our prototype; it might
even exceed ours, if you’re lucky.
Tip: if you can match resistors between the ‘hot’ and ‘cold’
legs of each channel, you will get a useful improvement in
common-mode rejection but this may not be possible depending on the resistors you purchase and the accuracy of
your ohmmeter.
If your ferrite beads are the loose types, feed resistor lead
off-cuts through them. Keep them tight on the board, and it’s
a good idea to use dobs of neutral cure silicone sealant or
similar glue to stop them from moving and rattling.
Next, mount all the zener diodes and the 1N4148 signal
diodes. Be careful to orient the diode cathode stripes as shown
in Fig.9, as they don’t all face the same way.
We have specified 3.9V zeners for ZD3 and ZD4, but any
value from 3.3V to about 4.7V should work, as these just
establish a protection voltage.
PCB assembly
We have made an effort to use only through-hole components
for ease of construction and made room for relay switching
of the attenuators rather than a rotary wafer switch.
Before starting construction, you will need to determine
your desired input impedance. Review last month’s article
and then refer to the parts list to see which parts you will need
for your selected option. The add-on board (coded 01106202,
available from the PE PCB Service) measures 99.5 × 141.5mm.
Refer to overlay diagram Fig.9 during construction.
Start by loading the low-profile components: ferrite beads
FB1-FB4 and all resistors. Make sure that the 0.1% types go
in the specified locations.
Because the board is a tight fit in the SuperCodec case,
some electrolytics must be installed horizontally, as shown
here. Indeed, in some cases, they lie horizontally spaced
above other components.
32
Practical Electronics | January | 2022
Now install the electrolytic capacitors, which are also
polarised; their longer leads must go into the pads marked
with + symbols. The 10µF capacitors must be laid down
flat as shown in the accompanying photograph, or selected as very low profile units. This
is important, as we will be squeezing
this board into the box with the USB
interface, ADC and DAC.
Next, fit the remaining capacitors
(plastic film and ceramic). Remember
to use 10µF plastic film capacitors
for the coupling caps if you’ve chosen
resistors for a 10kΩ input impedance,
or 1
1µF for a 100kΩ input impedance. These
too must be laid over on their sides to clear
components on the other board.
After that, solder the six NE5532 ICs and eight
relays. The IC and relay orientations are critical.
All the relays are orientated with pin 1 away from
the input connectors, while all the op amps have
pin 1 toward the inputs.
You can mount the ICs on sockets, but we prefer not
to as the contacts can oxidise over time, leading to poor
connections. If using sockets, solder them with the orientations shown, then straighten the IC pins and carefully
push them fully into the sockets.
Mount the connectors next, followed by the input select
switch. The two right-angle polarised headers can be soldered from the top side, but it’s a good idea to solder the pins
on the bottom too. Follow with the two 6.35mm TRS sockets.
Make sure these are the specified low-profile types and
that they are fitted snug to the board.
Your add-on board is now be finished. The three boards
are connected by several cables, which we will now describe.
Making the internal cables
The output of the Balanced Input Attenuator board is
connected to the USB Sound Card board by a 180mm
length of shielded cable. To make this, cut a piece of figure8 shielded cable to 180mm, strip 18mm off the sheath at
each end, twist the screen wires together and apply the
2.5mm diameter heatshrink to these.
Then put the 5mm heatshrink over each coax line and
shrink, as shown in the photograph below. Crimp pins on
each end and insert them into the 4-way plug as shown.
The middle two pins are earth while the outer two pins
are for the signal wires.
Preparing the SuperCodec board
If you haven’t already built the USB Sound Card board, as
per the series of articles in the last three issues, do that now.
But note that there are two things you need to do slightly
differently when building it:
1) Do not mount the two 6x2-pin 2.0mm pitch header sockets
on the back of the board for the MCHStreamer. We will
instead be soldering pigtailed connectors to these locations, to allow us to mount the MCHStreamer above the
USB Sound Card board.
2) When building that board, make sure the voltage regulator
that is not mounted on a heatsink is pushed right down onto
the PCB, or it may foul the Balanced Input Attenuator board.
The output cable should be 180mm of twin screened
coaxial cable. The middle two pins are the shields.
Practical Electronics | January | 2022
Having completed that board (minus the MCHStreamer
connectors), the next step is to solder a power cable to it,
which will plug into the Balanced Input Attenuator board
and power it.
To do this, take 100mm lengths of red, green and black
medium-duty hookup wire and attach them to crimp pins,
then push these into the power header, as shown in the
photograph below. Red (positive) is at the right-hand end,
ground (green) in the middle and black (negative) at the left.
Power cable and
header for the
attenuator board.
Sleeve the whole cable in a heatshrink tubing sheath, with
around 3cm of each wire protruding, then strip the insulation back by about 5mm on each wire and tin the ends.
These bare ends are then soldered to component pads on the
SuperCodec PCB. The photo below shows where they go.
Check you have the wires in the right spots! The black
wire goes to the end of the corner-most 10Ω resistor that
is closest to the board edge; the red wire goes to the same
end of the adjacent 10Ω resistor; the green to the end of the
adjacent 5.6kΩ resistor that is furthest from the board edge.
Once you’ve done this, double-check that the wires go into
the appropriate positions on the plastic block at the other
end; otherwise, there will be trouble when you plug it in later.
Connecting the MCHStreamer
The next step is to connect the MCHStreamer to the SuperCodec board, but we are doing it differently than for the
standalone USB SuperCodec. Otherwise, it is impossible
to fit the Balanced Input Attenuator in the same case.
Rather than plugging the MCHStreamer directly onto the
SuperCodec board, it connects via two 12-way plugs that
connect to the board via sets of 12 flying leads.
We need to solder the power cable to the main PCB as
shown. Try to hook the wires around the resistor leads
and keep things tidy!
The plugs with attached leads should have come with the
MCHStreamer unit. To prepare them, measure and cut the
pigtail wires to 50mm (5cm), as shown in the photo.
The MCHStreamer is supplied with pre-wired headers.
Trim the leads to 50mm as shown. We need to keep these
as short as practicable.
33
10F
When plugged into the headers, the MCHStreamer ought to
sit as shown above. A tight fit but without stressing parts.
Cut all the attached wires to this length and strip, twist
and neatly tin 5mm at the ends. Note that while the plugs
supplied have black wires on one side and red on the other,
they will plug in either way around, and while there is a
ground pin on one side, most of the pins carry signals. So
it isn’t critical which way around you solder them.
The best approach to soldering these to the sets of twelve
pads on the PCB is to stand the connector vertically and
looking from above, solder the inside row of wires to the
outside row of holes in the PCB. We will be plugging this
to the top of the MCH Streamer, which will swap the inside
and outside rows of wires, as shown in the following photos.
With the two cables soldered in place, present the MCHStreamer to the pigtailed headers and fold them as shown
in the photo. The result is somewhat tight, but does fit
inside the box.
10F
Watch the
orientations of
IC1-IC6, RLY1RLY8 and all
the electrolytic
capacitors and
diodes. The
other parts
either only go
in one way, or it
doesn’t matter.
Make sure to
trim all soldered
leads close to
the underside
of the PCB to
prevent them
shorting against
the case later.
10F
Fig.9: use this
PCB overlay
diagram and the
photo below as
a guide during
construction, to
see where the
components are
mounted on the
board.
10F
You may notice
that diodes
D5-D8 are
missing from
this photo – they
were left off the
prototype to
verify that they
had no effect
on performance
(they didn’t!)
but were
added later.
Constructors
should fit all
eight diodes
(D1-D8) as
shown on the
component
overlay above.
34
Practical Electronics | January | 2022
Fig.10: this shows the sizes and shape of the front and rear panels (front
panel at the bottom), and where to cut or drill holes in them. The 3mm
hole below the 7.5mm hole only needs to go partway through the inside
of the panel. The ventilation holes shown in red are optional, but do help
to keep the internal components at a reasonable temperature in hotter
environments, so are recommended. (You can download this diagram
from the January 2022 page of the PE website.)
Testing
Before inserting everything in the case, it’s a good
idea to make sure it’s all working. If you haven’t
already tested the USB SuperCodec board in
isolation, do it per the instructions in the third SuperCodec article. This will also involve installing
the MCHStreamer drivers and getting it working
on your computer.
Power down the SuperCodec board and plug
the power connector from the SuperCodec PCB
into the three-pin header on the Balanced Input
Attenuator board (CON3). Then use the length
of shielded cable with plugs on either end you
prepared earlier to connect the audio output of
the Attenuator (CON4) to the audio input on the
USB Sound Card (also CON4).
For the outputs, make up a twin shielded cable
with RCA chassis connectors on one end and a
4-pin polarised plug on the other, as per the final
SuperCodec article (if you haven’t already). Plug
this into CON5. Make sure the whole rig is resting on a non-conductive surface, and nothing can
short to anything else before proceeding.
Now would be a good time to check, using
a continuity tester, that the +9V and –9V rails
on the two boards are connected the right way
around and not swapped. Check for 0V continuity
between the boards at the same time. Then, with
the MCHStreamer plugged into the USB Sound
Card, plug in the 12V supply to power the whole
assembly up.
Assuming it passes the ‘smoke test’, verify that
all the supply rail voltages are still correct. You
would have tested these with the SuperCodec
alone already, but a fault on the Balanced Input
At this stage, it’s worth checking both PCBs to make sure
that you trimmed all component leads neatly. If you’ve left
any long, they could interfere with, and possibly short out
against the case once inserted into it. There is adequate
room below the USB Sound Card to accommodate normal
lead lengths; you should not have any problems provided
you are tidy.
Fig.11: if you drilled the ventilation holes on the rear panel, you
should also drill some holes towards the front of the bottom panel, as
shown here. These allow cool air to be drawn in via convection, which
flows along and cools the two boards before exiting through the holes
at the top of the rear panel.
Practical Electronics | January | 2022
When soldering the MCHStreamer connector
to the board, the red and black rows of wires
need to cross over as shown.
35
Assembly is tight, but
with the cable lengths
recommended it allows
the Balanced Attenuator
to slide out enough to
allow the output and
power connectors to be
plugged in. Watch for
the cables snagging
on parts on the
SuperCodec main
board though.
The MCHStreamer is
fixed to the rear panel using an
insulating bush kit. Don’t forget this!
Attenuator board could cause them to be wrong now. Assuming they’re OK, check that the attenuator relays work; each
time switch S1 is moved, it should generate a nice click from
the relays.
Then plug the whole device into your computer and repeat
the output test that you carried out earlier. Check that the
USB Sound Card generates a signal when you play sound or
music. If this does not work, check that there are no faults on
the Balanced Input Attenuator board and check the wiring
thoroughly. We have not changed this part of the USB Sound
Card, so it should still work fine.
Now launch your recording or analysis software (Audacity
will work for basic testing). Set the input attenuator to 0dB,
apply an audio signal of no more than 1V RMS to one of the
balanced inputs (eg, using a test oscillator) and check that it
is received undistorted in the correct channel (left or right).
If you don’t have a test oscillator, you can rig up some cables
to loop the USB Sound Card’s outputs back to the balanced
inputs and play a test tone. If you do this, remember to set
the output level no higher than −8dB to avoid overloading
the inputs.
If that checks out, switch to the −10dB setting and verify
that the input level drops appropriately. If your test oscillator
level can go higher, increase it to a maximum of 3V RMS and
A view with the bottom panel off during assembly. Next
comes the Balanced Attenuator and base plate.
36
confirm that you get undistorted near-full-scale input signals.
You can also check the −20dB and −40dB settings and verify
that the input level drops appropriately, but the waveform
shape remains undistorted.
Drilling the front and rear panels
As mentioned earlier, we are using the same case that was used
for the basic USB Sound Card. However, because we’ve had to
pack an extra board in, the boards mount to the front and rear
panels differently. The revised drilling details are in Fig.10.
You can copy/print this and use it as a template, or you
can measure with a ruler and mark out the hole locations on
the panels.
If you have already drilled the panels for the basic USB
Sound Card, it is not hard to cut and make new panels from
an aluminium sheet of a suitable thickness. You can achieve a
high-quality finish by sanding with 400 grit paper after making
the holes, then spraying the panels with satin finish black paint.
Cut and finish the metal panels as shown in Fig.10. The
3mm ‘hole’ below the switch hole on the front panel (7.5mm
in diameter) does not need to be drilled through; it is there to
hold the locking pin on the switch.
Note the series of holes on the rear panel shown in red;
these are for venting hot air and help to lower the operating
temperature of the internal components by around 5°C. These
are necessary due to the extra internal dissipation due to the
Balanced Input Attenuator board.
You could opt not to drill these if you are never going to
operate the device at higher ambient temperatures (ie, if it
will always be used in an air-conditioned room). But as they
are on the rear panel, they are unobtrusive, and it’s generally
better to keep the components as cool as possible.
Similarly, we have prepared a bottom panel drilling diagram (Fig.11) which shows the location of some extra holes in
that panel. Combined with the holes on the rear panel, these
First extend the ‘hot, ‘cold’ and screen of the leads, then cover
with two layers of heat-shrink to make a robust test lead.
Practical Electronics | January | 2022
Modifying your prebuilt SuperCodec
TIP
(hot)
RING
(cold)
SLEEVE [or BODY]
(screen)
Connnections to the 6.35mm stereo plug – we have used the
‘TRS’ naming standard, although you will often see ‘TRB’
used instead. It doesn’t matter: the sleeve IS the body!
provide some convective cooling to drop that temperature. If
you’re going to drill one set of holes, you should drill both, or
they will not be effective.
When finished, install the rubber foot on the front panel as
shown in Fig.10 to ensure that the USB Sound Card is held
snug against the rear panel. We cut the chamfer off the top of
the foot to ensure that the rubber foot fully pushes the PCB back
into the case. Then do a test assembly and make sure everything fits OK. Get used to the jiggling required to get things in.
Final assembly
Assembly is pretty straightforward. Slip the bottom panel off
the case, and slide the USB Sound Card in the top slot with
the components facing to the bottom panel. The MCHStreamer
should already be plugged to the USB Sound Card.
Attach the MCHStreamer to the rear panel using an M3
crinkle/star washer, TO-220 bush and fibre or plastic washer.
The bush and insulating washer are to ensure that it is insulated from the rear panel, as described in the USB Sound Card
article. Make sure the bezel is in place (omitted in photo). You
can now put the four screws into the rear panel.
Then mount the output connectors as described in the USB
Sound Card article. Again, make sure they are insulated from
the case.
Attach the earth screw and solder tags as described in the
USB Sound Card article, and solder the 10nF capacitor between
the Earth tag and ground of the output connector.
Plug the 18cm cable that goes between the USB Sound
Card input and Balanced Attenuator output into CON4 on
the SuperCodec board. Now slot the Balanced Attenuator
into the bottom slot, with its components facing towards the
USB Sound Card.
As you slide it in, pull out the power cable and audio cable
that run between the cards and plug them into the Balanced
Input Attenuator power connector and output connector. You
will need to jiggle things to make sure that the cables do not
foul between the two boards. Trust us; it will fit!
Put heatshrink over the alligator clip to cable transition to
act as strain relief, then slide the rubber boot over the lead.
Practical Electronics | January | 2022
If you already built the SuperCodec USB Sound Card and have
soldered the headers to the back of the PCB, it is possible to still
add the Balanced Input Attenuator, but it’s tricky. Removing the
two through-hole headers is not as simple as it sounds. We did
it on our prototype, but note that this procedure is for advanced
builders wishing for a little excitement!
You will need a hot air gun set to about 290°C, a pair of pliers
and a steady hand.
Set the USB Sound Card on edge and grip the first 12-pin
header with the pliers. Heat the solder side of this connector
with the air gun, from a distance of about 10mm, and gently
wriggle the connector with the pliers. Observe the solder connections and adjust your heating until you see some, then all
pins moving in the PCB.
At this point, gently pull the connector out while continuing to
heat, ensuring that all pins are free to come out. Do not use force!
Then use a solder sucker to clean the holes up, ready for the
MCHStreamer connector wires.
Ensuring that the rubber foot is stuck to the front panel as
shown in the drawing (Fig.10), push the front panel bezel
into place. You then need to slide the bottom panel on. After
that, push the 6.35mm sockets and switch through the front
panel and screw these tight with the provided mounting kits.
You can now put the four screws into the front panel. At this
point, you should be ready to go!
Making some test leads
If you’re primarily building the Balanced Input Attenuator so
that you can make recordings from equipment with balanced
outputs, chances are you already have suitable cables. You
may need to purchase (or make) some XLR to TRS adaptor
cables, to allow you to plug XLR equipment into the inputs.
These are readily available and usually not too expensive; for
example, Altronics Cat P0750.
For audio equipment and distortion testing, though, you will
probably want a set of cables with alligator clips on one end
and TRS jacks on the other. This provides you with maximum
flexibility to connect to the ends of various components in
audio gear, as needed.
The process of building leads is open to your needs and
imagination. We will show our approach, but this is by no
means the only way.
We used 90° ‘stereo’ TRS 6.35mm jacks to get the cables out
of the way of the attenuation switch. Strip 25mm off the ends
of the balanced (twin-core shielded) cable. Also, strip 10mm
off each of the inner conductors. Strip 10mm off each end of
short lengths of red, green and black hookup wires, and twist
and solder these to the balanced cable as shown. Then slip a
20mm length of 3mm heatshrink over the solder joints and
shrink them down.
Our finished lead – when constructing the prototype we
ran out of green clip covers – at least the lead is green!
37
Test programs for your PC
We have used AudioTester 3.0 for testing a lot of different
audio gear. This is available as shareware, and a paid subscription is available. It is good but not perfect. You need to
select the ASIO interface for playback and record, and also
192kHz for the sampling rate. You can download it from here:
www.audiotester.de/download.htm
One problem we’ve noted with AudioTester is that its THD+N
readings seem off, especially with test signals well below or above
1kHz. We prefer to use it to measure THD only, and SNR only, then
compute the THD+N reading as the RMS sum of the two figures.
It appears to do a good job of computing THD, but you need
to be careful to use a test signal that isn’t too far below the maximum that the device can accommodate. Otherwise, the resulting
harmonics can be so low that they are unmeasurable or severely
quantised, and you get an artificially low distortion reading.
One alternative that we have used, but not as much, is ARTA.
Many people seem to like this software. You can get it from
www.artalabs.hr
Now take two 40mm lengths of 6-8mm-diameter heatshrink
tubing and shrink these over the junction of the cables. We used
thin cable; you may need to use larger diameter heatshrink here.
Then take two 60mm lengths of tubing and put these over the
top as a strain relief. This will give you a secure connection
and minimise the likelihood of wire fatigue.
The next step is to connect alligator clips of your preference
to the red, black and green wires. Start by slipping the rubber
covers over the wires first, so you don’t forget them! Then slip
a 15mm length of 3mm heatshrink over the cable.
GET T
LATES HE
T CO
OF OU PY
R
TEACH
-IN SE
RIES
A
VAILA
B
NOW! LE
Strip off an appropriate length of insulation; for the Jaycar
clips, this is about 6mm. Solder and trim off any daggy bits,
then crimp the metal strain-relief tabs, right at the end of the
clip, over the wire.
For extra protection, slip the heatshrink down the wire and
over the metal strain relief and shrink. Slide the covers over
the clips, and these are done!
The 6.35mm jacks are similar, just much larger. Don’t forget
to slip the covers onto the cable first! Follow with 30mm of
3mm diameter heatshrink as a final cover for the cable (we
used thin cable, you may need to use larger diameter tubing).
We stripped about 15mm of insulation off the cable, and
applied about 8mm of 2mm heatshrink to the earth screen.
Check the connections for the solder lugs to the tip, ring
and sleeve. The tip is ‘hot’ (red), the ring is ‘cold’ (black) and
the sleeve is ground (green).
Solder these on. If you intend to use this for testing amplifiers, the connector and cable will see the full amplifier output
voltage in some cases. Make sure that all connections are secure
and that clearances of no less than 1mm are present and secure.
Do not use these on mains voltage, in any circumstances!
Final testing
With the case all put together, power the unit back up, plug
it back into your computer and verify that everything still
works as before. If it doesn’t, you may have a short circuit
somewhere, or forgot to plug something back in when you
put it all in the case.
If you are recording from a professional audio source, plug
this in and set the attenuator level to 10dB, and you are all set.
Reproduced by arrangement with
SILICON CHIP magazine 2021.
www.siliconchip.com.au
Order direct from
Electron Publishing
PRICE £8.99
(includes P&P to UK if ordered direct from us)
EE
FR -ROM
CD
ELECTRONICS
TEACH-IN 9
£8.99
FROM THE PUBLISHERS OF
GET TESTING!
Electronic test equipment and measuring
techniques, plus eight projects to build
FREE
CD-ROM
TWO TEACH
-INs
FOR THE PRICE
OF ONE
• Multimeters and a multimeter checker
• Oscilloscopes plus a scope calibrator
• AC Millivoltmeters with a range extender
• Digital measurements plus a logic probe
• Frequency measurements and a signal generator
• Component measurements plus a semiconductor
junction tester
PIC n’ Mix
Including Practical Digital Signal Processing
PLUS...
YOUR GUIDE TO THE BBC MICROBIT
Teach-In 9
A LOW-COST ARM-BASED SINGLE-BOARD
COMPUTER
Get Testing
Three Microchip
PICkit 4 Debugger
Guides
Files for:
PIC n’ Mix
PLUS
Teach-In 2 -Using
PIC Microcontrollers.
In PDF format
© 2018 Wimborne Publishing Ltd.
www.epemag.com
Teach-In 9 – Get Testing!
Teach In 9 Cover.indd 1
01/08/2018 19:56
This series of articles provides a broad-based introduction to choosing and using a wide range of test gear, how to get the
best out of each item and the pitfalls to avoid. It provides hints and tips on using, and – just as importantly – interpreting the results that you get. The series deals with familiar test gear as well as equipment designed for more specialised
applications.
The articles have been designed to have the broadest possible appeal and are applicable to all branches of electronics. The
series crosses the boundaries of analogue and digital electronics with applications that span the full range of electronics – from
a single-stage transistor amplifier to the most sophisticated microcontroller system. There really is something for everyone!
Each part includes a simple but useful practical test gear project that will build into a handy gadget that will either
extend the features, ranges and usability of an existing item of test equipment or that will serve as a stand-alone
instrument. We’ve kept the cost of these projects as low as possible, and most of them can be built for less than £10
(including components, enclosure and circuit board).
PLUS! You will receive the software for the PIC n’ Mix series of articles and the full Teach-In 2 book – Using PIC
Microcontrollers – A practical introduction – in PDF format. Also included are Microchip’s MPLAB ICD 4 In-Circuit Debugger User’s Guide; MPLAB PICkit 4 In-Circuit Debugger Quick Start Guide; and MPLAB PICkit4 Debugger User’s Guide.
ORDER YOUR COPY TODAY: www.electronpublishing.com
38
Practical Electronics | January | 2022
|