from IPython.core.display import HTML
def set_width(width):
display(HTML(f"""<style>
.container {{ width:{width}% !important;
min-width:800px !important; margin: 0 auto}}
.jp-Cell {{ width:{width}% !important;
min-width:800px !important; margin: 0 auto}} </style>"""))
# Set container width to X% of the fullscreen
set_width(50)
3C: Ground loops#
Learning goal: recognize when equipment you use is affecting your data aquisition
Structure of the experiment:
Anticipate + Stimulate (5+15+10): per person. This is homework and should be finished before you start your 4 hours practicum session
Implement + Investigate (40): with your partner (group of 2)
Compare + Conclude (10): with a group of 4 (per table)
BACKGROUND:#
⏳ Estimated time: 5 min
Next to the signal wires, the connections to ground are equally important.
Fun fact: At your home residual circuit breakers are measuring the different in current between supply and ground connection. If the difference is too high, there is a leakage, and the circuit breaker switches off in order to prevent an electric shock.
You would expect that having many ground connections is a good thing, but it could happen that without any intention, parts of your circuit get connected through ground. So keep an eye on hidden connections, especially through the ground signals in coax cables; you think you connect 1 signal, while in reality you connect 2.
In this assignment you will unknowingly, but intentionally, will be exposed to hidden connections. Better be prepared.
ANTICIPATE: the cause of ground loops#
⏳ Estimated time: 15 min
We will sketch the outcome of a measurement, and it is up to you to explain what is actually happening:
a student builds a voltage divider
the student connects the function generator with a T connector to channel 1 of the scope an Vin of the voltage divider
the student measures Vout with the scope over the top resistor

to the student’s surprise Vout=Vin (and not Vin/2)
the student double checks the output load settings of the function generator (which are correct … up to you to decide 50 Ohm or HIGH load)
What else could be occurring here?
### TO DO="with the right output load, what is causing Vout=Vin?"
SIMULATE: a circuit that experiences grounding loop#
⏳ Estimated time: 10 min
Reuse the simulation from assignment/ week 1C. Instead of measuring over the bottom resistor you will be measuring over the top resistor.
within your simulation draw one additional wire, which represents the hidden connection(to the ground).
verify that Vout1a-Vout1b with this extra wire is indeed equal to 1V.
from ipywidgets import FileUpload
from IPython.display import Image
import os
upload=FileUpload()
upload
file_name="3C_1_Circuit_sim.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, works on Vocareum if you change the kernel
Image(filename=file_name, width="50%")
Feel free to watch the precap (quick intro) on the measurements you will be conduct:
IMPLEMENT & INVESTIGATE: build the circuit and measure unexpected results yourself#
⏳ Estimated time: 40 min
Use the same voltage divider as in 3B, with the output of the function generator connected to both the circuit and the scope
Set the generator to a signal you can trust will not be attenuated
Measure the voltage across R3 using the probe as indicated in the figure below.
Does the amplitude of the signal correspond with your expectation? Explain what goes wrong.

### TO DO="explain what goes wrong with the above measurement?"
Solve the problem observed in the previous exercise by removing the BNC-BNC cable between the function generator and CH1 of the scope and measure the voltage across R3 again.
### TO DO="explain why removing the cable helped"
Increase the frequency to 100 kHz and measure the voltage across R3 again. Explain whether you are experiencing a ground loop
### TO DO="where does the 'ground loop' at 100 kHz originates from?"
ℹ️ Hints
To understand this frequency dependent behaviour, have a look at the figure on p. 324 of the manual of the function generator (which can be found on Brightspace). The generator circuit is not grounded directly to the chassis ground, but via a 1M resistor in parallel with a 45 nF capacitance. This is done to eliminate measurement errors due to ground loops as is explained in the text on p. 323-324 of the manual.

COMPARE & CONCLUDE#
⏳ Estimated time: 15 min
Wait till all (4) group members finish their observation
Compare your results with your other group members.
If your results agree, and are in line with all predictions, then talk to a TA and get checked off
Otherwise, so if your results do not agree, or your results are not in line with your predictions, then first discuss amongst your group before getting a TA.
to be checked off by a TA:
Explain what ground loops are, and how they influence your measurement
Explain how you can get a frequency dependent ground loop
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
#3C ground loop
### TO DO ="1. explain ground loops"
### TO DO="2. explain frequency dependent ground loops"
### TO DO="3a. abstract"
### TO DO="3b. troubleshooting"
### TO DO="3c. code"
### TO DO="4. what changes would you suggest?"
Classroom equipment recording: https://www.youtube.com/watch?v=PBeM-u0vjQY