14A: Differential and common mode#
Learning goal: Understand the use of differential mode, bridge sensors, a comparator (with positive feedback), and sensing a magnetic field.
Experiments of this week:
experiment 14A: simulate a circuit to understand how differential mode is amplified and common mode is rejected
experiment 14B: build a comparator (with hysteresis) circuit and explain its behaviour
experiment 14C: build a magnetic sensor using instrumentation amplifer and understand how it works
Structure of an experiment:
Background+Anticipate + Simulate (50 min): per person.
This is homework and should be finished before you start your 4 hours practicum sessionImplement + Investigate (45 min): with your partner(group of 2)
Compare + Conclude (10 min): with a group of 4(per table)
Goals#
Understanding Differential Signals#
Context of Previous Circuits: Previously, we’ve seen circuits with signals referenced to ground, where one side of the signal source is grounded and the other is connected to the circuit input. The output is similarly measured with respect to ground.
Differential Signals: Often, we encounter signals not referenced to ground but to another potential in the circuit or system, known as differential signals. These are the differences in potential between two points (A and B).
Handling Differential Signals: Despite not being ground-referenced, differential signals can be filtered, amplified, etc. Their average value (potential) isn’t zero but is considered as a common offset, known as the common mode voltage.
This whole notebook uses only LTSpice. If you want, you can do it all at home before the practical session. #
BACKGROUND#
⏳ Estimated Time: 20 min
Topics Covered:#
Differential and common mode signals
Common Mode Rejection Ratio (CMMR)
Wheatstone bridge
Measuring Small Differential Signals#
Suppose you need to measure a small differential (time-varying) signal that is overshadowed by a much larger common-mode signal. Previously, we’ve seen that an AC mode can be used for this purpose. But what if your goal is to amplify the small differential mode?
Using a single-ended amplifier (a standard amplifier type) would amplify both differential and common-mode signals equally. This approach makes it challenging to distinguish the small differential signal, as the amplifier is likely to saturate due to the high common-mode signal.

OPAMP Simulation: Differential Amplifier#
In the OPAMP simulation session, focus will be on the differential amplifier, which involves an opamp and four resistors (two pairs with carefully chosen values).
This setup is designed to measure differential signals = signals with the same amplitude but opposite phase (polarity).
The key advantage of a differential amplifier is its ability to amplify only the differential part of the signal while suppressing any common-mode signal present. This common-mode signal could be a large voltage offset or external noise, which are typically not of interest.
Schematic of a Differential Amplifier & Voltage Reference Diagram:

Wheatstone Bridge: Differential and Common-Mode Signals#
The Wheatstone bridge exemplifies a signal source with both differential and common-mode signals. Similar to the diode bridge, it consists of four resistive elements. Some of these resistors change their resistance in response to external factors like magnetic fields or temperature. The voltage between the terminals UR and UL represents a differential signal, while the half-bridge voltage is a common-mode signal (shared by both UR and UL).
Equations#
Differential Equation: $\( U_{diff} = U_{R} - U_{L} = \frac{dR}{R} \cdot U_{b} \)$
Common-mode Signal: $\( U_{com} = \frac{U_{R} + U_{L}}{2} = \frac{U_{b}}{2} \)\( \)\( U_{L} = U_{com} - \frac{U_{d}}{2} \)\( \)\( U_{R} = U_{com} + \frac{U_{d}}{2} \)$
ANTICIPATE: Gain of the Differential Amplifier#
⏳ Estimated Time: 15 min
Task: Calculate Differential Gain (\(G_{d}\))#
Calculate the differential gain (\(G_{d}\)) of the differential amplifier shown in the circuit below. Consider the following assumptions:
Both voltage sources are ideal (output resistance = 0 Ω).
They have the same common signal, with a small difference between the two signals (like 5V ± a pulse of 10mV).
The OPAMP is assumed to be ideal.

Understanding CMRR#
Explanation Required: Describe what the Common Mode Rejection Ratio (CMRR) is.
Impact of Resistor Mismatch: Discuss the effects on the CMRR if R1 is not exactly equal to R3, or if R2 is not precisely the same as R4. Explain the reasons behind these effects.
### TO DO ="your prediction for ideal and when the resistor values almost (but not completely) match"
SIMULATE: Making a Differential Signal#
⏳ Estimated Time: 15 min
Task 1: Generate a Differential Signal#
The objective is to generate a differential signal (Vd+ and Vd-) superimposed on a common-mode signal Vcom. The setup involves:
Differential Signal: A small pulse.
Common Mode Signal: A large sinewave.

Voltage Sources Configuration#
Enter the voltage sources description as indicated below. Note that the values for V3 are identical to V2.
Voltage Source V1 |
Voltage Sources V2 and V3 |
|---|---|
|
|
Note:
Inverted Signal: Since V3 is connected with its + terminal to Vcom, its - terminal (Vd-) will exhibit an inverted signal shape compared to Vd+.
Questions#
Total Amplitude of Differential Signal: What is the total amplitude of the differential signal? Include a screenshot to support your finding.
Visibility of Signal: Can you clearly discern the differential signal just by observing Vd+ and Vd-?
from ipywidgets import FileUpload
from IPython.display import Image
import os
upload=FileUpload()
upload
### TO DO=" What do you observe from Vd+ and Vd-"
file_name="14A_1_diffsignal.jpg"
if upload.value!={}:
with open(file_name,"wb") as f:
try: f.write(upload.data[-1]) # python 3.7 Kernel code, not working on Vocareum
except: f.write(upload.value[-1]["content"]) # python 3.8 Kernel code, not working on Vocareum
Image(filename=file_name, width="50%")
ℹ️ Hints
Consider the non-zero difference between Vd+ and Vd-.
Remember to account for the sign of each voltage.
Troubleshooting tip:
If you’re having difficulty discerning the difference between Vd+ and Vd-, try temporarily setting the sine wave to 0V and rerun the simulation for clarity.
Task 2: Plotting the Differential Signal#
Plot Differential Signal: Now, plot the differential signal Vd+ - Vd-. You should be familiar with how to plot an equation as a trace (right-click a trace in the plot of the simulation).
Observations: What do you notice about the differential signal and common mode?
Evidence: Upload a screenshot to support your observations and conclusions.
SAVE YOUR LTSPICE DRAFT. YOU WILL NEED IT DURING I&I. Otherwise, you will have to redo it
### TO DO=" Do you see the common signal, differential or both signals. "
upload
file_name="14A_2_diffsignal_only.jpg"
if upload.value!={}:
with open(file_name,"wb") as f:
try: f.write(upload.data[-1]) # python 3.7 Kernel code, not working on Vocareum
except: f.write(upload.value[-1]["content"]) # python 3.8 Kernel code, not working on Vocareum
Image(filename=file_name, width="50%")
#precap
from IPython.lib.display import YouTubeVideo
YouTubeVideo('UWEMglDP5Nk', width = 600, height = 450)
IMPLEMENT & INVESTIGATE:
Simulate a Differential Amplifier Circuit#
⏳ Estimated Time: 45 min
Implement#
The goal is to simulate a differential amplifier, an essential electronic circuit for measuring the difference between Vd+ and Vd-. This task expands upon the circuit used in the previous simulation.

Circuit Setup Instructions#
Power Supply: Note the dual power supply on the left, labeled as Vp and Vn, for powering the OPAMP.
Signal Connections: Connect the signals Vd+ and Vd- to the inputs of the amplifier using labels.
Important: Remember that the non-inverting input is below the inverting input.
Caution: Ensure that the Vcom sinewave has a 1 volt amplitude before simulating the circuit.
Investigate#
1. Output Signal Description: After simulating the circuit, describe the output signal. Focus on two aspects:
Differential Signal Gain
Common-Mode Signal
ℹ️ Hints
You can reduce the font size of the expressions appearing in the schematic, it occupies quite some space. When you extend the schematic and need the space, rightclick the text to change font size.
### TO DO=" how does the output depend on common mode and differential signal"
2. Identifying Common-Mode Sine-Wave: Examine the output signal closely to identify the common-mode sine-wave. Here are the steps to follow:
Zooming In: Focus on the y-axis scale of the output signal. Right-click on the y-scale and adjust it to zoom in, making the sine-wave visible.
Amplitude Measurement: Determine the amplitude of the common-mode sine-wave once it becomes visible.
ℹ️ Hints
The common-mode signal is significantly suppressed (rejected), resulting in a very small amplitude. You may need to zoom into the microvolt (uV) scale to clearly observe the common mode signal.
### TO DO=" What is the amplitude of the sine wave (zoom in!)"
3. Determine the gain (\(G_{c}\)) of the common-mode signal, as ratio and in dB.
4. Determine the Common Mode Rejection Ratio (CMMR), the CMRR is defined as: \(CMRR = \frac{G_{d}}{G_{c}} \)
### TO DO=" Derivation for CMRR"
Realistic Common-Mode Rejection Analysis#
The common-mode rejection observed in this simulation is unrealistically high due to perfect conditions that are hard to replicate in real life. This is because:
The resistors in the simulation are 100% matching.
Both inputs of the OPAMP are identical, which in practice is impossible to achieve.
Adjusting for Realism#
5. To simulate a more realistic scenario, make the following adjustment:
Change Resistor Value: Modify the value of resistor R3 to be 1% larger than its current value.
Re-evaluate Parameters: After changing R3, re-determine the common-mode gain (\(G_{c}\)) and the Common Mode Rejection Ratio (CMMR).
### TO DO=" write your answer here for the CMRR with R3+1%"
6. What is the drop in CMRR?
### TO DO="derive the change in CMRR due to mismatch in resistance values"
This is a more realistic value of CMRR, but in practice it is difficult to achieve such good preformance with this kind of circuit.
COMPARE & CONCLUDE#
⏳ Estimated time: 10 min
Group Collaboration and Comparison#
Wait for All Members: Ensure that all four group members have completed their observations.
Compare Results: Discuss and compare your findings with the rest of your group members.
Consensus and Verification:
If your results are consistent and align with predictions, call a TA for verification and check-off.
If there are discrepancies in your results, or they don’t match your predictions, discuss these among your group before seeking assistance from a TA.
TA Check-off Requirements#
What was the ideal CMRR and the more realistic CMRR?
How do you calculate (\(G_{d}\)) ?
exit card:
Write a brief abstract on what you learned (conclusion, useful graph),
Which troubleshooting skills do you want to remember for next sessions,
Which code do you copy for use in next sessions,
How do you think this notebook could be improved
#14A differential and common mode
### TO DO="1. ideal CMRR"
### TO DO=" 2. how do you calculate Gd?"
### TO DO="3a. abstract"
### TO DO="3b. troubleshooting"
### TO DO="3c. code"
### TO DO="4. what changes would you suggest?"
Recording: https://www.youtube.com/watch?v=mrvtgzx2Cik

