Tuesday, August 19, 2014

YAFP - The mcHF SDR HF Transceiver

Those who know me are already familiar with a four-letter acronym that I've used for many years:

YAFP

Which stands for:

Yet
 Another
  Fu__n_
   Project

What, exactly the "F" stands for is up to you, but the sentiment is the same, regardless:  Too many fun projects, too little ($#!+) time!

Falling into this category is one that a friend of mine, Brett, N7KG, made me aware of and that is the "mcHF", a small, (relatively) inexpensive SDR-based HF (10 watts, 80-10 meter, SSB-CW) transceiver, based around the STM32F4 processor, designed by U.K. amateur Chris, M0NKA - see the web site:

http://www.m0nka.co.uk/

This radio is definitely NOT a kit.

What you can get from from Chris is:

  • Two circuit boards
  • A full-color TFT LCD display
And from the web site:
  • Documented source code
  • Information on how to use the bootloader
  • Where to get the compiler and the various utilities.
  • Pre-compiled binaries
  • How to compile your own binaries
And that's it!

If you want to build the radio, you must get - on your own - all of the other parts to populate the board - which numbers around 480 or so!  Fortunately, the vast majority of these (numerically speaking) are things like surface-mount resistors and capacitors that are on the order of a penny or two each.


The web site above contains a "BOM" (Bill Of Materials) but for the U.S. amateurs, this is a bit awkward to use as it uses mostly Farnell U.K. part numbers.

Figure 1: 
The boards and LCD supplied by M0NKA.  At the bottom-left is the RF board while
the upper-right is the CPU/User-Interface board.
Other than source code, instructions and some binaries, everything else is up to YOU, including
the case which you must figure out how to get made using someone's 3-D printer!
Click on the picture for a larger version.
For the convenience of others, I've gone through the pains of cross-referencing those parts to Mouser Electronics part numbers (in most cases providing several alternates for the same part) and where the part was not available from Mouser, offered a Digi-Key alternative and some may even be obtained on Ebay:  This alternate Bill of Materials may be found in the "KA7OEI" folder of the FILES section on the M0NKA mcHF Yahoo Group which requires membership access, or you could send an email to me and I could pass it along.  Even if you were to choose not to obtain the parts from Mouser and/or Digi-Key, at least you can figure out the specifications of these parts and figure out what, exactly, they are and where to get them.

There are a few parts, notably the ferrites, RF output transistors that are not available from either Mouser or Digi-Key, and these may be obtained either via Ebay or other suppliers.  There are a few specific parts, however - the 3.5mm connectors for the audio input, output and key connectors and for the DC power connector - that do NOT seem to be available from ANY U.S. supplier and unless one "kludges" alternatives must simply be ordered via Newark/Farnell from their U.K. distributor!

There is some "support" in the form of a Yahoo group mentioned above and some exchange of ideas on the website forum itself, but this is, as they say, open source in terms of both hardware and software.

At the moment the only source of circuit boards is from Chris, M0NKA himself and a set of these, shipped to the U.S. along with an LCD will run about $68 (as of August 2014) - if he has them in stock.  As of this posting he does not currently plan to make the board layout files available, but since the schematic diagrams are published, there's nothing stopping anyone from laying out their own board!

This sort of project is definitely NOT for everyone as this is very far from "plug and play":  The software is a bit rough around the edges and the feature set presently extant is a bit sparse, but it is reportedly functional and open-source and a quick look at the source code reveals that it shouldn't be too terribly hard to add user-interface bells and whistles while the addition of other features like additional audio filter bandwidths shouldn't be too difficult, either.

What would take a bit more work would be the addition of things like DSP noise reduction, other operational modes like AM and FM and the addition of stand-alone support for digital modes like PSK-31, RTTY (to name but two) and the self-copying of CW, for example, although this sort of thing should be possible... in theory...

Where it stands:
 
Figure 2: 
The box into which the accumulating parts for the
radios are being tossed as they arrive!

Myself, Brett and Bryan, W7CBM are putting together four of these radios between us (I'm building two) and we have almost all of the parts on hand, missing only a few components on the RF board:  Those are on their way from Mouser or from the EvilBay vendor.  Meanwhile, the 3.5mm and power connectors are reportedly on their way from the U.K. at this moment.

The next step - which might be the most difficult of all - will be finding time for the three of us to get together and get these small parts on the board and do some assembly and testing!


As I said before:

YAFP!

[End]

This page stolen from ka7oei.blogspot.com

Monday, August 18, 2014

Completely containing switching power supply RFI

In the old days, radio amateurs were concerned with (or should have been) energy from their transmissions getting into devices unintentionally, the classic being televisions, phonographs, telephones, hi-fi sets, and the like.

A few years ago hams' hackles were raised with the prospect of BPL - Broadband over Power Line - a system by which the already-extant infrastructure used to convey electrical power would be used to transport data all about the land.  While it did work (sort of) it had the potential to cause a great deal of interference to amateur radio operators.

A lot was written and to their credit, some designers/operators even designed their systems to avoid putting energy within the HF amateur bands - to varying degrees of success.  While this wouldn't have really helped the causal shortwave listener, it did still not address the fundamental problem that the power lines were simply not suitable, low-loss, low radiation transmission media for radio frequency energy.

What we really should have worried about was not BPL...

Figure 1:
The computer power supply making RF noise up and
down the HF bands.
As it turns out, when it comes to worrying about devices that had the potential to clobber our HF bands, we really should not have worried too much about BPL - which, as hindsight has proven, wouldn't have gotten anywhere, anyway, but rather devices that are right under our noses:  Switching power supplies - particularly the cheap, lightweight ones that are now supplied with everything that we buy and even put in our own shacks!

These inexpensive "wall warts" used to consists of a small, iron and copper transformer - often with a rectifier and capacitor.  These devices would plug into the wall and operate, typically for 5-10 years until whatever it is that they were powering wore out.

Unfortunately for them, they would consume 1-5 watts all of the time just sitting there doing nothing, even when the device was "off" - the so-called "phantom loads" or "power vampires" and many locales/countries have legislated them out of existence in favor of the newer, much more efficient switching-type devices.

All would be good except for two things:

The first of these is that many of these cheap switching-type wall warts last only 12-24 months before dying - usually a victim of an inferior quality capacitor and/or poor design.  What this means is that more often than not, the device to which they were attached is often thrown out as well.

While this new-style switching-style wall-wart may take less power to operate, it is my guess that considering that its premature failure caused a premature product replacement, it never actually saved any money.  Whether it actually saved much energy overall is debatable since it probably took a lot of energy to make (and ship!) the device that the failed supply powered in the first place!

Stepping back off the soapbox, these switching supplies - even if well-built and long-lasting (if you are lucky enough to encounter one) bring us to the second of the two problems concerning us about these devices:  The generation of RFI, or Radio Frequency Interference.


Such was the case with one of these devices that I use on my TV to run a small multimedia computer.  This computer, obtained surplus, did not come with its original supply so I found a genuine (not counterfeit!) OEM Dell laptop supply of  reasonable quality and suitable ratings - about 19 volts and 3 amps.  There was one problem:  It seemed to radiate a low-level RFI signal that got everywhere on HF.

Figure 2: 
Configuration showing the interconnects and where the RF circulating currents are flowing.
The conduction of RF currents onto the AC power, speaker and outside antenna leads
assured that it was being radiated far and wide!
Now part of this problem was due to how and to what it was connected - See Figure 2, above:
  • The power supply was connected to the AC power line.
  • The power supply was also connected to the TV through the video/audio cables.
  • The TV was connected to the high-power stereo system which, in turn was connected to speakers in different parts of the room.
  • The TV was also connected to a coaxial cable that went to the rooftop antenna.
What this meant was that this power supply was, itself, indirectly connected to both ground - via the power line - and several forms of antennas, via the TV, TV antenna and its cable, and speakers.

Whatever low-level RFI was being produced by this power supply had exactly what it needed to be conducted out into the world and cause problems:  A complete path in and out of the power supply and on to conductors that could act as antennas!

What it sounded like:

Typically, switching power supplies sound like a "buzz" every 30-60 kHz - the power supply's switching frequency - up and down the bands, usually worse on lower bands, but not always.  This buzz is usually modulated at twice the power line frequency (120 Hz in the U.S., 100 Hz in most locations in Europe, Asia and Africa) but this modulation is usually very "dirty" and full of harmonics:  If the radio is switched to "AM" mode (and all noise reduction is turned off) the "buzzy" nature of the modulation becomes much more apparent.

It is often the case that the 30-60 kHz intervals at which the interference occurs are more obvious at lower frequencies such as the AM broadcast band and 160 through 80 meters (1.8-4 MHz) - that is, one can more clearly hear the distinct switching supply "carriers".  As one moves up in frequency the amplitude interference may sound like it is decreasing, but this may not actually be the case as these "bunches" of energy often get spread out, changing from a fairly sharp "buzz" as you tune across the switching harmonic to more of a "hiss" and in severe cases - and on higher bands - these "bands of hiss" may actually run together.  In the latter case, it may not, at first glance, sound like a switching supply at all, but rather just an elevated noise floor and it may not be until one switches to AM and notices that this "hiss" has a powerline frequency AM component to it and/or that it disappears when the power is removed from the supply that it is, in fact, from a switching supply!

The latter was the case of the power supply depicted in Figure 1:  On 160 meters it could be heard every 60 kHz or so as a "dirty" buzz, but on 40 meters it was just an indistinct rise in the noise floor of about 2 S-Units that was about 10 kHz wide while on 20 meters it just seemed to raise the noise floor by 1-2 S-Units everywhere that, to the uninitiated, didn't even seem resemble noise from a switching power supply - at least until one switch to "AM" and observed that the background noise seemed to be modulated with twice the mains frequency.

It should be pointed out that I'd already modified this power supply to reduce its conduction onto the AC and DC power leads and that had solved one problem - bothering a receiver that was located next to it - but the lower-level, HF frequency energy that was induced across the power supply between its AC input and DC output was much more difficult to manage as that was not a matter of either shielding or direct power line conduction.

Since I'd already gone out of my way to add bifilar chokes to both the AC and DC leads of this power supply, I'd likely reduced its potential to emit energy by a significant amount, but here, we are talking about residual amounts that are being coupled into what amounts to antennas that are connected to my TV system and being picked up by a sensitive HF receiver.


Before we continue on, let me say a few things about what won't work to fix this.

What will NOT work to solve this problem:

Ferrite beads and snap-on chokes will not be enough.

Ferrite beads and snap-on chokes will not likely solve this sort of problem because what is needed is to prevent the egress of the RF energy from the switching supply one or more of the following:
  • Very high series reactance to block RF energy
  • Shunting of RF energy to a common path on the input and output of the power supply to prevent it from circulating elsewhere.
Simply put, a simple, ferrite bead or snap-on ferrite cannot practically introduce enough inductive reactance to effectively knock down the RF energy to the degree that we might like.  While it may reduce the energy by a few dB, it is often the case that we need to reduce the RFI by 10's of dB and more aggressive filtering is usually required to do this!

Ferrite beads and snap-on chokes are better at minimizing the ingress of energy to reduce the probability of the device in question from being bothered by external RFI than they are at eliminating the emission of RFI in the first place. 

In other words, the reactance that they add to the interconnect leads gives whatever built-in RFI immunity the device already has more of a chance of working to keep RF out of it.  They are much less effective in quashing the emission of RFI emitted by that device in the first place.

To get enough inductance to present a high inductive reactance at the lowest desired frequency it is often required that many turns be wound on a piece of ferrite, but the size of the core, the diameter of the wire - and even the length of the wire - usually precludes putting more than a turn or two on all but the largest core.

As noted before, in this case I'd already have installed additional filtering in the power supply that was orders of magnitude more effective than simple snap-on ferrite devices - and it wasn't enough - so we are going to attack this problem using the second of the above techniques:  Shunting the RF energy to a common path.

I knew now that I had to do the complete "filter job" on this power supply.

Having had to do this before on other power supplies, I gathered the necessary parts - this time, documenting my efforts for this blog:
  • Dead PC power supply, complete with case and power cord.
  • Two brand new low-ESR electrolytic capacitors of suitable voltage for the DC power supply, capacitance with values between 100uF and 1000 uF, inclusive.
  • Two monolithic 0.1uF ceramic capacitors of suitable voltage for the DC power supply.
  • Terminal strip.
  • A piece of perforated prototype board.
  • Misc. screws/hardware for standoffs.
  • A piece of plastic for a shield - see text.
  • An AC line filter - or parts to make one.
  • Four self-adhesive rubber feet.
  • Some soldering skills.
  • A bit of common sense!

Before I go on I must spout out a few weasel words of warning:
  • This project involves hazardous/lethal AC power/mains voltages!  DO NOT undertake this project unless you have experience with such voltages and the necessary safety procedures in dealing with them!
  • Please observe the safety regulations and requirements for your locale noting that the methods described here may not be suitable for your area!
  • You MUST make certain that the components that you use are rated for the voltage/current at which they will be operated!
  •  YOU are responsible for your own safety.  I cannot be held responsible for damage, injury, accidents or even death that might occur by following - or failing to follow - any instructions or recommendations on this page!
  • If you do not feel comfortable working with high voltages and currents or do not have familiarity with wiring procedures and safety related to such, PLEASE do not even think of doing so! 
    Figure 3: 
    The discarded PC power supply case, stripped of its insides leaving
    only the power receptacle and the on/off switch.
    Click on the image for a larger version.
  • YOU HAVE BEEN WARNED!!!

Gathering parts:

The first thing to do is to gut the PC power supply, leaving in the case the connector for the power cord and the on/off switch if it has one.

Please be aware that the input capacitor of the power supply may retain voltage even if it has been powered down for a long time - check and discharge it if necessary.

The picture shows several of the parts that you will need from the power supply:
  • If you don't have an AC line filter on-hand, you'll need to get the parts for one and the first on the list is a bifilar input choke.  This could either be toroidal, or look like a transformer.  Make certain that you identify the two "halves" of the inductor:  AC power will flow through each half, separately.  These inductors will have values of 100uH to 50 mH per half, depending on the source.  Those depicted in Figure 4, below, measured about 4.5 mH per half, enough inductance to be effective down to a few hundred kHz.
  • Common-mode capacitor.  This will typically have a value between 0.047uF and 0.22uF and will be connected directly across the AC line - usually located right next to the bifilar input choke.  In the U.S. where 120 volts is used, these capacitors are typically 0.1-0.47 uF.    Make sure that the capacitors that you use have "X1" or "X2" marked on it somewhere, indicating that it is both safe and designed for this purpose.
  • Two identical high-voltage bypass capacitors:  These connect from each side of the AC supply and go to the case ground.  These are typically blue or yellow and have values from 1000pF to 4700 pF (e.g. 1nF to 4.7nF).  Make sure that the capacitors that you use have "Y1" or "Y2" marked on it somewhere, indicating that it is both safe and designed for this purpose.
  • The safety fuse(s) from the power supply - if they are not blown.  In the U.S., there is typically only one fuse found on the "Line" (black wire) side of the AC input, but a fuse on each side of the AC line may be required in other parts of the world.
  • Figure 4: 
    Parts needed for the AC input filter, found on the discarded PC
    power supply:  The fuse, the common-mode
    capacitor (the yellow block), the common-mode choke (the
    toroidal inductor with two halves) and the two blue disk-
    ceramic capacitors.
    Click on the image for a larger version.
  • Another Common-mode capacitor.  If you have another PC power supply to scavenge - or if the power supply that you have has one, get from it another common-mode capacitor of the same description as above.  This is is optional.

Comment:
  • It has been noted that some REALLY CHEAP and/or "suspected origin" power supplies have been spotted that have none of these RFI suppressing components - or even a fuse - even though their cases had a "UL" and "FCC" certification sticker on them!  In this case, it was probably just as well that the power supply was pulled out of service as they were neither safe or compliant with regulations! 

Warning:
  • All of the capacitors should have on them explicit AC voltage ratings consistent with those of the mains voltage in your area.
  • DO NOT use any capacitor unless it has printed upon it the proper AC voltage rating!  The capacitors typically used for these applications are usually (but not always) blue, light yellow or white in color and have printed on them an AC voltage rating.
  • Make sure that the mains-connected capacitors that you use have an "X1", "X2" "Y1" or "Y2" mark on them indicating that they may be safely used for power mains filtering.
Note:
  • You may be able to find a pre-built filter unit that has a standard IEC (e.g. "Computer Plug") connector on it that you can mount to the power supply case, saving you the trouble of building a filter.  These units may be found both new and surplus.  Such a pre-built filter unit is depicted in the upper-left of Figure 5, below:  If you find one of those, by all means, use it!
Figure 5:
Various styles of bifilar inductors that may be found in scrapped
switching power supplies - plus a complete, self-contained
AC RFI filter built into an IEC power connector
in the upper-left corner.
Click on the image for a larger version.
Constructing the filter:

 The schematic diagram of the filter is shown below.

The filter is of the so-call "Brute Force" type and it is a common-mode low-pass filter that removes high frequency content from the AC power line.  Because our main goal is to contain the RFI within the box, any RF energy from the switching power supply first hits the common-mode capacitor which forces it to be equal on both sides of the AC power line.  The RF energy then hits the bifilar RF choke which then cancels out any energy that is equal on both sides of the AC power line - a condition that was just enforced by the common-mode capacitor.

Any RF that managed to make it through the bifilar choke will now be greatly diminished and it is now shunted by the two capacitors to the metal case to ground while the (optional) common-mode capacitor on the AC input side reinforces the equilibrium of any RF energy that might be on that common-mode choke.
Figure 6: 
The completed AC input filter, constructed on a piece of phenolic prototype board.
This one has a common-mode filter on both the input and output.
Click on the image for a larger version.

The filter shown was built on a piece of phenolic prototyping board, maintaining at least 1/2" spacing (12mm) between any two points that carry mains voltages or between a mains voltage and/or a ground point.  On the bottom, short pieces of solid bus wire were used to interconnect components and to make the loops used to solder the interconnecting wires.

As can be seen, the power supply's original fuse was retained and used on the "line" (hot) side of the AC input of the filter as a matter of safety.

Figure 7: 
Schematic of the AC input filter.
Note:  Typically, a 100k-1Megohm "safety" resistor is connected across the mains (on either side of
the inductor) to discharge the capacitors should it be disconnected while the AC sine wave
is at either peak.  This is not shown in the above diagram since this resistor was already present
in  the power supply to which it was permanently connected.
The phenolic board was mounted on the side of the PC power supply case, but to protect it from items protruding into a vent hole and causing a short or electric shock, a piece of heavy plastic larger than the perfboard was cut out and mounted against the case.  This piece of plastic was cut from a discarded "blister pack" that had contained items bought at a store and was fished out of the trash can:  It just so-happened that there was a large enough portion of flat plastic to accommodate my needs and it made a nice, durable and free shield!

The board was mounted using 6-32 screws and spacers as standoffs to hold it about 1/4" (5mm) or so from the side of the case.  For a ground connection, a ring lug was put under one of the screws and soldered to the ground connection on the filter - and also soldered to the ground connection on the AC power plug which, itself, was also connected to the case.

Using the original on/off switch and wire from the scrapped power supply, the filter was wired to the AC mains and then over to the power supply.  Some push-on pins were found that mated snugly with the power supply's AC input connections and connected to its AC input, but it would have been possible to cut off the original AC power cord and wire it in.  Some RTV ("silicone") adhesive was then used to secure the push-pins on the power supply's AC input as well as to hold it to the bottom of the case - either of which could be removed later, if necessary.

DC output filter:

Figure 8: 
Schematic diagram of the DC output filter.  The "ground" of this filter was firmly attached
to the metal power supply case using the ground lug of the terminal strip seen in Figure 9, below.

Errata:
 Please note that "C4" is also a low-ESR electrolytic capacitor, not "C2" as
indicated in the text, above.
With the AC line input now being completely filtered, we still have to isolate the other end of the path through which the low-level RF currents can flow - the DC output.


Inspecting the junked PC power supply again I noticed that there were two toroidal inductors and I removed them both.  One of them had several different wire gauges and was set aside, but the other consisted of a pair of wires wound in parallel, connected in parallel on the circuit board - and a quick check on the inductance meter showed its value to be around 43 microhenries - plenty good for our purposes.

Figure 9: 
Output filter components mounted on a terminal strip with the ground
lead of the capacitors being wired to the mounting lug.  One of the
two yellow monolithic ceramic capacitors can just be seen
behind the closest terminal strip.
Click on the image for a larger version.
Had neither toroidal inductor been suitable as-is, I would have picked the one with the heaviest-gauge wire and removed all but the winding with that wire:  Most of these power supplies use toroids with yellow or green cores and a dozen or two turns on these typically yield inductances well above 10 uH - more than enough to block HF energy when bypassed with good-quality capacitors.

On a terminal strip I mounted the inductor and two low-ESR electrolytic capacitors, as shown, bypassing each one with a 0.1uF monolithic ceramic capacitor.  The use of these low-ESR capacitors rather than "normal" electrolytic capacitors is important as these types are specially-designed to remove the high-frequency components.  Once you get above a few hundred kHz and into the MHz range many electrolytic capacitors start to lose their efficacy so monolithic capacitors such as the ones shown take over, shunting the RF to the case ground.

Important construction notes and comments:
    • Again, use ONLY LOW ESR capacitors for the output filter.  These capacitors are almost always rated for 105 degrees C, so if the capacitors that you have say "85C" on them, they are probably not low ESR - but their having "105C" on them that doesn't guarantee that they are low ESR, either!
    • While the output capacitors of PC power supplies are (ostensibly) of the low ESR type, it is often the failure of these capacitors - along with the fan - that causes these power supplies to fail, so don't count on a failed power supply to be a usable source!  Unless you have an ESR meter, don't count on a capacitance meter to tell you if a capacitor is any good, either:  It can still read the proper value and "seem" to be good, but have terrible ESR!
    • If a terminal strip cannot be found, a small piece of copper-clad circuit board could be used, instead, with the components mounted "dead bug" or "Manhattan style" on it, using the copper itself as a ground plane.  The circuit board material would then be mounted using screws, to the metal case, assuring a solid ground connection.
    • Be sure to ground the output filter directly to the case near the point where the DC cable exits the case rather than run a wire to the AC input filter's ground point!  One of the ways to maximize the effectiveness of the filter is to minimize the length and impedance of its ground/common connection, and the best way to do this is to utilize the broad metal plane of the case itself!

    Figure 10: 
    The input filter mounted on the wall of the power supply case.
    Note the clear plastic shield behind the phenolic board to
    prevent accidental shorting/contact through the vent holes.
    Click on the image for a larger version.
    Note that if you use ordinary 0.1 uF disk ceramic capacitors instead more modern monolithic ceramic units be aware that many of these can have rather low voltage ratings (e.g. 16 volts) unless otherwise marked.  Also note that these ordinary disk types can lose effectiveness at high frequencies so they should be bypassed with 0.001uF capacitors.

    This terminal strip was mounted to the case using a 6-32 screw and a "star" washer.  The DC output cable of the power supply was then cut and wired to the terminal strip, using the ground lug as a "common" and passing the DC through this filter which effectively shunts any RF to the case ground.

    Finishing it up:

    Once all wiring is completed, ohmmeter tests should be made to verify continuity (or lack thereof) as appropriate and stick-on feet should be applied to the bottom to prevent it from sliding around and scratching whatever surface it rests on.

    Figure 11: 
    Filters and power supply mounted within the case.
    The power supply itself was affixed using RTV
    ("silicone") adhesive.
    Click on the image for a larger version.

    How well does it work?

    At HF frequencies this filter's effectiveness is seemingly absolute in that the power supply within cannot be detected from outside the box, even with a portable shortwave radio held within a few inches!

    It should be noted that it is not the "shielding" of this box to which one would attribute its effectiveness, but simply the fact that the AC input and the DC output share a solid, common RF ground.

    Any RF currents on the AC input and DC output simply circulate on this common ground (e.g. the metal case) after having already been attenuated by the chokes rather than radiate on the AC power leads and/or the wires connected to the DC output - or the things connected to it!

    Were this same circuit arrangement constructed on a flat piece of metal without a shield cover, it would have worked nearly as well and it is likely that a shortwave receiver would have detected it at very short range (e.g. within a few feet/a meter) but (importantly!) the "grunge" would not be conducted on either the AC input or DC output leads:  The 100% cover of the case is there mostly to prevent accidental electric shock and shorting of the otherwise exposed AC mains connections and that there is no chance at all of any radiation of noise from this power supply - even over very short distances!

    Figure 12: 
    The completed, enclosed, power supply, the DC output lead seen emerging
    via a grommet.
    Click on the image for a larger version. 
    Other related articles on this subject:


    [End]

    This page stolen from ka7oei.blogspot.com