Trace voltage-current curves on your PC

Clayton Grantham, National Semiconductor, Tucson, AZ -- 10/11/2001

Some years ago, one of the fundamental electronic instruments was the laboratory curve tracer. A CRT display would sweep out terminal behavior (current versus voltage) from which you could derive mathematical models. Classic presentations of diodes, transistors, and other devices enlightened designers about linear and nonlinear operation. From the displays, you could determine the bias points for optimum design performance. Today, however, you rarely find the classic curve tracers in the lab. Instead, you find design-simulation software, such as Spice, that's removed from hands-on, empirical analysis. Spice models now exist for almost all electronic components. Characterization analyzers still make the voltage-current measurements but not at the design-engineer level. Rather, departments are dedicated to characterizing processes and components and incorporating these characteristics into the simulated models. The low-cost circuit in Figure 1 allows you to return to the hands-on approach by using your PC as a limited curve tracer.

The curve tracer sweeps out seven logarithmic-scaled currents from 1 μA to 1 mA while measuring the voltage, 0 to 5V (3.3V on some PCs), at each step. The circuit uses a programmable current source to force increasing discrete current values and samples the voltage at the IOUT terminal at each step. A classic curve tracer continuously sweeps a voltage while measuring the sourced current. The program control resides in Excel (running in Office 2000) macros that perform I/O operations through the LPT1 port of the PC. Click here to download a zip file that contains the Excel program and associated software. The program uses the free file "Input32.dll" to bit-wise control the parallel port's digital I/O. The author of the .dll file is Jonathan Titus, editorial director of Test and Measurement World. You load CurveTracer.xls with its macros, connect the circuit of Figure 1 to the parallel port, and then run a macro called ControlPanel.

A user form pops up in the spreadsheet and connects the curve-tracer force and measurement actions with the electronics (Figure 2). The possible operations are a single voltage measurement, a single forced-current output, or a sweep of current steps lasting 2.8 msec each and a voltage measurement at each step. The voltage measurements go into cells B4 to B10 in the spreadsheet. The resulting graph shows an x-y scatter plot of the data in cells A4 to B10. With this use of macros within Excel, all the graphing, analysis, and data storage common to Excel are still available to use. You can test the terminal behavior of many electronic components with this simple curve tracer. Resistors yield a linear plot whose slope is the resistor value (R=V/I). Diodes exhibit a nonlinear plot . You can also plot a diode's terminal behavior on a logarithmic current scale with a simple click within Excel's charting capabilities. Some other application examples are forward-biased transistor junctions, LEDs, and relay coils.

ADVERTISEMENT
The components in Figure 1 provide operation as low as 3V and low power consumption (low quiescent current). In the PWR block, resistor network RN1 isolates and combines eight LPT1 outputs at D0 to D7 to power the circuit. The supervisory circuit, IC1, monitors the voltage from the LPT1 port. Use the LM3724 4.63V option for 5V PCs and the 3.08V option for 3.3V PCs. The reset output of IC1 goes back to the parallel port at terminal S5 for software-error checking and clears IC4 at start-up. IC1 also has a manual reset that provides direct user control. If you press momentary switch SW1, the output current resets to 1 µA. IC2 through IC5, Q1, Q2, and associated resistors R1 through R9 form a current-output D/A converter. Servoamplifier IC3 sets Q1 's collector current. This current is a function of IC2's reference voltage divided by the parallel combination of R3 to R9. For the lowest current, 1 µA, only R3 connects (2.048V/2.16 MΩ). For the highest current (1 mA), all the resistors connect in parallel (2.048V/2.16 kΩ).

You select resistor values for a cumulative half-decade change in IOUT . IOUT steps by the square root of 10 in value. With only these seven resistors, the circuit covers three decades of current range. The pnp pair, Q2A and Q2B, mirrors Q1's collector current to the terminal IOUT. Emitter-degeneration resistors R1 and R2 improve the mirror's output resistance. Shift register IC4 and open-drain inverter IC5 select which of the resistors to connect via program control. IC4's input and clock connect the parallel port at C0 and C2 for serial shift-in operation. IC5's on-resistance is lower than 40Ω. IC6 and IC7 perform voltage measurements (the ADC block). IC7, a rail-to-rail op amp buffers the lowpass filter comprising R10 and C5. The serial output of IC6, D0, connects to the parallel port at S6. IC6's clock input provides timing control. When IC6's chip-select input goes low, a conversion starts. Pulling IOUT above the PC's 5V level or below ground could result in circuit and PC damage. To be safe, operate this curve tracer with unpowered components.

The macros in the downloadable listing contain the basic interface features for changing the current-output values and measuring the voltage input. Within module 1, the declaration of Input32.dll must include its directory path. To minimize the effects of differing PC-clock and LPT1-bus speeds in different PCs, the user form performs a 10-sec timing calibration at initialization. This calibration attempts to set the IOUT steps during a sweep to 2.8 msec. The software uses this time-delay coefficient throughout the program. Also, software-calibration coefficients within the code minimize voltage-measurement gain and offset errors. The spreadsheet maintains these coefficients for ease of changing. Use a voltmeter and a resistor of known value to calibrate. The initial gain coefficient in the spreadsheet for a 5V PC is 5V divided by 28–1 (5/255=0.0196). The initial offset coefficient is zero. You can also calibrate the IOUT current values in the spreadsheet. The user-form references these spreadsheet values. With external calibration, you can attain better than 1% error.

Is this the best Design Idea in this issue? Vote at www.ednmag.com.


© 2009, Reed Business Information, a division of Reed Elsevier Inc. All Rights Reserved.