Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 3

Simulating LC Tank Frequency Response in LTspice

Recommended resources

Introduction

In our previous lesson, we explored the theory behind LC tank circuits, understanding them as resonators that exchange energy between an inductor and a capacitor. We derived the crucial formula for resonant frequency, , and established that a parallel LC circuit exhibits a very high impedance at this specific frequency.

Today, we will bring that theory to life. This lesson fulfills your preference for virtual prototyping by guiding you through setting up LTspice, a powerful and widely-used circuit simulation software. You will build and simulate your first LC tank circuit to observe its frequency response directly. This practical exercise will visually confirm the concepts we've discussed and provide you with a foundational skill for designing and testing all the circuits in our walkie-talkie project.


Part 1: Installing LTspice

Our first step is to get the software running. LTspice is a free SPICE (Simulation Program with Integrated Circuit Emphasis) simulator from Analog Devices. It is an industry-standard tool for analog circuit simulation, so becoming proficient with it will be valuable throughout your electronics and telecommunication engineering studies.

The following video from the Afrotechmods channel provides a clear, concise guide to getting started.

Circuit Simulation in LTSpice Tutorial part 1/3

This video, "Circuit Simulation in LTSpice Tutorial part 1/3," will guide you through the download and installation process.

Please watch the initial segment from the beginning until the installation is complete. Follow the steps to download and install LTspice IV (or the latest version available) from the Analog Devices website.

Once you have LTspice installed and can open it to a blank window, you're ready to start building.


Part 2: Building the LC Tank Test Circuit

To analyze our LC tank, we can't just simulate the inductor and capacitor in isolation. We need a way to "excite" the circuit with a range of frequencies and measure its response. We will build a simple test circuit to do this.

The circuit consists of:

  1. An AC voltage source (V1) to provide the input signal.
  2. A series resistor (R1). This resistor forms a voltage divider with our LC tank. The voltage across the tank will be proportional to its impedance.
  3. A parallel LC tank circuit, made of an inductor (L1) and a capacitor (C1).

Let's use the following component values for our simulation:

  • R1 = 1kΩ
  • L1 = 10µH (microhenries)
  • C1 = 10nF (nanofarads)

Before you build, take a moment to calculate the expected resonant frequency using the formula from our last lesson. What frequency do you expect to see the peak response at?

Now, let's build this circuit in the LTspice schematic editor. The process involves selecting components from the library, placing them on the schematic, and wiring them together.

Circuit Simulation in LTSpice Tutorial part 1/3

The Afrotechmods video provides an excellent walkthrough of the schematic editor's basic functions. While the video builds an RC filter, the steps for placing and wiring components are identical.

Watch the segment from "Okay once you've got LTSpice installed". As you watch, perform these actions in your own LTspice window: Open a New Schematic. Add a resistor, an inductor, and a capacitor. Use CTRL+R to rotate components before placing them. Add a voltage source and a ground symbol (every simulation needs a ground reference). You can find the voltage source by pressing F2 to open the component library. Right-click the components to set their values: 1k for the resistor, 10u for the inductor (LTspice understands 'u' for micro), and 10n for the capacitor. Use the wire tool (F3) to connect everything as shown in the diagram below. Remember to press ESC after drawing each wire segment.

Your final circuit should look like this:

A diagram of the test circuit in LTspice. The output voltage will be measured at the node between the resistor R1 and the LC tank.


Part 3: Configuring the AC Analysis

With the circuit built, we need to tell LTspice what kind of simulation to perform. We want to see how the circuit behaves over a range of frequencies. This is called an AC Analysis or frequency sweep.

This process has two parts:

  1. Configure the Voltage Source: We must set the voltage source V1 to be an AC source for this type of analysis. We will give it an amplitude of 1 volt. This makes the output graph easy to interpret, as the output voltage will directly correspond to the circuit's gain (or attenuation).
  2. Define the Simulation Command: We will add a SPICE directive (.ac) to the schematic to define the parameters of the frequency sweep, such as the start and stop frequencies.

The following videos explain this configuration in detail.

Circuit Simulation in LTSpice Tutorial part 1/3

First, let's return to the Afrotechmods tutorial to see how to set up the voltage source and the simulation command.

Watch the section from "Now things are going to get interesting". Follow these steps: Right-click the voltage source V1. Go to the Advanced settings. Select the option for a small signal AC analysis. Set the AC Amplitude to 1. Go to the main menu: Simulate -> Edit Simulation Command. Select the AC Analysis tab. Set the Type of sweep to Decade. Set Number of points per decade to 101 (for a smooth curve). Set the Start frequency to 10k (10 kHz) and the Stop frequency to 10Meg (10 MHz). This range should comfortably contain our calculated resonant frequency. Click OK and place the .ac dec 101 10k 10Meg text block anywhere on your schematic.

For a slightly different perspective and a clear explanation of why setting the AC amplitude to 1 is important for AC analysis, you can also refer to the "LTSpice for Beginners" video.

LTSpice for Beginners: Simulating Time and Frequency Domain of a Filter

This video from Gadget Sideload reinforces the concept of setting up the AC analysis.

Pay close attention to the segment from "so it changes from a transient", where the presenter explains that the simulation will fail without setting the AC stimulus on the voltage source. This is a common beginner mistake.


Part 4: Running the Simulation and Analyzing the Results

Now for the rewarding part. Let's run the simulation and see the frequency response of our tank circuit.

  1. Click the "Run" button on the toolbar (it looks like a running figure).
  2. A black plot window will appear. Move your mouse over the schematic; your cursor will change into a red voltage probe.
  3. Click on the wire connecting the resistor, inductor, and capacitor. This is the node where we want to measure the output voltage.

A graph will appear, showing the voltage magnitude at that node across the frequency range we specified. You should see a distinct peak in the graph. This peak occurs at the resonant frequency!

Why does a peak occur? At resonance, the parallel LC tank's impedance is at its maximum. In our voltage divider circuit (R1 and the LC tank), a higher tank impedance means a larger share of the input voltage appears across it. Away from resonance, the tank's impedance is low, so the voltage across it is also low.

Let's analyze the plot to confirm our theory.

Circuit Simulation in LTSpice Tutorial part 1/3

The final section of the Afrotechmods video shows how to interpret the plot and take measurements.

Watch the segment from "Okay now we're ready" to understand the basics of the plot window. You'll see two traces: a solid line for magnitude and a dotted line for phase. For now, we are most interested in the solid magnitude line. To get a precise measurement of the peak: Click on the name of the trace at the top of the plot window (e.g., V(n002)). This will attach a cursor to the graph. A pop-up box will display the cursor's coordinates (frequency and magnitude). Drag the cursor to the very top of the peak. The frequency displayed in the pop-up box is your simulated resonant frequency.

Compare the frequency you just measured with the one you calculated earlier. They should be extremely close (likely within 1% of each other). For our values of L=10µH and C=10nF, the calculated frequency is approximately 503.29 kHz. Your simulation should show a peak at or very near this value.


Conclusion

Congratulations, you have successfully simulated your first RF circuit! This is a major step that bridges the gap between abstract equations and practical circuit behavior.

Here are the key takeaways from this lesson:

  • You have installed and learned the basic operation of LTspice, a fundamental tool for circuit design.
  • You built a test circuit to perform an AC Analysis on a parallel LC tank.
  • The simulation results visually confirmed the core principle from our last lesson: a parallel LC tank exhibits maximum impedance at its resonant frequency.
  • You verified that the simulated resonant frequency precisely matches the value predicted by the formula .

You now have the skills to test circuit ideas virtually before committing them to a physical breadboard. In our next lesson, we will use this skill to take the next logical step: we will add a transistor and a feedback path to our LC tank circuit within LTspice to create a complete, self-sustaining Colpitts oscillator.