PHY405 Electronics, Lab S


Adapted from Prof. David Bailey's website in 2022

Overview

Some simple simulations are part of regular PHY405 labs, but the course’s primary goal is for students to develop basic hands-on electronic skills. Some of these simulations have been extended and moved into this special exercise. You will actually build two of the simulated circuits in subsequent labs.

In-person labs are done in pairs in the lab, but this at-home exercise should be done individually.

Help will be available via Zoom during your regular lab time. Check Quercus for the Zoom link.

Please let the Instructor know if you notice any apparent errors in this write-up.

Background preparation before starting the lab

  • Read through all these Lab instructions before Thursday lecture discussion.
    • If the instructions are unclear or require doing some research, ask questions at lecture or look things up before the lab instead of after starting the lab.
  • Install LTSpice before your lab period!
    • Even though you will be doing this exercise at home, the lab period is when help is available in real time.
  • Read the notebook guidelines and report guidelines.

For clarity and simplicity, anything that must go into your report for this lab is in a highlighted text box like this and labelled “R-1, R-2, …”.

Each response box (i.e.”R” box) has the same weight. Part marks may be given. The number of questions will vary from lab to lab, but each lab is worth the same fraction of your final course grade.

Answers to the specific lab questions must be clearly and obviously labelled in the report, e.g. with “R-1”, “R-2”, ….

Simulations

Circuit simulators are essential tools in modern electronics design, but they can be very risky and misleading for naive users.

Exercises

Flashing LEDs

Use the Falstad circuit simulator to design a very simple circuit for your breadboard powered by your waveform generator that alternately flashes an red and a blue light emitting diode (LED) a couple of times a second. To avoid damaging the LEDs, include a current limiting resistor to keep the peak current through the circuit below 10 ma if a peak square wave voltage of 10V from the Wave Gen is applied.

  • An LED glows when sufficient voltage is applied across it in one direction (forward biased) but not when applied in the the opposite direction (reverse biased).
  • Sayanee Basu has a nice introductory Circuit simulation with Falstad video.
  • You circuit can easily be designed by simply replacing the diodes in the Falstad Diode Limiter with LEDs and changing the frequency to 2Hz.
  • Write your name in the Falstad simulator window using
    • Draw -> Outputs and Labels -> Add Text.
      • To make the simulator forget the last tool selected, hit “ESC”.
  • The design should have oscilloscope traces at the bottom showing the A/C source and Voltage across the diodes.
    • Since you’ve changed the frequency, you’ll also need to change the Horizontal Time base of both scopes. This can be done (separately for each one) by:
      • Right-click on scope
      • Click on Properties
      • Select Horizontal Scale
      • Move slider so several AC cylecs.
    • Note that the Analog Output (labelled “Out”) voltage is measured relative to an implicit zero voltage. It is better to be explicit, e.g by adding a ground
      • Draw \(\rightarrow\) Inputs and Sources \(\rightarrow\) Add Ground or drawing explict scope connections
      • Draw \(\rightarrow\) Outputs and Labels \(\rightarrow\) Add Voltmeter/Scope Probe

R-1) In your report include a screen capture/photo of the circuit diagram from the simulation and a link to your circuit.

  • Falstad circuits can be saved as a link. In the Falstad Menu click:
    • File \(\rightarrow\) Export As Link…
    • Copy to Clipboard
    • Paste into report as a link that the Marker can just click on to see your working simulation.

Frequency Response of a Circuit

If an AC voltage is applied to the input of a circuit and the output observed, the voltage attenuation or amplitude frequency response is

\[ A(f) = \frac{|V_{output}(f)|}{|V_{input}(f)|}\]

  • The 3 dB frequency is where the attenuation is \(1/\sqrt{2} \approx 0.7\).
    • This is the half-power point (since \(P=V^2/R\)).
  • In an RC circuit, the 3 dB radial frequency corresponds is the inverse of the RC time constant.
  • Unless otherwise specified, “frequency” means the ordinary frequency \(f\), not radial frequency \(\omega=2\pi f\).

Both the amplitude and phase can change between the input and output of a circuit, so we are more generally interested in the transfer function:

\[H(f)=\frac{V_{output}(f)}{V_{input}(f)}=|H(f)|e^{i\phi(f)}\]

RC Filters

Capacitors have high impedance at low frequencies and can be used to create either high-pass or low-pass filters.

  • A high-pass filter passes high-frequency AC signals but blocks low-frequency AC signals.
    • A capacitor can do this because it has high impedance at low frequencies and low impedance at high frequencies.
  • A Low-pass filter passes Low frequency AC signals but blocks high-frequency AC signals.
    • A capacitor connected to ground will short out high-frequency AC but not low-frequency AC.

Plotting the attenuation and phase (relative to input) of a circuit is known as a Bode Plot. Bode plots for Falstad circuits can made by copying them into the Falstad Analog Filter applet:

Band-pass Filter

A band-pass blocks AC signals with frequencies higher or lower than a specified band. A band-pass filter can be created by combining appropriate low-pass and high-pass filters.

  • Note that the order of the filters does matter.

R-2) Design a circuit with a 6 V (peak-to-peak) sinusoidal input, resistors, capacitors, and a Green LED, such that the LED only lights up when the input frequency is (roughly) between \(\sim 0.5 \mathrm{kHz}\) and \(\sim 5 \mathrm{kHz}\).

  • Write your name in the Falstad simulator window using
    • Draw -> Outputs and Labels -> Add Text.

In your report include a screen capture/photo of the circuit diagram from the simulation and a link to your circuit.

  • Paste into report as a link that the Marker can just click on to see your working simulation.:::

LTSpice

The Falstad simulator is very easy to use and works well for PHY405, but it is not a professional tool.

Many professional proprietary (and usually expensive) electronics design tools exist, but probably the oldest and best known circuit simulator is SPICE (“Simulation Program with Integrated Circuit Emphasis”) and its many commercial and free variants: LTSpice, HSpice, PSpice, NGSpice, AIM-Spice, XSpice, …. The challenge of professional tools is that they are typically proprietary, expensive, or have a steep learning curve (or all three). The purpose of this exercise is primarily to make you aware such professional tools, but no subsequent labs expect more than a Falstad simulation.

We will be using LTSpice, which has both Windows and Mac versions. If you have only a Linux, you can run LTSpice under wine, use NGSpice or another Linux compatible SPICE. Let the Instructor know if you do not have home access to a Windows or Mac computer. If you have a Chromebook, you could try the web-based PartSim, or the Chrome Spice Client.

If looking for help with LTSpice, don’t be confused by videos that refer to Linear Technologies instead of the current vendor Analog Devices. Linear Technologies - the company that originally developed LTSpice (hence the name LTspice) - was bought by Analog Technologies a few years ago.

After downloading and installing LTSpice:

  • if using Windows, watch:
  • if using a Mac, watch:
  • if using online PartSim, watch:
    • Basic Circuit and Simulation - PartSim Tutorial.
    • On my Mac I noticed a few glitches:
      • Always connect components via a wire, never directly.
      • Double clicking on component value to change it may not work; double click on component itself and enter value in menu box.
  • The LTSpice simulation command list can be found here

R-3) Reproduce the Falstad Low Pass RC Filter in LTSpice.

  • Instead of using a generic 10 µF capacitor, however, select a Würth Elektronik 885012108021 WCAP-CSGP 1206 X5R ceramic capacitor from the LTSpice Database.
    • You can select the capacitor by right or secondary clicking on it then Select Capacitor or Pick One From Database.
    • Würth Elektronik is the manufacturer
    • 885012108021 is the part number
    • 1206 is the type of SMD (Surface Mount Device) case.
      • We don’t use SMD devices in this course, but because of their very small size and ease of robotic installation, they are extremely common in manufactured electronics.
    • X5R specifies the capacitance should not change by more than ±15% between -55°C and 85°C.
    • Their current price is about 55 cents each in bulk
  • Write your name on the circuit diagram.
    • On a Mac, Right-Click \(\rightarrow\) Draft \(\rightarrow\) Comment Text
    • On Windows, Edit \(\rightarrow\) Text
  • In your report, be sure to include screen capture/photos of your circuit and the LTSpice Bode plot for the circuit.
  • Do the Falstad and LTSpice Bode plots agree over the range from 10Hz to 10MHz?
    • If not, be sure to note any differences.

End of lab

Be sure to read the Report guidelines before writing your report.

See you next week!