Homebrewing, Test and Measurement

W0IYH RMS-to-DC Converter

W0IYH RMS-to-DC Converter - CloseupToday I finished construction on the circuitry for the RMS-to-DC converter described on the October 1992 QST article by W0IYH on measuring receiver performance. This is an article that I found on the EMRFD CD when I was searching for information on measuring the noise figure of amplifiers and receivers. I didn’t find the article directly, but was directed to it because it was referenced in another paper (on the EMRFD CD) by W0IYH on homebrew noise sources. Thankfully, the authors were kind enough to include both papers on the CD, since the October ’92 article gave a lot of the background needed to fully grasp the noise source article. The detector is a fairly simple circuit, since all of the hard work is being done by the Analog Devices AD636JH RMS-to-DC converter. This device measures the true RMS value of DC and AC signals (up to 200 mVrms full scale) by converting the input signal RMS value to an equivalent DC voltage. The rest of the circuit basically consists of op-amps providing plenty of buffering and one stage of gain. The gain stage is present so that you can use a 10:1 scope probe on the input.

W0IYH RMS-to-DC ConverterAs you can see in the photo to the right, there are some external controls for the circuit. At the far left is a pot which controls the signal level from the first buffer into the second buffer (which preceeds the gain stage). This allows you to accurately calibrate the detector to an on-board 200 mV reference. The rotary switch to the upper-right of the pot is the input coupling selector. You can choose from DC, AC, or GND, just like an oscilloscope. In the middle of the photo, you can see the 10:1 Tektronix scope probe that I’m using with this detector. Finally, in the upper-right corner is a rotary switch that allows you to switch in three different levels of signal attenuation: 0, 3, and 10 dB. The 3 dB and 10 dB levels are set with the little blue trim pots to the right of the probe tip. By having this attenuation built-in to the detector, the process of making NF and S/N measurements is a lot simpler.

Unseen in these photos is the simple dual polarity power supply that I built for this detector. Wall current is fed into a 120 V:12 V transformer, which then is recitified by a 1N4007 and regulated by a 10 V zener for both the positive and negative rails. I’ve still got to get the thing in it’s enclosure, but of course I had to smoke test it first before I went any further. After trimming the offsets on the gain amp and the RMS-to-DC converter, the circuit performed pretty much exactly as I expected. No great surprises, fortunately. I’ve still got a bit of copper clad to trim off of the top edge of the board, then I should be able to get the whole thing mounted in the enclosure and ready to go by this weekend.

Random Musings

Mid-Summer Shack Update

What’s going on at the NT7S shack? The project currently taking up most of my shack time is the construction of the W0IYH RMS-to-DC converter so that I can make accurate noise mesurements. I’m probably about 2/3 finished with this project, with most of the components placed on the copper clad but none of the work on the enclosure done yet. Hopefully it will be finished by the end of this weekend.

Once the RMS detector is finished, I’m going to try to characterize the ENR of my noise sources then get to work measuring the noise figure of the dual gate MOSFET amp that I’ve been measuring and refining over the last couple of months. I think that I will also be doing some work concurrently on building SSB circuitry to experiment with. W8NF loaned me a couple of great books on SSB theory, so I’ve had my nose stuck in them to try to learn a thing or two.

I’m also in the thick of the process of searching for a new home, so with any luck I’ll have a new QTH in a few months. This means I should have the ability to deploy some respectable antennas and finally get away from the horrible broadband noise problem which has been pretty much keeping me off of the air. Exciting times!

Homebrewing, Operating, QRP

Inaugural pQRP Portland Eggs & Coffee

This morning we had the first Portland-area version of the Pie & Coffee, which we have informally dubbed the Eggs & Coffee since we are meeting at breakfast time. The meeting (and I use the term informally) was at the Peppermill restaurant in Aloha. In attendance was Dave W8NF, Carl WS7L, and myself. Not a huge gathering, but it’s a good start.

Dave brought along his very impressive solid state kilowatt RF amplifier. He designed this amp while working for Erbtec Engineering, and happened to find one for sale at the Dayton flea market. The amplifier has about a one square foot footprint, but most of the bulk of it comes from the substantial heat sink on the underside of the PCB. You can see the amp right in front of Dave in the photo below. Not QRP by any means, but very cool regardless.

July 2008 pQRP Portland E&C

We also got a chance to see some prototype PCBs (you can see them above just to the right of the big amp) and documentation for Dave’s upcoming LogiKlipper RF clipper (to be released soon by Idiom Press). It was extremely interesting to learn about the design choices and trade-offs that went into the design.

Carl didn’t bring any projects, but did bring along an obviously extensive knowledge of ham radio and other technical topics. This was my first introduction to Carl, and I found out that he’s pretty involved in the local ham radio community, including his role as the local VE coordinator. I think we were able to share some of that QRP/homebrewer excitement, as he seemed very interested in the projects that we brought along and discussed. He also gave us a very nice overview of his impressions of operating the Elecraft K3.

I came with an armload of projects and components, as I threatened that I would. I got a chance to show off the pQRP LC Meter, the Willamette DC transceiver, the Tualatin superhet transceiver, my QRP EFHW antenna tuner, and an AVR-based SWR meter. The hit of the E&C seemed to be the LC meter, so kudos to NB6M for producing such a great kit. I also brought along a huge grab bag of components that I tried to pawn off, but the other two were too smart to take any of it off my hands. I did get a chance to give Dave some copper clad to use for Manhattan pads, so I’m happy that they will go to good use.

July 2008 pQRP Portland E&C

We chatted for about 2 ½ hours, but it went very quickly with all of the interesting discussion. Our table was smack dab in the middle of the restaurant with radios and parts scattered about, so we got our share of curious looks. Fortunately, the restaurant is very ham-friendly since they already host some other meetings here. I had a great time, and I think that the other guys did as well. I hope to make this a regular occurance, and that we can convince some more of you Portland-area hams to stop by next time.

Random Musings

Wisdom of the Ancients

OK, maybe not the ancients, but it has been a lot of fun listening to the old Jean Shepherd clips that Bill from SolderSmoke has been posting on his blog. I guess that I didn’t really get all of the raving that Bill was doing until I listened to one of the shows for myself. Last weekend, I sat down in the shack to do some solder melting and wanted a little ambience to get me in the proper frame of mind. I remembered seeing Bill’s blog posts in Google Reader about the Jean Shepherd clips that he dug up, so I went back in the reader and found the first one. I gotta say, his style and sense of humor holds up very well, once you get past the real hardcore 60’s and 70’s talky-talk. I found myself laughing out loud quite a bit during his monologues. Being a relative baby in ham radio years (this stuff was first on the air before I was born), this was a bit of a surprise. Bill has a new post up in which Shep opines about aliens and building a HB 2 meter rig. I haven’t listened yet, but you can bet that I will very soon.

By the way, does anyone want to fill me in on EXCELSIOR?

Sanctimonious Preaching

It Was the Worst of Times

It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to heaven, we were all going direct the other way – in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only. —Charles Dickens, A Tale of Two Cities

When you boil it down to the true essense, no matter the lofty press releases that the ARRL produces about the public service aspects, ham radio is just a hobby for most of us. I think we all get frustrated with aspects of the hobby (and the jerks who ruin it) at times, and we have different ways of dealing with it. If things get really bad, most hams can just turn off the radio or unsubscribe from the reflector full of loudmouthed trolls.

Side note: I don’t know what it is about the more technical hobbies (and professions), but they seem to attract a large contingent of zealous acolytes who could give the most rabid religious fundamentalists a run for their money. Disagreements often turn into the “intellectual” equivalent of a pissing contest, with all of the irrationality that implies. Particularly strident defenders of the faith see those who disagree with them as akin to a heathen atheist or a card-carrying Satan worshiper. There must be some pathology of the brain responsible for this kind of reaction. In some folks it manifests as fervent belief in their particular brand of religion, in others it shows up as a certainty in their unique knowledge of The Scientific Truth™.

Usually you get pissed, then you give yourself some downtime, spend some more time with the family, or play with a different hobby for a while. The problem comes when you start to get yourself more wrapped up in the hobby than usual. When your enjoyment and fate in the hobby starts to be tied to ensuring the success of others, it’s not quite as easy to pull yourself out without having a negative impact on others. The case in point for me is the difficulties with the 2nd kitting of the Willamette QRP transceiver. This project has been a source of great excitement and enjoyment for me (as well as others, I think). But now it feels like the albatross around my neck. My life is going though a lot of changes right now, and changes equals stress. The last thing I need right now is the added stress from a hobby project gone sour. It would be nice to be able to just brush aside the troubles, but I feel that would be a betrayal of those who are counting on getting what they paid for.

Truly, this is a bittersweet topic. If it wasn’t for all of the great times I’ve had and good friends that I’ve made, I would have probably already given up. But I feel that there have been too many positive effects from the project to let it end on a bad note. I’m praying that we can soon arrive at an outcome that satisfies most of the participants. Perhaps that will salvage some of my faith in humanity and will help to keep me from wanting to give up on these public projects.

Design, Homebrewing

Dual Gate MOSFET Investigations – Return Loss

Even though a homebrew return loss bridge is a relatively simple piece of gear to build, I’ve never gotten around to building one until now. Which is truly a shame, and something I don’t really have an excuse for, except perhaps laziness. I’m excited to add this essential gear to my stable of test equipment, as I know that I’m going to get a ton of useful data from it in the future. Now that I have all of the necessary equipment for measuring the return loss of the evolving dual gate MOSFET amplifier, it was time to get the job done.

Return Loss Bridge

Test Equipment

  • Power Meter: M3 Electronix FPM-1
  • Voltmeter: Fluke 8840A
  • Signal Generator: Tektronix SG503
  • Return Loss Bridge: Homebrew (51 Ω, ¼ W resistors, FT37-43 bifilar transformer)

The Circuit

Based on the suggestions made on the EMRFD list, I modified the amplifier to incorporate the best practices that were recommended. First off, I tossed out the 100 kΩ gate 2 resistor, which was serving no useful purpose (except for dumping noise into the amp, according to W7ZOI). The bypass cap leads were clipped very short and soldered directly to gate 2. I’ll probably change this to a 10 nF or 1 nF cap in later iterations, but I took the lazy way out and left it as is for now. The other change was the addition of R2, the swamping resistor for the drain inductor. VAGC was set for 9 V, a point which should give nearly the full amplifier gain.

Dual Gate MOSFET Return Loss


Before taking the return loss measurements, I checked out the biasing and gain of the new amplifier configuration. Not surprisingly, the transducer gain dropped to 17.3 dB (-30 dBm input signal at 28.1 MHz), which of course was the whole point of adding R2. The drain current at this bias point is only about 2.5 mA, so there’s still lots of headroom in this amp.

Using the procedure outlined in EMRFD, I measured the amplifier input and output return loss. The SG503 was set to 28.1 MHz with a -10 dBm output level and connected the the RF port of the return loss bridge (RLB). The detector port of the RLB was connected to the FPM-1 and a reading of detector power was made with an open circuit on the unknown port of the RLB. Next, I terminated the output of the amplifier in 50 Ω, connected the unknown port of the RLB to the input of the amp, and applied DC power to the amplifier. The difference between the two readings was the measured input return loss (S11), which was 10.0 dB in this case. Using a handy chart, I translated this into a VSWR of approximately 1.93. Given what I’ve seen in the literature about the poor input return loss characteristics of dual gate MOSFET amplifiers, I was actually pretty pleased with this number.

I repeated the measurement, but this time I terminated the input in 50 Ω and connected the unknown port of the RLB to the amplifier output. This indicated the output return loss (S22) to be 11.9 dB, which is a VSWR of approximately 1.68. This shows that the load transformer is doing a fairly decent job of handling the impedance transformation on the output.

This was a simple test, but the results were satisfying. In the current state, this amplifer should work fine if integrated into a large system, such as a receiver. The real question is the effect that the 2.2 kΩ termination on gate 1 has on noise figure. Speaking of noise figure, I plan to make this measurement next, but I have quite a bit of work to do first. In order to characterize the ENR of my noise generators, I’m going to need to get my hands on a true-RMS detector. I’ll probably end up building the one that Sabin describes in his paper on the EMRFD CD that deals with measuring receiver sensitivity and noise. But that means waiting, since I have to order a few of the parts. I’ve also got more reading to do in order to better understand everything that’s going on with noise figure measurements. I also need to start thinking about how I’m going to get my hands on a spectrum analyzer to make IMD measurements. Which is funny because I work on very nice spectrum analzyers every day at work!


Dual Gate MOSFET Revelations from W7ZOI

Some days I feel like I can’t see the forest for the trees. After submitting my last dual gate MOSFET experiment to the EMRFD group for review, I got a nice note from Henning suggesting that I needed to bypass gate 2 directly. Of course, like a three-year old who has to constantly ask “Why?”, I questioned how necessary it was to get the bypass capacitor right at gate 2. Wes, W7ZOI kindly gave me an education on the pitfalls of an unbypassed gate 2:

Yes, it can make a profound difference. The capacitor really need
to be right at the gate. If you don’t bypass gate 2, you will dump
the noise voltage from the resistor driving gate 2 right into the
FET. With 100K, that voltage will be high. This could really trash
the amplifier NF performance, turning a stellar performer into
something that is pretty bad for NF. But use a really good bypass
cap that is going to do a good job at VHF and UHF. A 1000 pF with
really short leads is good. This is a good place to use a chip cap
even if you are among the folks who don’t like SMT parts.

Many thanks to Wes for putting up with such a stupid question. One thing that I really appreciate about his writing is that he can explain things to you in a way that make it seem completely obvious, yet without talking down to you. He also goes on to explain the rationale behind two commonly seen resistors in dual gate MOSFET amps:

There are two resistors that we often see in the drain circuits.
One is a swamping resistor that is directly across the primary (drain
winding) of the output transformer. This merely constrains the gain
to a smaller value. It also serves to provide a clean output R.
This loading R will help to stabilize the amplifier, but will not do
a lot at UHF.

This is an area worthy of further investigation. Specfially how much it degrades IMD and NF compared to the benefits

The other resistor is one that is right in series with the drain.
This is often in the region of 20 to 100 Ohms. This serves to
provide a wideband load that kills UHF oscillations. The utility of
this resistor can be studied with a microwave stability analysis,
easily done with numerous programs, or from scratch if you are
willing to do some analysis. You will see examples of the small
drain R in some of the amplifiers in emrfd.

This looks like a good project for LTSpice. I figured that looking into these MOSFETs would be pretty straightforward once I understood the biasing, but this investigation is leading into all kinds of interesting side roads. I can tell that I have my work cut out for me!

Design, Homebrewing

Dual Gate MOSFET Investigations – Gain and AGC

Having determined some basic characteristics of the biasing of the BF998 dual gate MOSFET in a previous experiment, it was now time to look into the gain and AGC performance of the amplifier. A few changes were made to the original circuit to turn it into a proper RF amplifier.

Test Equipment

  • Power Meter: M3 Electronix FPM-1
  • Voltmeter: Fluke 8840A
  • Signal Generator: Tektronix SG503

Initial Test Conditions

The gate 1 voltage (VBIAS) was initially biased to 3.16 V, a level that was previously determined to give about 10 mA of drain current when gate 2 is biased to 9.2 V. The input signal was set to a frequency of approximately 28.1 MHz, to give an idea of the amplifier performance in the upper HF bands. The output power of the signal generator was set to -30.0 dBm into a 50 Ω resistive load. This gave me enough power to make a good measurement with the FPM-1 while avoiding the problem of gain compression. All gain measurements are based off of this amplifier input power (in other words, the amplifier gain described in this report is the transducer gain).

The Circuit

The DC biasing of the circuit is virtually identical to the final configuration determined in the first experiment. However, there have been some changes in regard to the input and output circuitry. First of all, the gate 1 bias is now fed through a 2.2 kΩ resistor which is bypassed to AC ground with a 100 nF capacitor. This sets the input impedance to 2.2 kΩ. Values around 2 kΩ seem to be fairly common in the literature, apparently because of the noise figure benefits. I would like to investigate this further in a later experiment, but for now we’ll go with the wisdom of others. A typical L-network was placed on the input to transform the 50 Ω amplifier input impedance to the 2.2 kΩ impedance that gate 1 wants to see. The drain inductor was replaced with a 10:2 ratio transformer to give the drain a load of 1.25 kΩ to work into when a 50 Ω load is placed on the amplifier output. Again, this is another area where I decided to go with the wisdom of others. This drain load values seems reasonable based on other FET amplifiers I’ve used, but it might also be an area worth investigating later.

Dual Gate MOSFET Gain


Under the initial conditions described above, I measured an output power of -6.1 dBm, which indicates a transducer gain of 23.9 dB. This seems like a reasonable and believeable amount of gain from a single amplifier given the biasing levels established. I decided to vary VBIAS a bit to determine the point of maximum gain for the amplifier. At a gate 1 voltage of 3.43 V, I measured -5.9 dBm of output power, or a gain of 24.1 dB. There is a slight amount of difference between the two voltages, but not enough to be significant. It seems that the initial estimate worked fairly well.

AGC Characteristics

Next, the circuit was modified slightly to examine the AGC characteristics of the BF998. Both the source and gate 1 were biased to approximately 3 V using a blue LED. This biasing method is very convenient, simple, and stable, even if it may not bias gate 1 to its ideal point. This reduced the drain current to 6.6 mA, which would mean a slightly lower maximum gain, but also would be a more power-efficient way to run the amp. I could have used two red or green diodes in series, or a string of small-signal diodes as seen in the Hybrid Cascode amplifier, but the blue LED uses the least parts (and is pretty to boot). The fixed voltage divider bias was removed from gate 2, and in its place a variable AGC voltage (VAGC) was applied. The same -30.0 dBm input power was used, and the output power was measured at different settings of VAGC.



As you can see in the table and chart below, there is a large AGC voltage range with very little gain variation, then a sharp knee where there is a steep slope of gain reduction. The knee occurs at an AGC voltage of about 3 V. Between 2 V and 3 V is the largest gain variation (about 40 dB). This AGC response curve actually appears to agree fairly well with the curve published in the Philips RF Manual 3rd Edition Appendix for the BF998. The AGC range of approximately 50 dB also seems in line with the data published by NXP. It does look plausible that two of these amplifiers cascaded together could provide nearly 100 dB of gain reduction (another experiment idea for later).

2 V -55.7 dBm -25.7 dB
2.25 V -52.8 dBm -22.8 dB
2.5 V -37.2 dBm -7.2 dB
2.75 V -23.3 dBm 6.7 dB
3 V -16.0 dBm 14.0 dB
4 V -12.6 dBm 17.4 dB
5 V -11.2 dBm 18.8 dB
6 V -10.4 dBm 19.6 dB
7 V -9.9 dBm 20.1 dB
8 V -9.5 dBm 20.5 dB
9 V -9.1 dBm 20.9 dB
10 V -9.0 dBm 21.0 dB

Dual Gate MOSFET AGC Graph

Next, I intend to build a return loss bridge (finally!) and get some measurements on this amplifier. I also need to look into what it will take to measure noise figure, and get started on that test rig as well.

Coding, Microcontrollers

Programming AVR Microcontrollers in Eclipse

Lately, I have been using my Ubuntu Hardy Heron box for coding and programming my AVR projects using the simple combination of gedit, the avr-gcc toolchain and the USBtinyISP. It’s a little bit of a pain to get set up correctly, but it works very well once it’s up and running. I’ve been pretty happy with editing code in gedit then compiling and programming the AVR via command line. It’s pretty easy to quickly make changes to the code and save the C file in gedit, then use the command history of the terminal to re-run make and avrdude.

However, I recently ran across this posting when browsing the AVR Freaks forum. The author kindly gives instructions on how to set up the Eclipse IDE for use in AVR development on the Ubuntu platform. This looked really promising, since I’ve always been a sucker for nice IDEs (yes, I know that probably lowers my geek cred a few notches). So I gave it a go and found that the instructions worked nearly flawlessly. The only hiccup I encountered was at the very end of the build process when Eclipse was waiting for the sudo password for avrdude (oddly enough, you have to run avrdude as root to access the USB programmer, unless you implement a little workaround that I’ll show you in a second). I didn’t see any way to enter the root password into a terminal, so I had to cancel the whole process.

A bit of thought and much more searching brought me to the answer to the problem. There is a way to get non-root access to the USBtinyISP. You have to create a udev rule to tell the kernel to change permissions on the USBtinyISP. The documentation on the ladyada website tells you to do this, but it only gives you half of the story. First of all, it doesn’t mention exactly where to place the new rule that you are creating. Her documentation stated that I needed to put the rule in a file in /etc/udev/rules.d/. The problem is that this doesn’t state whether I need to place the rule in an existing file or create a new one. After a bit of trial-and-error and yet some more Google searching, I found out that I needed to create a new file for the USBtinyISP. So a new file named 50-usbtinyisp.rules was created. The other problem is that the actual rule given on the ladyada site seems to have a typo in the MODE parameter. Comparing this rule to some other rule examples, it appears that the correct rule is:

SUBSYSTEM==”usb”, SYSFS{idVendor}==”1781″, SYSFS{idProduct}==”0c9f”, GROUP=”users”, MODE=”0666″

Once you get the udev rule set up correctly, you no longer need root to access the USBtinyISP, and the entire build process in Eclipse works flawlessly.

So far, using Eclipse as an AVR development platform has been a real pleasure. There’s a lot of nice little touches, like having quick access to all of the special function registers of each device and easy configuration of the build parameters via GUI. If you are like me and like the convenience that an IDE gives you, then the AVR/Eclipse environment is an excellent choice, and may even be better than WinAVR.