Please read this whole write-up before starting; knowing what comes later may help earlier.
You can easily destroy a MOSFET by zapping its pins with even small static shocks.
Be sure discharge yourself before picking up a MOSFET; avoid touching the metal pins.
Before powering the circuit, double check the 2N7000 specifications to be sure the pins are correctly connected.
Arduino analog pins are electronically fragile and can fail in ways that are not immediately obvious.
Be careful to keep unused leads away from the Arduino If an unused lead with an exposed pin accidentally grazes the Arduino board, it could short out and possibly damage the Arduino.
You will be asked for photos of some of your circuits.
Today you’ll be using a MCP6004 Quad Op Amp. This chip contains 4 low-power, low-voltage op amps that are powered by 1.8 to 6VDC. This is good choice for battery or Arduino powered applications.
MCP6004 Quad Op Amp pin assignments from its datasheet
The optical power emitted by a light-emitting diode (LED) is proportional to the current through it. Most power supplies deliver known voltages, and the current through a circuit depends on its (often hard to calculate and frequency dependent) impedance. The current through a diode is a very non-linear function of applied voltage, so it would be nice to directly control the current. One way to do this is with a Voltage-Controlled Current Source (VCCS) that uses an op-amp and a MOSFET. Such current sources are useful whenever current is the primary parameter of interest, e.g. LEDs or generating magnetic fields.
A voltage-controlled current source (VCCS) using an op-amp and an nMOSFET transistor to drive a current through an LED load. The optional series resistor, \(R_{stability}\), improves feedback stability.
This exercise will only be looking at positive voltages, so you should set up positive power rails supplied by the Arduino 5V pin and ground rails connected to a Arduino ground (GND) pin.
Because the LED current is controlled, any voltage significantly above the LED’s threshold should be fine, so we can choose the LED supply voltage \(+V_{LED}\) to be \(V_{DD}\)=+5VDC, but we also need a variable DC voltage for the op amp input that sets the Gate voltage \(V_{set}\). We could use the Arduino \(5V\) pin to supply \(+V_{LED}\) and \(V_{DD}\), and your EDU36311A DC power supply for \(V_{set}\), but we want to get used to building circuits which only have a single DC supply, which is typical.
We will power the circuit from the Arduino \(5V\) pin, and use a simple trimpot voltage divider to control \(V_{set}\). Since the op amp inputs have very high impedance, we can choose a high resistance voltage divider that draws little current.
Simulation of voltage-controlled current source with a trimpot voltage divider supplying \(V_{set}\).
Construct the above circuit shown using op amp A on your MCP6004 chip.
As usual, the op amp power connections and decoupling capacitors are not shown, but must exist.
Caution: You can easily destroy a MOSFET by zapping it with even small static shocks.
The resistance between the drain (\(D\)) and source (\(S\)) pin of a 2N7000 N channel MOSFET transistor depends on the voltage \(V_{GS}\) between the gate (\(G\)) and the source.
A MOSFET’s gate draws essentially no DC current, so the same current flows through the load LED and the sense resistor.
Use a clear white LED (20mA, 3.0-3.2V, 12000-14000 mcd) and choose a value for \(R_{sense}\) such that the LED’s rated current flows when \(V_{set}=2\,V\).
Confirm that the LED’s brightness changes qualitatively as expected when you vary \(V_{set}\).
R-1) An op-amp with feedback tries to equalize the voltage at its two inputs. Explain why this implies \(I_{LED}=\frac{V_{set}}{R_{sense}}\) in Figure 1.
R-2) Is the current through the LED in your circuit linearly proportional to the set voltage over the full range of \(V_{set}\) values,? i.e. Is \(V_{sense} ( =I_{LED} R_{sense} ) \propto V_{set}\) for \(V_{set}\) from 0 to 5V? If not, can you explain why, e.g. using the Falstad simulation for the circuit?
Do not disassemble this circuit; you’ll need it later.
A photodiode produces a small current proportional to the optical power incident on it.
To measure the current from a TEFD4300 photodiode, convert it into a voltage using the transimpedance amplifier shown in the figure below.
A transimpedance amplifier using an op-amp, with a feedback resistor \(R\sim 1 - 10 \mathrm{M}\Omega\) and a feedback capacitor \(C \sim 10-100 \mathrm{pF}\). Use a TEFD4300 photodiode.
The transimpedance amplifier takes advantage of the op amp’s low output impedance to decouple the photodiode signal voltage amplitude from the value of the input impedance of any subsequent circuit.
Observe this output on your oscilloscope, and by covering and uncovering the photodiode, verify that the output voltage qualitatively depends on the light level.
R-3) Include a photo of your circuit, clearly showing the photodiode, capacitor, resistor, and op amp.
R-4) Include two screen captures of the scope showing the photodiode (Transimpedance Amplifier) output voltage (i.e. \(V_{out}\)) with, respectively, the photodiode uncovered and covered.
Place the photodiode and LED so they are point towards each other and are \(\sim 1\,\mathrm{mm}\) apart.
Apply a 100 Hz, 1Vpp, 1ms wide Pulse bias voltage to \(V_{set}\) and observe whether the photodiode is detecting the LED light.
Type: Pulse
Frequency: 100.0Hz
, High Level 1.00Vpp
, Low Level 0Vpp
, Offset: 0V
, Width: 1ms
Note: Falstad cannot simulate a photodiode, but if desired the LED flasher circuit can be simulated.
R-5) Include a photo of your circuit, clearly showing the LED and photodiode pointing directly at each other weith a small (mm) gap.
R-6) Include a screen capture / photo of the scope display showing the WaveGen input to the circuit and photodiode output.
R-7) Is the amplitude response of the combined system (WaveGen - VCCS - LED - photodiode - transimpedance amplifier) linear?
R-8) Is the bandwidth of the combined system (WaveGen - VCCS - LED - photodiode - transimpedance amplifier) consistent with the RC time constant expected from the feedback resistor and capacitor?
Instead of driving the LED with with WaveGen, use the output from Arduino digital pin 8 instead. Load DigitalOutputPrimes.ino into your arduino and run. It sends sequences of pulses corresponding to the first 5 prime numbers, pauses, then repeats. It should work without modification.
R-9) Include a photo of your complete working system: Arduino, LED, Photodiode, …
R-10) Make a screen shot or short video of your Scope showing the 5 prime number sequence being detected by the photodiode.
This week’s exercise could again be the basis for a variety of final projects.
See you in the next lab!
inspired by a previous write-up by Amar Vutha (2016-2018)↩︎