Another mains controller…

I’ve designed and built a few control boards for switching on mains (e.g. this and this), because it tends to be a thing that many of my projects need. Good (and good looking!) mains switches are hard to come by, especially for higher currents, so it makes sense to use a lower-voltage switch combined with a relay or an SSR for this duty. An obvious downside to the relay-based approach is that a standby voltage is needed to control the relay, but as described in a previous post there are now several types of switching AC-DC converters able to do that job very cheaply and reliably.

However, more often than not I have found that I prefer to keep the standby PSU separate and so this addition to the control-board portfolio was delberately made smaller and to fit my usual 2”x2” format to make it stackable with my softstart-board. For anything with a large transformer in it, this is a combination that is very useful.

Another addition is an external trigger input (isolated with an optocoupler) which I don’t often use to be honest, but which I could see some potential in anyway. To make this feature a bit more versatile I have opted for the “deluxe-version”, by feeding the optocupler from a constant-current source made from an LM317L. This should mean that it’s not just the usual “12V-trigger” input, but actually it would work with any voltage between app. 3-30V and draw less than 20mA from the triggering device.

“In flight” (or at least on the way) are boards for a matching standby PSU based on the Mean Well IRM power modules – when everything is here and tested I’ll publish some files and more pictures 🙂

Advertisements

Mains line filter

An offshoot of my work on the STEPS circuit was that I started researching mains filters a bit. I kept it simple on the STEPS circuit, but decided to do a proper separate line filter PCB as well.

I’ve included something that is missing on the STEPS board, namely a differential-mode filter with an earth connection to serve as the midpoint. I’ve also put a fuse on this board as I often struggle a bit to find suitable space for a mains fuse in my builds – and obviously the fuse isn’t something that should ever be left out of a mains-powered circuit!

However, the STEPS wasn’t actually the only inspiration here: While looking for suitable common-mode chokes I discovered the Murata PLY10-series which is a hybrid containing a common-mode and a differential-mode choke winding in one part. This makes a more compact filter possible which obviously is an advantage (even if it has low-ish current capability and separate chokes are obviously more effective/efficient). The current capability of the PLY10 makes this filter suitable for preamps, headamps and similar circuits only though.

Pictures of the prototype below. To be honest, I am not sure if this is significantly better (or worse) than a normal filtered IEC socket, but it is at least a bit more versatile – and it was fun to make 🙂

Project files: STEPS clone PSU

What is it?
The board for my “STEPS-clone” single-rail linear PSU as described here. This PSU is suitable for low-power streamers, DACs, headphone amps etc. that run on a single DC-voltage rail and require less than app. 15W maximum. This isn’t really a 100% clone of the original STEPS supply (see here), but I’ve drawn quite a bit of inspiration from the STEPS so I think the credit is well-deserved anyway 🙂

Note that the transformer primary connections are hardwired on the board, so there are separate 115V and a 230V versions of the board files.

How big are the boards?
The board measures 3.95” x 4.7” (app. 100 x 119 mm)

What is the status of the boards?
The published board files are for version 1.0 which is the version I have prototyped. There are a few minor changes I could do, but it’s mostly cosmetic and it might be a while before I get to it anyway so I have decided to publish this version.

Does it use any special/expensive/hard-to-find parts?
If you can order from Mouser, then nothing here is hard-to find. If you can’t, then the only thing that might be difficult to substitute is the Murata common-mode choke and that is optional anyway 🙂

Anything else I need to know?

  • The original idea was that the board should be able to slide into a eurocard-sized enclosure (that’s also the reason for the two extra mounting holes). However, in practice this isn’t possible as the primary pins of the transformer are way too close to the enclosure walls to make this safe. My recommended enclosure is the GX1xx-types from modushop, but there are many other options. If you have more devices, you can of course use larger enclosures to hold multiple PSUs.
  • The transformer secondaries are in parallel, so with the standard Talema range from 7VAC to 22VAC, it should be possible to make the STEPS with outputs from around 3-25VDC.
  • The 2-pin header near the output can be used to connect a volt meter to display the output voltage (or it can be used for something else – your choice! :D).
  • The solder pads on the board can be used either as test points or to tap the AC or unregulated DC-voltage from the board to another PSU board for an AUX-voltage of some sort (additional circuit, trigger voltage etc.). Remember to watch the total load on the transformer and the maximum heat dissipation in all regulators.
  • You can use my spreadsheet here to calculate the adjustment resistors for various output voltages. This will show you the upper/lower limit voltages if you use a trimpot for variable output, and also the power dissipation in the adjustment resistors which you need to be careful with at higher outputs.
  • The only really tricky bit of this circuit is (potentially) managing heat dissipation if your load draws a lot of power on a continuous basis. You’ll have to balance the heat dissipation in the regulator and the pi-filter resistors, while still keeping the voltage to the regulator high enough so that it doesn’t drop out – even if the mains voltage varies a bit. A little tip can be that if your load device isn’t sensitive to output voltage, then turning up the output by app. 0.5-1V will shift some heat away from the regulator. Be sure that you stay within the specs of whatever you are connecting to the PSU at all times of course!
  • As usual for these circuits, you can use both standard and LDO (low-drop regulators). The low-drop types are normally not “better”, but can be a bit less tolerant of circuitry and load conditions so it’s actually better to stick with standard LM317 unless you have a good reason to use an LDO.
  • The only time it really makes sense to use a 3A rated regulator (LM350 or Lx1085 types) would be if your PSU is 5-7V output with a 25VA transformer. If your output voltage is higher or the transformer is smaller, the 1.5A+ current limit of a standard LM317 (or Lx1086) should be just fine.

Downloads:
Download design files here

Related information:
1) Read the original STEPS page linked above. Even if the circuit isn’t completely the same, there is still lots of great info about the LM317 type regulators and how to get the most of them.
2) Read the manufacturers datasheet for the regulator that you are working with. Pay specific attention to recommendations around output capacitance and bypassing of the adjust pin as there are some differences between regulator models and manufacturers here.

Note: Always read the “intro post” for additional important information about my designs.

 

Project files: LED tester

What is it?
The PCB files for my version of Håvard Skrodahls LED-tester as described here.

How big are the boards?
The board measures 2.0” x 1.6” (app. 51 x 41 mm.).

What is the status of the boards?
This is version 1.0 as everything (for once) worked the first time 🙂

Does it use any special/expensive/hard-to-find parts?
None, really. The 16mm pots can be bought from ebay and everything else you should be able to get from multiple different sources. If possible, I would suggest using a stereo 5k-10k pot and the fully-isolated version of the LM317. The former gives the best adjustment range and the latter helps protect against mishaps with flying test leads 😀

Anything else I need to know?

  • For information about how the circuit works, read the hackaday-post linked above.
  • Output current can be calculated as 1.25V/Rtot. For max. current Rtot = R1 and for min. current the value is Rtot = R1 +  the pot value (with the decks in parallel if you are using a stereo pot obviously)
  • There is a difference between Lin/Log pot as described in the build article, so you’ll have to decide up front which adjustment profile fits you best (or keep the pot offboard so you can change – or just build two boards 🙂 ).
  • If you want to use the “high-current” mode, populate R2 as well and short the jumper. Remember that power dissipation in both the resistor and the LM317 regulator increases with higher current. The calculations for min and max current above have to be adjusted to reflect the fact that R1 and R2 are in parallel.
  • The connection for the ammeter is required as it is in series with the LED being tested. If you don’t want the ammeter, bridge If+ and If- connections as shown in the picture. The connection for the voltmeter is optional.  Note that I have tried using a cheap LED meter from ebay for the ammeter and I had some problems with it, whereas if i connect my normal multimeters everything works fine – YMMV.

Downloads:
Download design files here

Related information:
Be sure to read the original post for the exact circuit description, information and tips.

Note: Always read the “intro post” for additional important information about my designs.

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.

More ATtiny experiments…

Since I managed to breathe life into my ATtiny-based speaker delay project I’ve been working on more ATtiny-based boards. There are many potential applications I can see (if I look hard enough…) for a small SW-based controller and that is what I’ve tried to build. The hardware was done a while ago, but the software was lagging (and still is somewhat).

I also received my TinyLoadr programmer a few weeks ago and it was definitely worth the wait. I’ve mounted the board to a piece of aluminium to keep it stable and now its more or less a perfect tool – very highly recommended if you want to play with ATtinys!!

To speed up my development cycle I’ve build a prototyping setup with a ZIF-socket and a solderless breadboard. I’m not a fan of solderless breadboards in general, but they do have their occasional uses and this would be one of them. I bought a few small ZIF-sockets from ebay and together with the tinyloadr programmer they make up an excellent prototyping platform. Swapping ICs from one ZIF to the other is still a bit of an annoyance, but it’s far more flexible than the alternative 🙂

If you need more memory space (or more I/O-pins) than the ATTinys can provide then I am also working on an update of my AmpDuino-concept. This will be a fully-fledged controller based on a stand-alone ATmega-chip that can do the same as the old version AmpDuino, but in a more optimised way. Connections etc. will be laid out for what I consider to be typical audio applications. ETA is, as always when there is software involved, unknown 😀

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.

Project files: Little helpers – Ground Loop Breaker

One more little helper for you guys 🙂 Once again, not exactly a major effort with this one, but I hope it is still useful.

What is it?
It’s a Ground Loop Breaker as described in this article by Rod Elliot on grounding/earthing of audio equipment.

How big is the board?
The board measures 2.0″ x 2.0″ (app. 51 x 51 mm.) This is my new semi-official standard for modular circuits like this and will allow stacking of boards 🙂

What is the status of the boards?
The board is version 1.1 as I had to replace the original bridge rectifier with a different footprint.

Does it use any special/expensive/hard-to-find parts?
No.

Anything else I need to know?

  • Read the article and follow the recommendations on connections.
  • The rectifier bridge should be in a so-called GBPC-W package with wire leads. The rating should be 25A or higher and both the bridge and the capacitor should be rated for at least the mains voltage where you live (so 250VAC/400VDC in 230V countries)
  • The connections on the “ground” side (input) are either via the screw clamp or a couple of FAST-ON tabs. Connections on the “earth” (output) side are either via FAST-ON tabs to a dedicated ground screw or a plated-through hole that can be used to make the chassis connection. The board mounting holes are isolated. Use cables that are as short and thick as possible for all connections.

Downloads:
Download design files here

Related information:
Note: Always read the “intro post” for additional important information about my designs.

Be careful with working with any mains wiring and be sure to ask questions if you are not sure about anything, either in an online forum or to a local electrician (preferred).

Project files: Little helpers – Capacitor boards

Another post in my “little helpers” project series consists of a couple of capacitor boards for mounting input/output capacitors that will not otherwise fit on an amplifier board.

What is it?
Universal boards for (input) capacitor mouting, either for testing purposes or for designs where there is no space to mount a decent-sized capacitor on the main PCB. I made the small board to supplement my P3A clone where adding a large input capacitor would have increased the overall board size quite a bit, so using an off board input cap gives more flexibility. The background for the ridiculously large “MegaMKP”-version you can read in my previous post.

How big are the boards?
This big 🙂

  • The “normal” board measures 2.0″ x 2.0″ (app. 51 x 51 mm.)
  • The “MegaMKP” board measures 3.95″ x 0.625″ (app. 100 x 16 mm.)

What is the status of the boards?
Both boards are in v1.0, meaning they have been tested and are working.

Does it use any special/expensive/hard-to-find parts?
Well, there’s really nothing on these boards except the capacitors 😀

Anything else I need to know?

  • The small board has capacitor mounting for small caps on the top and for larger caps. Max dimensions are approximately:
    • Bottom side mounting: 25 x 38mm axial capacitor (with holes for 33mm long caps as well).
    • Top side mounting: 27mm lead spacing x 15mm thick box cap or app. 20 x 28 mm. axial capacitor.
  • If using the bottom side mounting points, either mount the board upside down on standoffs or don’t use the footprint for the terminal block but solder wires to the board instead.
  • The large board has holes for a various combinations of 2/3/4 large caps. There are screw holes that can be used to mount the boards to the chassis via standoffs so you can use caps as big as you like.

Downloads:
Download design files here

Related information:
Note: Always read the “intro post” for additional important information about my designs.