Linear PSUs are better…

…aren’t they? 😀

No, I don’t really want to start up that discussion here because in my opinion it’s much more complex subject than most audiophiles believe. However, one thing that is obvious is that as more and more small audio components run on single DC rails from an external PSU (streamers, DACs, headphone amps etc.), a fairly large market for aftermarket “upgrade” PSUs has opened up. Some manufacturers (e.g. Auralic) even offer separate PSUs as upgrades themselves. Well, a linear PSU is normally a relatively simple thing so why not DIY it?

Since I now have a DAC, a preamp, a streamer and quite a few other things that run on single-rail DC this seems a worthwhile project and it’s actually been on the drawing board for a while. I did have a bit of trouble getting started on the circuit and layout though, and I didn’t manage to really break the deadlock until remembered a design called STEPS by headwize/head-fi user Tangent from (many) years ago. The design isn’t up anymore, but thankfully I managed to locate it on the wayback-machine.

It’s basically a standard LM317-based PSU, but with a few tweaks added to tease as much performance as is possible out of the LM317 regulator (or one of its many derivatives). My version isn’t a straightforward copy of the STEPS, but I owe a big thanks to the the STEPS all the same. Compared to a “normal” LM317-based circuit this one includes:

  • A simple mains filter on the primary side of the transformer.
  • A snubber circuit on the secondary side of the transformer.
  • Space for high-speed/soft recovery diodes and snubber caps.
  • Space for 2+2 18mm filter capacitors in C-R-C (pi-filter) configuration before the regulator.

Everything else looks like the “high-performance” circuit variation from the data sheet of any LM317-type regulator. The onboard transformer is a 25VA Talema PCB-mounted toroid type meaning the design should be good for most applications requiring less than app. 20W power. The 15VA type transformer will fit as well and allow for mounting in a 1U enclosure, but the constraints on heat sinking and capacitor height might then be an issue.

The pictures show the completed 12V prototype for my Arcam IRdac as well as a partially completed 16V board for an Auralic Aries Mini (a recent purchase) – I’m waiting for a transformer in the mail before I can finish that and test it 🙂

LED-tester deluxe…

A few months ago I stumbled upon a presentation thread for an “LED-tester” circuit by Muffsy-creator H. Skrodahl on a Norwegian audio forum. Two things immediately occured to me:

1) I want one!
2) I think I can improve this a bit 😀

So rather than simply downloading his posted Eagle files and ordering boards from there, I started doing my own board instead. With the final result arriving earlier this week it’s time to put it to the test.

The basic idea is to use an LM317 regulator as a variable Constant Current Source (CCS) to test unidentified LEDs and confirm what currents are required for acceptable brightness – something that isn’t always easy to guess based on the published specs. I’ve kept the basic circuit intact but my modifications basically consist of:

– “Real” connectors for all connections instead of just solderpads.
– Additional outputs for LED connections to allow direct plugging in, permanent wired connections and also temporary connections via test leads/crocodiles clips.
– Space for a stereo pot to give a bit more mechanical stability.
– Optional “high-current” mode for testing constant-current LED bulbs as a supplement to just normal LEDs.
– Four real mounting holes to allow the board to be fixed to a bit of scrap metal or similar for use in a lab environment.

I need to do a bit more validation on the prototype before I publish my board files, but at least I can confirm that it works and that it is a very useful way to identify the operating parameters of e.g. LEDs in pushbutton switches.

Hard times ahead for Audio DIY?

It’s no secret that as mass-market electronics become increasingly compact and integrated, the availability of parts that are DIY’er friendly is shrinking rapidly. Most of Toshiba’s audio transistors (bipolar and JFETs) have disappeared, most of the high-voltage parts used for Stax amps have gone as well (together with the CRT TVs they were intended for), Onsemi killed a load of small-signal transistors not long ago and more and more semiconductors are disappearing in their through-hole versions and moving to SMD-only.

This has been going on for at least a decade, but I think a recent diyaudio thread highlights the issue and deals another crushing blow: A while ago Texas Instruments (TI) acquired National Semiconductor, and now TI has decided to discontinue a large chunk of audio-grade parts. You can see the whole list at Mouser here but among the “highlights” for the audio DIY’er are:

  • The LM3875 – discontinued with no replacement (!!)
  • The LM4780 – discontinued with no replacement (the listed LM4766 isn’t really comparable and will not fit the many LM4780-designs already out there)
  • The LM4562 – DIP-package discontinued, but SMD still available.
  • The LME497x0-series and many other LME49xxx opamps – all DIP-packages discontinued. In some cases the SMD-package stays available but some devices are going completely (like the LME49990)
  • The LME498x0 power amplifier drivers – discontinued with no replacement.
  • The LME496x0 buffers – discontinued with no replacement.
  • etc.

Now, according to the PCN the last order date isn’t until September next year and last delivery is in March 2017, but there is no doubt to me that this isn’t the last notice we’ll see of this type in the coming years. Also, there is a risk that some distributors will drop the parts earlier to avoid building up excess stock making parts difficult to source even before the official deadline, and in any case many designers will be reluctant to use parts that are marked EOL.

Certainly, my next Mouser-order will include a few spares of some of these parts and I can only advise you to do the same 😦

Building an Electronic Load

One of the tools that I sometimes need but haven’t bought yet is an electronic load for testing circuits such as power supplies. Of course you can make do with fixed resistors (and I have so far), but you practically never have the right value/wattage to hand when you need to test something (in my case, usually on a Sunday afternoon…grr!).

The solution is a programmable electronic load, or basically an adjustable current sink (or a “reverse power supply” as some people call it) that can simulate the load from any fixed resistor within reason. I haven’t bought one of these yet, partly because I didn’t feel I needed it enough to justify the expense, and partly because I am rapidly running out of space to store instruments that are only used occasionally.

Some weeks ago I started toying with the idea of building one myself to at least get started. I’d seen some nice designs on Tindie, but wanted something that was capable of higher power and something which I could more easily tweak for myself. A bit of googling turned up a few promising pages, most notably this one on Kerry Wong’s (excellent) blog.

I liked Kerry’s design as a starting point, mostly because it is relatively well documented and the control code is Arduino (which I can work with). I therefore started revising the circuit to suit my needs and laying out a PCB for it as well.

Key changes from the original:

  • I’ve scaled it down from three pairs of MOS-FETs to two because that is what I could fit on the Eagle board (being constrained by the freeware version).
  • I’ve replaced the parallel LCD connections with I2C to simplify the PCB layout and free up Arduino pins.
  • I’ve mounted the controller (an Arduino Nano v3) onboard. That wasn’t the original plan, but the space was there so why not?
  • I’ve broken out a pair of analogue Arduino pins, a pair of digital Arduino pins plus a second I2C-connection that can be used for other purposes. Top of the list for me would be a real-time clock (RTC) module for data logging purposes and some sort of thermal sensing and fan control, but I am sure there are many other potential uses (web-interface anyone? 😀 ).
  • plus a bunch of other minor tweaks 🙂

This is still work in progress, but I have received the prototype boards in hand and I have started the assembly as you can see from the pictures. Still to do:

  • Do the mechanical work on the heat sink (in progress)
  • Rewrite the software to work with the I2C-display (also in progress, but might take me a while)
  • Test whether the damn thing works! 🙂

EDIT 13th March 2016: The schematic for my v1.0 PCB can be found here. There are at least two know issues that need to be corrected. 1) The “sense” pin (A3) is connected directly to the output but should actually have space for a voltage divider. 2) The spare opamp (IC1B) should have pin 6 and 7 connected together and pin 5 connected to AGND.

PCB Layouts Part 1 – Workflow

I get asked (surprisingly) often about my PCB layouts and how I do them. Flattering obviously, but also a bit strange as I don’t really consider myself an expert on PCB layout at all. However, I can share are some “workflow” tips on laying out a board in the most effective way based on my experience.

Note that the below is based on using the freeware version of Eagle, but much of it should translate to other software packages without much difference.

The first step is to draw the schematic in the schematic editor. If I start from someone else’s published schematic I’ll normally print a copy on paper and mark on that which parts sizes I expect to use. This then becomes the reference for drawing the schematic in the editor. Once the schematic is drawn in it’s basic form I’ll check it, rename the parts and then run an electrical check to verify that nothing has been missed. If I am going from a published schematic I normally stick to the part names from the original schematic (because that makes for much easier troubleshooting if something’s amiss later on), otherwise I will make up something that is logical to me, usually going from input to output.

Then it is time to switch to the board editor. Most of my PCB layouts start out with mounting holes placed in the four corners (because that’s normally where I want them) and a ground plane drawn in the top layer. If I have a specific board size in mind I’ll restrict it straight away, otherwise I will keep the full area and then reduce the size as the layout progresses. I will also load my own standard design rules and tweak the parameters (mainly clearance) if required before I start, because then I will not make something that I have to revise later when the DRC (design rule check) fails.

I generally then start the actual layout process by placing the key components as I want them. Key components usually mean:

  • Power and control devices (transistors/ICs and potentiometers/switches) that must extend over the edge of the board
  • Power devices that need an onboard heat sink (heat sink is placed as well of course)
  • Other ICs plus their associated decoupling parts as close to the IC as possible
  • Key connectors (if they need to be in a certain position I fix that, otherwise I put them on the specific board edge where I believe it makes most sense to have them).

After this, the fun (or frustration) starts. Using the schematic on one side and the “ratsnest” command in Eagle to recalculate wires I start moving first the major and then the minor parts of the circuit around and positioning them to yield as short and as neat traces as possible. This requires several iterations and usually also putting the board away and coming back to it later because I tend to “go blind” after staring at the layout for too long at a time. Other tips that I use to simplify the layout process include:

  • Every time I make a major change, I save the board as a different file version with a new revision number, because sometimes layout changes turn out to be “dead ends” and then it’s easier to return without having to do massive amounts of rework. Some of my more complex designs have 10-15 file revisions before getting to the final layout.
  • I normally do the basic layout using one trace width, generally the smallest width I expect to use in the circuit. Once I have a layout I am reasonably happy with mechanically, I can enlarge key traces without having to do a lot of fiddly rework and without risking that I miss something. In general I also stick to using a few standard trace widths which makes it easier to quality check the layout later on in the process.
  • I normally start with 45 degree trace angles for simple and consistent routing, and the in the last round of tweaks I may change some traces to be “odd” angles instead if it significantly helps the layout.

Once the layout is beginning to shape up and all traces are routed, I will start the actual layout screening process. This usually involves generating gerber files for the circuit and rendering them with circuitpeople.com and looking at each layer in isolation. For the copper layers I mainly try to look at a) whether the individual traces follow the most unbroken and logical path and b) whether the individual signals will flow through consistent trace widths. If not, i go back and make corrections accordingly. Once I start checking Gerbers, I also start adding text elements to the board because I now have a reasonable idea of where there is space for them.

I then pretty much repeat this process over and over again until I believe I can’t make any more improvements. Again, putting the board away for a day or more often helps and I often find that even a short break from something I am happy with means that when I come back I can make bigger optimisations than I though possible when I left it. Often during these breaks I also think up new features that may be worth including, such as multiple footprints for key components, additional labelling for connectors etc.

Eventually I get to a point that I am happy with the layout and then it is mainly the last checks of both the individual layers (using gerber renderings from circuitpeople) and the full board (using renderings from gerber-viewer.com, which allows displaying of multiple layers at the same time) plus the last tweaks to the silk screen. The last step is usually confirming that ERC and DRC are still error-free, and then printing off a sample of the board layout at 100% to check the final size. Seeing the board printed in actual size gives me a better impression of the size, even if I already know how big e.g. a 2” x 2” board is.

I will then place the PCB order and mark the last Gerber version with a tag in my Eagle project folder so that I can see later that this was the file version I sent off for manufacturing.

DC-DC converter experiments…

A while ago I started looking at DC-DC converters for powering some of my audio circuits. I am not quite sure what triggered this to be honest, but mainly it was because I wanted to be able to make some more compact headphone amps and preamps than what the usual linear supplies can provide. At least around here there are very few external dual supplies available and so building a preamp or a headphone amp with an external PSU can be a bit tricky. Another option is a single-rail amplifier design, but they are often compromised because they need big input and output caps, so what do you do then?

Enter the DC-DC converter, a switching device that chops up a DC voltage and then transforms it up or down as needed. Most types include regulation of the output and galvanic isolation as well. The DC-DC converter gives tremendous flexibility because instead of needing a 2×12-15V PSU with a transformer, rectifier/caps and a wasteful linear regulator that must be heat sinked, you get a very small PCB that only needs a single DC input from a wall adapter or other DC source to work.  Some, like the Traco THN-series I have used offer a 4:1 input range and up to 20W output from a 1″x1″ brick, meaning you can get a fairly powerful regulated +/- 15V PSU in a tiny form factor and with just a single 9-36VDC input  – that’s pretty impressive I think!.

Another useful feature is that many of the converters have a remote on/off feature to put the converter into standby-mode. This means that if you are using a circuit that already has a micro-controller built in you can turn the converter (and the circuit it powers) on and off using the uC or even by a simple low-voltage mechanical switch.

The downsides of this power and versatility are mainly that DC-DC converters can be quite expensive and then that they (like most switching supplies) have rather a poor reputation for audio use. In some cases that is probably well-deserved, but I don’t like ruling out a whole technology just because of a few poor examples – in my world there are very few absolutes like that in audio. However, using switching technologies of any kind doesn’t really eliminate problems, it just replaces one set of well-known problems (heat, space, weight etc.) with another, perhaps less common set (EMI, high-frequency noise, inrush currents etc.). Depending on the application these “new” problems may be significantly harder or easier to deal with than the “traditional” ones.

So, after a bit more digging, reading datasheets and application notes etc. I have built some prototype boards for various DC-DC converters. Below are some pictures of my prototype boards, using industry standard footprints for 1”x1” and 1”x2” converters (more versions in the works). I’ve followed the application information from a few different Traco and Recom application notes but the boards will generally fit converters from a variety of manufacturers – one of those pictured are some old Tyco ones I bought a few years ago without really being sure what I wanted to use them for.

As for audio quality I can’t really say anything just yet, but as one of the pictures below show I have tried to power my universal preamp/headamp from a +/- 12V converter and I think it sounds pretty good. There are no audible artifacts such as hum or noise from the converter and the remote on/off feature works great as well. So while more testing is definitely needed, I am already starting to look at look at some of my current projects in a new way 😀 If anyone has used standard DC-DC converters to power audio circuits I’d love to see some examples 🙂

The JFET-matcher

While building the Borbely amp from the previous post I had to measure and match a number of JFETs, both for the input circuit and for the current sources. I have done that before using a test setup based on a solderless bredboard and I used that here as well, but afterwards I started thinking if there was an easier way because I always have to rebuild the setup and it can be a little bit fiddly to use I think.

The result is this little PCB. It has screw clamps for input and output connections which means you can connect the leads from a multimeter directly – no crocodile clips and resistor leads required :D. There are connections for the power source and for volt-, amp- and ohmmeters (if you are measuring current sources with a resistor and not the raw Idss of the JFET). In addition, there are a few other features which I thought might be handy:

  • Silkscreen on the back of the boards to keep board connections to hand.
  • A jumper (marked “Idss”) to bypass the resistor/trimpot and measure Idss.
  • 2×3 pattern for a trimpot to allow connections of pots with both inline and staggered pins (soldered or via socket strips)
  • Connections for a switch to control whether the ohmmeter is connected or not. This means that you can connect the ohmmeter permanently to the board using the screwclamps. Then measuring is as simple as connecting the JFET, adjusting the trimpot to read the right current and then remove the JFET and pressing the switch to get the corresponding resistance reading – should help if measuring a larger batch of FETs.

The board measures app. 50x41mm and if there’s any interest I can easily share the eagle files. I also have a few spare boards (as I don’t really need 10 of these :D) so if  you just want a single board send me a message.