23. The MOS transistor connected as a diode

23.1. Objective

The purpose of this experiments is to investigate the forward current vs. voltage characteristics of a MOS field effect transistor (NMOS and PMOS) connected as a diode. Before doing this experiment overview of previous experiment is recommended.

23.2. Notes

In this tutorials we use the terminology taken from the user manual when referring to the connections to the Red Pitaya STEMlab board hardware.

Oscilloscope & Signal generator application is used for generating and observing signals on the circuit.

Extension connector pins used for +5V , -3.3V and +3.3V voltage supply are show in the documentation here.

Note

Red Pitaya STEMlab outputs can generate voltage signals with maximal output range of +/- 1V (2Vpp). For this experiment the higher signal amplitudes are required. Because of that we will use an OP484 in the inverting opamp configuration to enable OUT1/OUT2 signal amplification achieving voltage swing between +4.7V to -3.2V. An OP484 will be supplied from STEMlab +5V and -3.3V voltage rails. Gain of the inverting amplifier will be set to ~5, where \(R_i = 2.2k \Omega\) and \(R_f = 10k \Omega\)

Try to answer why we have used an OP484 instead for example OP27 or OP97. (hint “rail-to-rail”).

23.2.1. Materials

  • Red Pitaya STEMlab
  • 1x OP484 quad rail-rail op-amp
  • 1x 1kΩ Resistor
  • 1x small signal NMOS transistor (ZVN211)
  • 1x small signal PMOS transistor (ZVP211)
  • 1x Solder-less Breadboard

23.2.2. NMOS as a diode

Connection of the NMOS in diode configuration is shown Fig. 23.2. NMOS operate different than the NPN BJT transistor in a diode configuration.

Forward drop down voltage will not be typical 0.7V but it is dependent on transistor size, specification etc. For selected NMOS transistor the so called threshold voltage \(V_{TH}\) is around 2.4V.This mean when the Gate (G) voltage exceed \(V_{TH}\) the transistor will be turned ON and start conducting. Of course since Drain (D) pin is connected to the Gate pin of the transistor the potential of the \(D-G\) will stay at the level of the threshold voltage \(V_{TH}\).

Note

This configuration of NMOS will effectively produce a diode with forward drop voltage equal to the \(V_{TH}\)

_images/Activity_23_Fig_01.png

Fig. 23.1 ZVN211 specifications

On the breadboard build the circuit from Fig. 23.2 and proceed withe the measurements.

_images/Activity_23_Fig_02.png

Fig. 23.2 NMOS diode connection diagram

23.2.3. Procedure

  1. Build the circuit from Fig. 23.1 on the breadboard. Set R1=2.2kΩ, R2=10kΩ and R3=1kΩ. For M1 take ZVN211.

    _images/Activity_22_Fig_03.png

    Fig. 23.3 NMOS diode connection on the breadboard

    Warning

    Before connecting the circuit to the STEMlab -3.3V and +3.3V pins double check your circuit. The -3.3V and +3.3V voltage supply pins do not have short circuit handling and they can be damaged in case of short circuit.

  2. Start the Oscilloscope & Signal generator application

  3. In the OUT1 settings menu set Amplitude value to 0.45V, DC offset to -0.45 V, Frequency to 1kHz to apply the input voltage.

    From the waveform menu select TRIANGLE, deselect SHOW and select enable.

  4. On the left bottom of the screen be sure that IN1, IN2 and MATH V/div are set to 1V/div (You can set V/div by selecting the desired channel and using vertical +/- controls).

  5. Set t/div value to 200us/div (You can set t/div using horizontal +/- controls)

  6. Under MATH channel settings set \(IN1-IN2\) and select ENABLE.

  7. Under IN1 and IN2 menu settings set probe to x10 and vertical offset to 0.

  8. Under MATH menu settings set vertical offset to 0.

  9. Under TRIGER settings, set trigger level to 1V

_images/Activity_23_Fig_04.png

Fig. 23.4 NMOS diode connection measurements

23.2.4. VI curve measurements

Since NMOS can behave as an diode with forward voltage equal to the \(V_{TH}\) (configuration shown on Fig. 23.2) we can measure its VI characteristic as we did when performing diode measurements.For this task we will use Jupyter Notebook Web application. How to start Jupyter Notebook and create new project is shown on figure 5 flow chart.

Note

The Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text. They have also ensured support for the Jupyter application with Red Pitaya libraries enabling control of all features of the STEMlab boards such as: signal acquisition, signal generation, digital signal control, communication etc. The Jupyter Notebook is started on the same way as any other applications. After starting Jupyter application a web based notebook is opened. This combination of the notebook, STEMlab and Python features makes the STEMlab an excellent tool for prototyping and quick programing. Since Jupyter Notebook enables text, equation and picture editing this is a perfect tool for tutorials, examples and ect.

_images/Activity_19_Fig_07.png

Fig. 23.5 Creating new Jupyter notebook

If you have successfully created new Jupyter notebook then copy-paste code bellow and run it.

Code bellow will generate same signal as from Fig. 23.4 but it will plot them in XY graph.

For measuring \(VI\) curve an “XY” plot is required where x-axis will represent diode voltage \(IN_2\) and y-axis a diode current \((IN_1 - IN_2) / R_3\).

Copy code from below into cell 1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Import libraries
from redpitaya.overlay.mercury import mercury as overlay

from bokeh.io import push_notebook, show, output_notebook
from bokeh.models import HoverTool, Range1d, LinearAxis, LabelSet, Label
from bokeh.plotting import figure, output_file, show
from bokeh.resources import INLINE
output_notebook(resources=INLINE)

import numpy as np

# Initialize fpga modules
fpga = overlay()
gen0 = fpga.gen(0)
osc = [fpga.osc(ch, 1.0) for ch in range(fpga.MNO)]

# Configure OUT1 generator channel
gen0.amplitude = 0.45
gen0.offset = -0.45
gen0.waveform = gen0.sawtooth(0.5)
gen0.frequency = 2000
gen0.start()
gen0.enable = True
gen0.trigger()

# R1 resistor value
R3 = 1000

# Configure IN1 and IN2 oscilloscope input channels
for ch in osc:
    ch.filter_bypass = True

    # data rate decimation
    ch.decimation = 10

    # trigger timing [sample periods]
    N = ch.buffer_size
    ch.trigger_pre = 0
    ch.trigger_post = N

    # osc0 is controlling both channels
    ch.sync_src = fpga.sync_src["osc0"]
    ch.trig_src = fpga.trig_src["osc0"]

    # trigger level [V], edge ['neg', 'pos'] and holdoff time [sample periods]
    ch.level = 0.01
    ch.edge = 'pos'
    ch.holdoff = 0

# Initialize diode current and voltage
V = np.zeros(N)
I = np.zeros(N)

# Plotting
hover = HoverTool(mode='vline', tooltips=[("V", "@x"), ("I", "@y")])
tools = "wheel_zoom, box_zoom, reset,pan"
p = figure(plot_height=500,
           plot_width=900,
           title="XY plot of NMOS transistor VI characteristic",
           toolbar_location="right",
           tools=(tools, hover))
p.xaxis.axis_label = 'Voltage [V]'
p.yaxis.axis_label = 'Current [mA]'
r = p.line(V, I, line_width=1, line_alpha=0.7, color="blue")

# get and explicit handle to update the next show cell
target = show(p, notebook_handle=True)

Create new cell (Insert -> Cell Below) and copy code from below into it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Measuring I, V and re-plotting
while True:
    # reset and start
    osc[0].reset()
    osc[0].start()

    # wait for data
    while (osc[0].status_run()):
        pass

    V0 = osc[0].data(N-100)*10  # IN1 signal
    V1 = osc[1].data(N-100)*10  # IN2 signal
    I = ((V0-V1)/R3)*1E3        # 1E3 convert to mA
    r.data_source.data['x'] = V0
    r.data_source.data['y'] = I
    push_notebook(handle=target)

Run Cell 1 and Cell 2. Notice cell 2 is a main loop for the acquisition and re-plotting. If you stop the acquisition just run only cell 2 for starting measurements again.

After running the code above you should get diode VI characteristic as is shown on Fig. 23.5.

_images/Activity_23_Fig_06.png

Fig. 23.6 NMOS VI characteristic measured using Jupyter Notebook

23.2.5. PMOS as a diode

Same measurements can be also don for PMOS transistor. With PMOS transistor the voltage polarity is reversed so PMOS diode configuration must be different than NMOS one. PMOS diode configuration is shown on Fig. 23.7.

_images/Activity_23_Fig_07.png

Fig. 23.7 PMOS diode connection diagram

23.2.6. Procedure

  1. Build the circuit from Fig. 23.7 on the breadboard. Set R1=2.2kΩ, R2=10kΩ and R3=1kΩ. For M1 take ZVP211.

    Warning

    Before connecting the circuit to the STEMlab -3.3V and +3.3V pins double check your circuit. The -3.3V and +3.3V voltage supply pins do not have short circuit handling and they can be damaged in case of short circuit.

  2. Start the Oscilloscope & Signal generator application.

  3. In the OUT1 settings menu set Amplitude value to 0.45V, DC offset to -0.45 V, Frequency to 1kHz to apply the input voltage.

    From the waveform menu select TRIANGLE, deselect SHOW and select enable.

  4. On the left bottom of the screen be sure that IN1, IN2 and MATH V/div are set to 1V/div (You can set V/div by selecting the desired channel and using vertical +/- controls)

  5. Set t/div value to 200us/div (You can set t/div using horizontal +/- controls)

  6. Under MATH channel settings set \(IN1-IN2\) and select ENABLE.

  7. Under IN1 and IN2 menu settings set probe to x10 and vertical offset to 0.

  8. Under MATH menu settings set vertical offset to 0.

  9. Under TRIGER settings, set trigger level to 1V

    _images/Activity_23_Fig_08.png

    Fig. 23.8 PMOS diode connection measurements

As we can see from Fig. 23.8 the PMOS in diode configuration behaves as an diode with forward drop voltage equal to the PMOS \(V_{TH}\).

Compare Fig. 23.8 and Fig. 23.4 and try to explain the difference between NMOS and PMOS diode configurations.