LT Spice For Radio Amateurs: PART 5

All radios are made up of some rather standard blocks we use over and over, we have filters, amplifiers, mixers, that is is, no rocket surgery required. A product detector is not someone searching for a product to buy, its just a mixer, a beat frequency oscillator is nothing more than an amplifier with positive feedback to make it go bonkers in a controlled manner and filters, well they just filter out the crap we do not want.

Sure this is an over simplification, but it is near enough to being the truth. I know for myself, once i got my head around the nomenclature of radio and started to see things for what they really are, that things started to make sense to me. So in the next few parts, lets take a look at some of the specific things we can do in LT Spice to get a better understanding of the performance of our circuit under test, starting with filters.

So this is a filter I have used in a number of projects before. I think we have all used someone else’s design without really knowing if that design is any good or not. So, now that we can used LT Spice, we can see for ourselves if someone else’s design is actually any good, or if their design is rubbish. And when we look around the net we see these kinds of blocks being copied over and over and this assume that its good, if might just be that everyone is copying the same bad design.

So if you are paying attention to the above schematic you will notice some things different. Previously we have performed Transient Analysis, and now we are doing something different, performing an AC Analysis which will allow us to sweep the circuit under test with a range of frequencies and get a Bode Plot at the end to look at.

We set up our voltage source with an AC Amplitude of 1 and of course 50R series resistance as the filter is 50 ohms impedance in and out.

Next click SIMULATE->Edit Simulation Command and select the AC Analysis tab. Change the type of sweep to Octave, and add in the other details, for the number of sample points, start and stop frequency. Click ok, then run the simulation and let the fun begin.

Now, if you click on the trace number n004 in my case, you can add upto 2 cursors per trace and move them about to to take some measurements. Cursor 1 is showing the center frequency of the filter, 7.150MHz and its at -6db, cursor 2 is at 12MHz and its -54db, 54 minus 6 is 48db DOWN on the bandpass. Which is good information to be able to work out, you can then tell how far attenuated the Image frequency of your mixing scheme is, the IF freq etc etc to see if your filter is good enough for your task.

Now we have only done this with a single Bandpass filter, you can also do the same with the Low Pass Filters on your transmitters and do the same math to work out how great the attenuation is of the 2nd and 3rd harmonics. A clean signal is a good signal. But I will leave that up to you to try. And now you know enough about how to use LT Spice to perform AC Analysis and to design, align and specify the properties of filters. Get out there and have fun, test your designs and make sure your homebrew radios present the cleanest signal they can.


LT Spice For Radio Amateurs: PART 4

So lets bring everything we have done so far together into 1 project. So we use a new component in this schematic a transistor. To add the transistor select components->npn. The we can right click the component and select a transistor type. For this circuit we will use some rather standard 2n2222 and the 2n2219a.

So in the above circuit we have a voltage source V2 where you will notice the proper use of Label Nets. Anywhere a Label Net has been placed with the value of 12v, the 12 volts from  V2 will be applied. Run a transient analysis with the following values to see for yourself how the Label Net works “.tran 0 0.000001 0.0000001”.


Ok, so what is the above circuit. It is a rather poorly designed buffer and amplifier. What is does however is demonstrate everything we have done so far. We have voltage and signal sources, we have the voltage divider R1 and R2, we have DC Blocking caps C2, 3 and 5, we have L1 blocking AC from entering the power rail. Something else you might notice is we are using 200 ohms for the load and source impedance.

So, once you have the circuit built, run a simulation and follow the signal through the circuit. There is so much that can be learned from probing about the circuit. Voltages can be found on the base, emitter and collector of the transistors, the current flowing through the transistors can be found and we can see the amount of total gain of the amplifier.

So for those who have been paying attention, you will have noticed that the input signal is 0.2v p-p, the green trace in the above circuit. And the output at the top of R6 is close to 5v p-p, which means that the gain is close to 27db.

And there you have it, you now know enough to be able to make complex circuits in LT Spice and simulate them and make usable measurements to define some parameters of amplifiers.


LT Spice For Radio Amateurs: PART 3

Flow control is something we need to do in radio circuits, we want to keep things out, let only some things pass and all that. We certainly do not want the output of our amplifiers being sent out the power jack into the house wiring and turning the house into a giant antenna for our oscillator circuit. Nor do we want DC being passed into our amplifier circuits either, because that adds a DC offset to the signal that is often not desirable. So, what we do is use DC and AC blocking. So lets knock up a circuits that demonstrates these principles. No gimmies this time, you are on your own.

In the above schematic we have a 7mhz signal source consisting of a 1v p-p sine wave with a 5v dc offset. Signal impedance is set to 50 ohms and a 50 ohm load is used.

So when this circuit is run, out-a should show the 1v signal with 5v offset and when probing the other side of the DC blocking cap, all we have left is the 1v p-p signal as the cap blocks the 5dc from passing on in the circuit.

An inductor does the opposite of the dc blocking cap, it blocks the ac signal and allows dc to pass through. The green trace is out-a and the blue trace is out-b. So from the above 2 simulations we have a good demonstration of the DC blocking and AC blocking action of capacitors and inductors. Add in a voltage divider and a transistor to both of these and we have a simple amplifier.

And with that, you now know a bit more about electronics fundamentals and a good grounding in some of the fundamental aspects of using LT Spice in using signal sources, voltage sources, dc offsets and making complete circuits. Have a play with values in the above circuits and see what the outcomes might be. As this will demonstrate why certain values are often chosen and used in different designs.


LT Spice For Radio Amateurs: PART 2

Ok meat and potatoes time. Lets look at some simple circuits that are electronics fundamentals to illustrate the basics of using LT Spice.

FILE: Voltage-Divider

So you built the voltage divider circuit above, or if you were lazy you downloaded the one I have linked above. Either way, you now have a complete circuit that can be simulated. We have a voltage source providing 12 volts to the circuit, we have R1 and R2 forming a voltage divider, we have a ground and we have 2 Net Labels, Out-A and B.

In this instance the net labels are not being used for their proper purpose, but rather to provide a convenient place to probe the circuit under simulation. So, lets run this thing and see if it does what we expect, in proving Ohms Law is true and working HEHE.

So if you assembled the circuit yourself, right click the schematic and select RUN. This will bring up the simulation command window. We will be performing a Transient Analysis, plug in some values as I have above, and click ok. The window will now split and show you the simulation window.

If you move the mouse around in the schematic window you will notice that the cursor will change from cross hairs to a probe when you hover over OUT-A and B and will look like a current meter when you hover over the voltage source. So we can measure the voltages at points A and B and the current flowing in the circuit. And if you look in the above image, you will see 2 traces, the green one is 12v from out-a and the blue one is 6v at out-b, just what we expected for a voltage divider with 2 10K resistors.

Change the value of the resistors and then run the simulation again, notice what effect that has on the voltage at out-b, its going to change, by how much will depend on the value you change it to.

FILE: Pi-Attenuator

Another simple resistor only circuit is the pi attenuator, I think off the top of my head that this attenuator is -3db. Load it up and run it and see if i am right.

This time we are using a voltage source as a signal. Select a sine wave, give it an amplitude of your choice, its value is Peak to Peak, set the frequency of the signal, I gave it 7 megahertz. Now, this is important, all signal sources need to have their impedance set. The Series Resistance box will set the signals impedance, and being that we like to have 50 ohms impedance everywhere, lets set the series resistance to 50R. Also, all circuits need a load impedance also, if you look at the schematic you will note there is a 50R resistor to ground after the circuit under test, this sets our load impedance to 50R also. 50R in, 50R out, with known impedances we should get accurate results.  Click ok, then run the simulation using the transient analysis numbers shown in the above schematic. Probe points A and B and you should have something like the image below.

The green trace is our 1v p-p 7mhz input signal, the blue trace is our attenuated now 700mv p-p signal. And now you know enough about how to use LT spice to test simple circuits, using both DC voltage sources and AC signal sources. Change the values about and see what happens, the good thing is none of this costs any components or solder. Just your time and some self learning.


LT Spice For Radio Amateurs: PART 1

Ok, so sometime ago I started writing a series of articles for the WIA AR Magazine from a beginner to homebrew persective. Now for various reasons of no real importance to this story part way though i changed my mind and pulled the pin on the whole thing, but I still have my original files and so now seems as good a time as any to edit them up, add some more information and present them here for those who might be looking for a very basic intro into LT Spice.

I am going to assume you know how to download and install the software and get it up and running. And I am only going to gloss over using the interface and get straight into building basic circuits in the program and testing them. For some circuits I will provide the LT Spice files, for others I will not. The whole point about this series is to learn HOW TO DO IT, not just play with the crap I have already done.

So, lets get into it.

The Interface:

Everything you need to know is pretty much in this one picture. So run the program, click FILE->NEW SCHEMATIC and start clicking things.

  1. The Scissors: are used to remove components and wires when you stuff things up.
  2. The Pencil: is used to connect parts together with wires.
  3. Ground: every circuit has to have a ground point. It wont work without one.
  4. Label Net: Meh kind of ignore this for now.
  5. Resistor: used to place resistors in the circuit.
  6. Capacitor: used to place caps in the circuit.
  7. Inductor: used to place inductors in the circuit.
  8. Diode: used to place diodes in the circuit.
  9. Components: components are things like IC’s, transistors, voltage and signal sources.
  10. The Hands: used to move things or drag things around in the schematic.
  11. Text: to add notes to the schematic.
  12. Spice Directive: High end feature used for making complex inductors like bifilar and trifilar windings.


When you place a passive component in the schematic it has no value. To set its value you right click on it and this window pops up. You can enter the values in Ohms, Farads or Henry’s and thats ok if you know exponential notation, or you can shorthand things for resistors 10R, 10K, 10M will be 10 ohms, 10,000 ohms and 10 million ohms, capacitors 10pf, 10nf, 10uf for pico, nano and micro farads, and inductors 10nh, 10uh for nano and micro henry’s.


Finally, components, the main things we will be placing are NPN transistors, N type MOSFETS and Voltage Sources. Voltage sources can be DC or AV volts like for powering things and they can also be AC Signal Sources.

And with that, you now know how to place components into a schematic and find all the parts for might need to build, test and simulate many different circuit types in LT Spice.


LTW455IT Ceramic Bandpass Filter

I was digging about in my pile of crap the other day and came across these IF filters i bought from MiniKits. 455khz IF with 2k -6db bandwidth. So seeing I have not been well for the last couple of weeks, I decided to knock up a schematic using these parts and a bunch of other bits i have sitting here, with the idea of eventually building it.

The audio stages are what I will use in the CW Superhet project, so it was not a total waste of time, same with the RF preamp. Anyway here is the schematic, its unbuilt and untested, so it might be a big pile of crap. You be the judge.


CW RX Update: Band Pass Filter

So i rewound the inductors, after lots of stuffing about I got them ball park.


Ran the filter up in the bode analyzer and well the filter part looks close enough, but it still needs more inductance, maybe another 2 turns per toriod to get the center frequency up to where I want it. Now, that second hump in the plot at 21mhz, I got no idea why that is there, when you look at the next plot where i inject 20mhz into the filter and look at the output on the scope, you will see it does not exist in reality, but shows in the bode analyzer.

Filter output at design frequency.

Frequency output where that hump is on the bode plot. Its obviously an aberration in the analyzer and for now I am not sure why its there.


CW RX Update: Winding Toriods

Here is a picture to get all the bifilar fan boys all worked up 🙂 2m of wire twisted like the knickers of the net control on an 80m tomato net. Yes i have not been very active over the last few weeks, its cricket season and then there is cricket and well i have not been feeling well and did i say there has been cricket. Well i have been thinking about the project and planning ahead and making sure I have everything I need here on hand. Should move ahead a little quicker now the cricket is over.


So i have rewound the inductors for the bandpass filter and just need to solder them back into the board and then measure the filter response. And have also wound a couple of 4:1 transformers for the next part in the project. Time for a nap.


Sometimes Things Make No Sense

Yes sometimes things make no sense at all. Typically because you stuffed up in the first place. In this post haste modern world I got my Ying mixed up with my Yang and well things go bonkers when you do that.

So I am still trying to work out why my inductors are not right, but I have finally started to get some results that make sense and fit with that I am seeing with my measurements. So my dilemma has been my low pass filter designed for 7mhz had a center frequency closer to 20mhz, obviously something is wrong. I checked all the cap values as I was building it, they were all correct, I wound the inductors with the correct number of turns for the inductance needed, check them with an LCR meter and they seemed to corroborate. There were no solder bridge’s or cold joints. So the obvious place to look was the inductors.

So i knocked up this test jig, the inductor is in series with a known value resistor. V1 is a signal generator, the frequency is changed until the voltage at V_2 is exactly 50% of the voltage at V_1 and the frequency of the signal generator noted.

So I did this 2 times, the first time above using a 99.7R resistor, that was the measured value of the resistance used and the above was measured on the oscilloscope. The blue trace is the input voltage V_1 and the yellow trace the 50% measured voltage V_2. The frequency on the signal generator was 6.3mhz. This scope if not very accurate.

I repeated the process using 199R resistor and noted its frequency, the measured inductance was 4.3uH and 4.5uH certainly near enough to the method was working as it is meant to and well within the margin of error for this type of ball park measurement technique.

So with the frequency of the 50% voltage we can use this formula to find the inductance. L= R*sqrt(3)/(2*pi*f) which works out to be 4.3uH or near enough

So with my new found inductance value, I simulated the filter this time using 4.4uH for the inductance value mid way between my 2 measured values, and the simulation plot started to look a lot like what I was I was seeing with the bode plots i was making of the filter. So it looks like I have found my culprit. The actual inductance was lower than what would have been expected for the number of turns I had on the toriod. A few more turns and it should be right to go.


A Lesson In Inductance

This is all kind of Schrodinger’s cat, but it turns out not all 6uH is made equally. 6uH can be 6uH, 6uH can be 12uH and 6uH can be a capacitor and the only thing different between all these 6uH’s is the frequency they have been measured at.

So tonight i got well and truly schooled on inductance and why my bandpass filter was looking rather bonkers. I built it with the right capacitors, i wound inductors with the right number of turns for the required inductance i assembled a really nice looking filter. But when it came to measuring the bandpass it was orders of magnitude wrong.

This is how my filter should have looked, well, at least something like that.

This was the bonkers mess I was measuring in the Bode Analyser.

So after much discussion with a much smarter man than me, and working out everything i was doing wrong, I ended up with this testy jig, 200R in series with the inductor, feeding one side with the signal generator while measuring both the input voltage and the voltage across the inductor. Changing frequency until my output voltage is 50% of the input and then using this following formula to calculate the inductance. L= R*sqrt(3)/(2*pi*f) that at least gets me in the ball park, and it turns out I was orders of magnitude off with the inductors i wound and were most likely acting like capacitors at 20mhz where my filter was peaking.

This guy is keeping one eye on things, just to make sure I do things right.