LTSpice – First Steps, Already Helpful

LTSpice is a fairly approachable, very powerful circuit simulation software system. It has a straightforward GUI interface – drop in parts from catalog, draw wires, run simulation – with a strong simulation engine sitting behind it. I downloaded it this week for the first time, and it’s already proved its worth.

Many others have written excellent tutorials about using LTSpice, so I won’t rehash the details here. I found the tutorial on All About Circuits to be very useful, if a little bit hard to follow.

One of sample projects that that tutorial walks you through is analyzing the response of a basic LC bandpass filter using LTSpice’s AC Sweep mode. After working through that, I thought it might be fun to model the front end filter on my little Direct Conversion receiver to see what the actual (expected) frequency response is. Since I had ripped those values straight from the GQRP Sudden, it seemed like a good learning experience.

So, I quickly drew up a little model of that front end filter. It looks something like this:

A pretty-little schematic! The series/parallel capacitors used values I had on had to get close to the GQRP filter values.

And, running a sweep from 1 MHz to 10 Mhz, I got… a steaming pile of what the heck kind of input filter is this??

The first AC sweep of the above schematic. More like a throw-it-in-the-bin-put filter….

-24dB at best, a “peak” somewhere above 25 MHz, there’s no way the the GQRP would have put this out in a kit. I went back through my network, looking for a dropped connection, or a capacitor with a value in farads instead of picofarads (boy will that cut your gain). But no dice, the circuit seemed solid…

…Until the third time I checked the component values, and noticed one fatal slip-up. You see, R1 and R2 in the above schematic represent the source impedance and the input impedance, respectively. While the source impedance could be a nominal 50 ohms, the RF input impedance for the NE602 mixer is at least 1.5 kOhms. Doh!

So, with a slight change to R2 in the schematic, and re-running the simulation:

The same filter as above swept with the correct ~1500ohm output impedance.

Now that’s more like it! A nice peak in the middle – not a ton of attenuation out of band, but pretty good for a little five element filter. We can even zoom in on that peak a little

A zoomed section of the sweep from above. Not quite the ideal response, but pretty close for a first-ever filter.

It looks like my filter’s currently peaked at around 6.63 MHz, instead of the ~7.15 MHz I would have hoped for, but considering the lower and upper boundaries of the US 40m band are only 2 and 4 dB down from the peak respectively, I’d call that a good first start.

A little more messing around showed that using a proper 10pF series capacitor instead of ~9.8pF doesn’t make much difference. The best solution I found to be to reduce the shunt inductors to about 4.8 uF, which puts the filter peak at just over 7 MHz. Of course, this assumes all ideal values and no parasitic effects for any of the components. And that my hand-wound toroids actually match these inductances. But hey, it’s somewhere to start!

It turns out, LTSpice isn’t just useful as a software tool – it makes a great rubber-duck debugger as well. While squinting down at the board to double-check the value of those tiny series capacitors, I realized I’d made a horrible assembly error. I should have put those two 200pF shunt capacitors in series on either side, as in the above diagram, but I instead put them in parallel….

When you build it wrong, it won’t do the thing it was supposed to do…

Yeah, forget the audio pre-amp for now. I’m losing 30+ dB to my front end filter. Time to heat up the iron.



On the Importance of Fiddling and Good Power Supplies.

Troubleshooting continues apace on the new NE602-based direct-conversion receiver. As I mentioned in the previous post about it, the receiver develops and unfortunate, LOUD squeal whenever the 10K audio gain pot at sits between the NE602 and the LM386 is advanced past about the 20% position. This is a terrible impediment to reception, so I’ve been working on eliminating this problem.

TL;DR: The receiver is a whole object tied together by its power system. Good power and a good ground are important.

My suspicions centered on the LM386 chip – after all, an audio amplifier with a couple of feedback caps seems like a prime candidate to turn itself into an audio-frequency oscillator.  This, as it turned out, was a red herring – I’d like to publicly apologize to the LM386 for ever doubting it.

The first step I took was to meter the potentiometer’s resistance at the setting just below squealing, and to replace the pot with two resistors that replicated the resistance at this setting. A little fiddling showed that the squeal could still be induced by varying these resistances slightly, which was encouraging – the problem was somewhere else in the circuit, and not a phenomenon of the pot itself.

So I took an entirely different tack to connect the NE602 and the LM386. The 0.01µF cap in series with a 10K pot was derived from a number of other designs, but it seemed worthwhile to utilize the complementary outputs from the NE602 as a means of input to the LM386’s complementary inputs. I stole this linkage directly from the EMRFD. The NE602’s pin 5 is connected to the LM386’s pin 3 through a 220nF series cap with a 10kΩ resistor to ground. Similarly, the mixer’s pin 4 was connected to the audio amp’s pin 2. Both lines were tied together with a 100nF cap.

You can see the three new blue caps that sit between the NE602 and the LM386, a well as the large white jumper bridging the 10uF cap to pin 8 of the LM386

Long story short – no help on the oscillation-front, but a little more stability in the gain, it seems?

Next, I set about fiddling with the feedback circuitry for the LM386. As the datasheet shows, there are gain configurations from 20x to 200x gain with a simple RC network between pins 1 and 8. My original configuration had a 10µF electrolytic cap in between these two pins. I tried replacing that with a 4.7µF cap plus a 2kΩ resistor, leaving those pins totally unconnected… in all configurations, it was possible to get the audio to oscillate. So no such luck there. I put the 10µF cap back in, and joined it to pin 8 with a small piece of female header, so that I could insert various resistors in that position to adjust the gain later, if need be.

Oddly, both reception gain and AM bleedthrough is increased whenever I touch the leads of the gain resistor. The AM bleedthrough sounds a lot like what happens when you touch one of the un-connected leads of the LM386, but why do I hear CW signals a lot clearer as well?

It was this oddity with the gain resistor that gave me the vital clue. “Well,” I thought, “maybe touching and fiddling with the other components will give me some clues.” I just played around on the board for 20 minutes with it powered on, tying this point to ground, putting that point high through a resistor… interesting things happened, but squealing was still very much a possibility. That is, until I happened to accidentally pull the oscillator crystal out of its holder, and the squealing stopped.

“Now that’s odd!” I thought. “I assumed this problem existed entirely in the audio half of this receiver. Why should removing the crystal, and thereby halting oscillation in the mixer, have any effect?”

A little poking around with a meter and a scope and I had my answer – the little (used!) 9V batteries I was using as a power supply for this receiver were woefully under-powered. Under load (i.e. with audio coming out of the headphones), the voltmeter read about 7.3V, and dropped by about 10 mV per second. Oscillation seems to occur when the voltage  drops too low. (I’m measuring voltage as a proxy for available power, in this case, I think.)

So, after borrowing a nice big 13.8V, 8aH SLA battery from work and bodging together a quick-connect to battery-clip connector… wait for it…

No more motorboating! (And a bunch more audio output to boot.)

Used 9V batteries just won’t cut it! The big SLA battery provided great power and more audio output.

I still need to boast the overall gain of the system, since it takes a pretty strong signal to get into the receiver, but at least it’s not likely to HOWL in my ears!

Next thoughts: to increase gain, perhaps stealing the alternate LM386 gain configuration from AA7EE’s WBR Recevier, or one of the broadband, ~18dB IF amplifier designs from the original BITX or QRPKit’s variant.




A Brief Note on Tools

In addition to the various great pieces of kit that various Ham Santas contributed this winter, I’ve been taking time to improve my selection of tools. Here’s the recent major additions:

  • Hakko FX888D Soldering Station: What a game changer! I went from using a dinky 40W fixed-temp Radioshack iron to this beauty, and the soldering experience is like night and day. The thing heats up in less than a minute, holds its temperature well, and comes with a sturdy, well-designed stand. Would recommend in a heartbeat. Got mine from Amazon, though I later saw it cheaper at Fry’s Electronics.
  • DM4070 LCR Meter: Also a very useful bit of kit. Not the most accurate meter (both inductance and capacitance are spec’d at +- 2.5%), but plenty close enough for my purposes. When I pull a variable capacitor out of an old radio, I want to know if it’s closer to 100pF or 300pF max. Similarly, I want to make sure my toroid coils are the correct inductance to about 1 sig fig; the rest I can solve by tinkering.
  • 0.1MHz~2.4GHz Frequency Counter: listed on eBay by the obscure name “cymometer,” this one’s still on its way. Even if it’s not nearly so accurate as it claims, even accuracy within 50-100hz would be useful.
  • Aoyue 486 Benchtop Solder Smoke Absorber: Not a whole lot of suction on this little guy, but the filter does seem to absorb fumes fairly well. And every little bit helps in my small shack/office/workbench.
The DM4070 and Hakko FX888D newly unwrapped, sitting next to the B&K 1535a Scope. Old abrasive cleaner sits sadly in the back right.

These useful goodies join the B&K Precision 1535a 35MHz Scope and a Mastech MS8229 as primary bench tools.


A New NE602 DC Receiver

For the most recent details on this receiver, see changes to the audio chain/power supply and front-end filter.

While researching homebrew DC receivers for my “Polyakov” style receiver board, I stumbled across Dave AA7EE‘s various projects which combined the NE602 Gilbert-Cell mixer IC and some form of IC audio amplification to make simple, direct-conversion receviers. In particular, the Rugster receiver (named after a dear and recently departed pet), which itself seems to take inspiration from a number of other receivers, including the GQRP Sudden. VK2AWC has also published some ideas along similar lines, as I’m sure have others.

So, taking inspiration (aka stealing ideas!) from the above sources, I’ve started putting together my own little receiver based on the NE602 as a demodulator and an LM386 as an audio amplifier.

As of yesterday, 1/14/16, I’ve heard the very first (faint!) signals coming out of the headphones, so I think the project deserves the start of a write-up. I think it’ll make the most sense to show the schematic as it currently exists and discuss it afterward. So, here’s the circuit, as currently built:

NE602 Receiver Schematic.
Straight out of the notebook – once this receiver has a little more guts, I’ll be working on a cleaner, digital version.

Mixer/demodulator: The heart of this receiver is an NE602 doubly-balanced mixer. It has a an input impedance of ~1.5kΩ, but for a receiver I think this will be less troublesome than it would be for trying to interface with other circuits. (But see Front end for other thoughts.) The mixer is accepting a single-ended, untuned input on pin 1, while the other RF input is simply AC coupled to ground through a couple caps.

Oscillator: Currently, the receiver is rock-bound to whatever frequency of crystal is connected to pin 6 of the NE602. I installed a bit of 0.1″ header in this position to make it easy to swap crystals in and out for experimentation. Down the road, I think I’ll need to swap this for a bit of machine-pin header for more mechanical security.

The crystal and a couple of supporting capacitors are the entirety of the external oscillator parts. I’ll admit I grabbed whatever capacitors were available in my kit – the NE602 data sheet shows a 10pF cap between pins 6 and 7 and a 22pF cap in parallel with the crystal, so I just got close enough. The crystal seems to resonate just fine, but I’ll admit I don’t know what I’m doing I this area. Likely, I’m pulling the crystals off frequency; I’ve got a frequency counter on its way from eBay, I’ll have to check this out when the counter arrives,

I mean to experiment with some deliberate frequency-pulling once I get the rest of the receiver working a little better.

Front-End: A simple 40m pre-selector filter sits right behind the antenna jack – the filter values are taken straight from the GQRP Sudden 40 and the Rugster. I formed my 5.3μH inductors as 33 turns on a T50-2 toroid.

AA7EE has an impedance transformer in his front end, with a 1:9 turns ratio, presumably to help a 50-ohm antenna to the ~1.5kΩ input impedance on the NE602.? Or perhaps just to present a higher voltage level to the mixer. VK2AWC has a 4t:38t transformer in the same spot. I may need to try this as well.

Audio Amp: The audio amplification section is a simple LM386 run in a medium-to-high gain configuration. The 10μF cap across pins 1 and 8 should lead to a gain of around 200, according to the datasheet. To this point, I’ve neglected to bypass pin 7 to ground (the datasheet suggests 0.1μF), and I think that must be necessary for a high gain-figure, since the circuit turned into a squealer when I first assembled it!

Replacing the 10μF cap with a 4.7μF cap and a 1kΩ resistor helped this problem, but I think if I can improve the stability and get that lost gain back, so much the better.
The LM386 datasheet shows a 250μF cap between the IC output and a speaker; AA7EE and the GQRP use a 100μF cap here. I’m using a 220μF electrolytic since I had one on hand.

Power: For testing, the rig is being powered by a little 9V battery, but I think may be a factor in limiting the audio output (see Known Issues below). Given that the NE602 is being powered by a 7808 regulator and the LM386-3 will take any supply voltage between 5V and 12V, I should have some flexibility in choosing a power supply later on.

I didn’t originally have a reverse-current protection diode (1n4001) nor a10μF decoupling cap in place across the power input, but in future, I think they’re a must.

Here’s an image of the circuit as currently built:

The NE602-hearted mixer, built on a piece of perfboard.

It’s not pretty, but it sure is small! I know copper clad would have provided a better ground plane, but I got impatient waiting for my shipment of copper clad to arrive from eBay.

So, with power applied and a pair of basic Apple earbuds in place, I can pick out some faint (to me) signals around 7.023! Very cool! Well, at least I could when I turned off the LED desk lamp, fluorescent work lights, and cordless-drill battery charger in my office/shack, which were all QRM-firehoses. I’ve now run these all to a single power strip, for easy on-off operation.

Nothing’s perfect, here’s my short list of known issues:

  • With a 10μF cap between pins 1 and 8 of the LM386, the unit squeals like a banshee whenever the 10k pot is advanced past about 15%. This was improved by better bypassing right at the IC’s Vs and Gnd pins, and made better again by replacing the 10μF cap with a 4.7μF cap and a 1kΩ resistor. Still not quite sure what was happening, or why this oscillation depended on the position of the input pot.
    • Update 1/25: see my later post for a solution to the squealing. Turned out, used 9V batteries are not a great power source.
  • For some reason, when I advance the 10k audio level pot past about 25%, the audio cuts out entirely – no squealing, no AC hum, nothing.
  • There is no front-end tuning at all a little more verification of the filter characteristics would probably help.

Some possible future improvements, besides addressing some on the issues above:

  • Better output overall – the audio output is quiet at best.
  • VK2AWC had some interesting ideas about the combination of NE602 and LM386 – notably feeding back a little of the output to pin 7 of the LM386 to provide higher gain, and some passive RC networks between the NE602 and the LM386 to provide some shaping to the audio, that I think will be worth checking out.
  • Mounting the project in a nice, metal enclosure.
  • Providing an interface for an external VFO. (Possibly the Si5351-driven VFO from an earlier project.

Problems are just un-implemented features.