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)
11C Diode Bridge#
Learning goal: Understand how a rectifier circuit works and what it does for the frequency of the signal
Structure of an experiment:
Background+Anticipate+ Simulate: per person; 45 min.
Implement + Investigate: with your partner (group of 2); 40 min.
Compare + Conclude: with a group of 4 (per table); 10 min.
Extra information or hints is given in boxes denoted by: ℹ️
Help fixing progrems is given in boxed denoted by: 🔥
Materials used:
Alpaca
2 LEDs
Background#
⏳ Estimated time: 5 min
Before building a full wave rectifier, you could read the according book section (see BrightSpace). The half-wave rectifier you saw in the previous experiment already makes a DC signal from AC input. But why only use the positive peaks of the input sine wave if you can also use the negative peaks. But then you should first be able to turn the direction of the negative part of the signal, and make an ‘absolute value’ of the sine wave. This can be done with a diode bridge, which you’ll explore in this experiment.
Anticipate: diode bridge#
⏳ Estimated time: 30 min
A diagram of the full bridge rectifier is given below.
Before you implement it, first think about how the circuit shall respond to an alternating voltage source (Exercise A,B,C). The considered voltage source is a sine wave, with 0 V DC offset. This means the voltage becomes both positive and negative
A. direction of positive signal#
A sine wave is applied at the input of the circuit above (DAC). Consider the half of the sine wave when the voltage is positive. What is the path via which the current will flow? Note in order which components of the circuit the current passes through.
For example: ‘DAC –> Node a –> D1 –> etc.’
### TO DO="# write your answere here, describing the path by which the current flows"
B. direction of negative signal#
A) Consider the half of the sine wave when the voltage is negative. What is the path via which the current will flow? Note in order which components of the circuit the current passes through.
B) Do the paths differ between the scenario in Exercise 1 and 2?
### TO DO="# write your answer here, describing the path by which the negative current flows"
C. load= 2 LEDs#
A) Use the answers above to explain what the output over the Load is when an AC sine wave is applied to the input of the circuit above. Illustrate your answer using a sketch.
B) If you were to replace the resistor at the load with two LEDs, as in the schematic below, what would their blinking pattern be if a sine wave is applied to the input of the circuit. Explain using your answer from A.
C) Discuss the purpose of this circuit.
from ipywidgets import FileUpload
from IPython.display import Image
import os
upload=FileUpload()
upload
import os
file_name="11C_1_sine_diode_bridge.jpg"
if upload.value!={}:
with open(file_name,"wb") as f:
f.write(upload.data[-1])
Image(filename=file_name, width="50%")
ℹ️ Hints For uploading images, you should switch the kernel of the Jupyter Notebook to Python. You can do so via the menu at the top:
Kernel>Change Kernel>Python 3
### TO DO="# write your answer here, describing the voltage over the LEDs and the blinking (pattern) within a period"
ℹ️ Hints When answering the last predict questions, you might want to:
Consider the sign of the signal at the load
Consider if the magnitude of the signal at the load is constant or not
Simulate: diode bridge#
Build the circuit below in LTSpice and simulate the output voltage, Vout1.
Note:
the voltage source is free-floating (you may verify why it is free-floating through simulation).
Instead of Vin you want to plot the difference between the voltages at both sides of the voltage source (it is free-floating). Add labels to the nodes for your convenience.
the wires to the left of D2 and D3 are crossing over, without making a connection (therefore the connecting dot is not there)
### TO DO="your predictions, including what are the max and min values of Vout"
upload
import os
file_name="11C_third_sim_diode_rectifier.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%")
You might want to watch the following movie, especially if your anticipate and simulations did not match:
Implement&investigate: build & use the rectifier circuit#
⏳ Estimated time: 30 min
📝 Todo:
Next, you will implement the full bridge rectifier on the ALPACA. To build the circuit you will use the four LEDs on the ALPACA Playground as diodes. If you feel confident building the circuit you can try this yourself. You are also free to use the instructions below.
ℹ️ Detailed instructions
For the DAC Assistant
Connect the OUT pin (J16) of the DAC Assistant (shown above) to the breadboard. Connect it to the vertical, postive, red-labeled lane (+) which is the second rightmost lane on the breadboard (this corresponds to node a in the circuit above).
Connect the GND pin of the DAC assistant (adjacent to the OUT pin you connected in the previous step) the vertical, negative, blue-labeled lane (-) which is the rightmost lane on the breadboard (this corresponds to node c in the figure).
For the LEDS:
Connect the cathode of LED-1 to the second rightmost lane/node a. So connect LED1-C to the positive lane.
Connect the second rightmost lane/node a to the anode of LED-2 (pin LED2-A).
Connect the output of LED-3 to the rightmost lane/node c. So connect LED3-C to the negative (-) lane.
Connect the rightmost lane/node c to the input of LED-4 (pin LED4-A).
In order to see the output of this circuit we will set up 2 LEDs as the load. So instead of having a load resistor as in the figure above, we will use 2 red LEDs
Thus we will use the two remaining vertical lanes (+ and - lanes) on the left side of the breadbord for the load: the positive (+ in red) lane as node b and negative (- in blue) lane as node d. Using these lanes (left side of the breadboard):
Connect the second leftmost lane/node d to the anode of LED-1 (pin LED1-A).
Connect the second leftmost lane/node d to the input of LED-3 (pin LED3-A).
Connect the cathode of LED-2 (pin LED2-C) to the leftmost lane/node b.
Connect the cathode of LED-4 (pin LED4-C) to the leftmost lane/node b.
Connect the leftmost lane of the breadboard to the Voltmeter
Connect the load LEDs as shown in the schematic below. For this, place one led with the long leg in the second leftmost lane/node d and the short leg in leftmost lane/node b. Place the other LED the other way around. You can use the LEDs you got together with the resistors for this.
As last step in building the circuit, connect the DAC output DAC A to the +IN pin of the DAC assistant on the right side of the ALPACA (at J16).
ℹ️ Hints The ALPACA manual states that the DAC assistant converts an input from 0 to 4.096 V, to an output voltage range of -10.24 to +10.24 V
ℹ️ Hints It is best to connect the DAC signal as final step, to make sure no signal is present when you are building the circuit.
ℹ️ Hints Correct fritzing schematic
This is how your wiring should look:
The code for this exercise has already been written and can be found in the cells below. We will apply a 0.5 Hz sine as the input using the DAC.
No measurements will be performed on the Ain channels!! Because the DAC Assistant is used, the signal from the DAC is turned into a sine with an amplitude from +10 V to -10 V.
Check whether your answer to ANTICIPATE C. was correct by excecuting the code below.
%serialconnect to --port="COM3"
#ADD COM PORT ABOVE, e.g. --port="COM3"
import time
from functiongenerator import FuncGen, Sine # type: ignore
with FuncGen(Sine(Vpp=4, offset=2, freq=0.5, unsafe=True)):
time.sleep(10)
🔥
If you are not getting any ouput, please verify that:
Both USB cables are plugged in
The +12 V and -12 V switches are turned to the on position on the ALPACA.
The ALPACA doesn’t have a floating source (voltage is grounded, unlike the circuit in SIMULATE), so the voltmeter goes into negatives while you run the code, this is normal.
How could you improve this circuit to generate DC voltage
ℹ️ Hints Think back to 11B (the previous diode assignment): What did you do there to create a stable the output voltage?
upload
file_name="11C_2_sketch_improved_circuit_output.jpg"
if upload.value!={}:
with open(file_name,"wb") as f:
f.write(upload.data[-1])
Image(filename=file_name, width="50%")
ℹ️ Hints For uploading images, you should switch the kernel of the Jupyter Notebook to Python. You can do so via the menu at the top:
Kernel>Change Kernel>Python 3
Compare & conclude#
⏳ Estimated time: 5 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:
Can this circuit now be used as a DC power source? If not, what should be done to make this possible (supply your argumentation with the relevant formula and a sketch of the resulting output)? If so, explain why?
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
#11C full bridge rectifier
### TO DO="# 1.Explain why and how you can use it as DC power source"
### TO DO="2a. abstract"
### TO DO="2b. troubleshooting"
### TO DO="2c. code"
### TO DO="3. what changes would you suggest?"
%use micropython
%rebootdevice
%use micropython
%disconnect
Recording: https://www.youtube.com/watch?v=dTXTBHwkaac