Build Your Own Sourcemeter

This is an explanation and set of building plans for a USB-powered sourcemeter with a personal computer interface. The sourcemeter uses an open-source Arduino microprocessor and the user interface uses the open-source Processing environment. The sourcemeter was designed as a homemade current-voltage (IV) tester to measure the IV characteristics of a solar cell by sweeping applied voltage across the device and measuring the current at a series of voltages, but it could be applied to other measurement tasks.

For questions, please contact Sarah Sofia (ssofia AT mit DOT edu).

The basic circuit for the sourcemeter is as follows:

    • The Arduino Nano microcontroller (Arduino) uses 3 digital output pins to control a dual-channel digital-to-analog converter (DAC).
    • This DAC programs two voltages:
  • The first voltage is applied across the device under test (DUT), in our case a solar cell. In order to insulate the DAC from the current through the DUT, a buffer amplifier (in our case an operational amplifier wired for unity gain) is placed between them. The voltage across the DUT is also split off and read at one of the Arduino’s analog input pins.
  • The second voltage is used as part of a summing amplifier to make our current measurement readable by the Arduino (details below).
  • The current through the DUT is converted to a voltage by dropping it across a 0.1 ohm resistor, so that it can be read at one of the Arduino’s analog input pins. This negative terminal of the DUT and the second voltage output from the DAC, each in series with a resistor, are both wired to the positive terminal of an op amp configured as a summing amplifier. The resistor values in our circuit were chosen to convert our expected current range (+/-30mA dropped across a 0.1 ohm yields +/-3mV by Ohm’s Law) to the internal reference voltage for the Arduino (0V to 1.1V). For a good explanation of using a summing amplifier for this type of conversion, see Note that it is important that these resistance values be fairly precise. Variations will result in the scaling and zero of the current measurement being off slightly. This discrepancy can be corrected in the currentReadingmA function in the Arduino code.

Circuit Diagram (download in .sch format here).

*Note: To put a solar cell in forward bias, the p-type side would be connected to the V+ terminal in this diagram. For reverse bias, the n-type side would be connected to the V+ terminal.


Parts List: These were used for our implementation. Substitutions (e.g., to change the current range or due to availability) should be fine though they may require small modifications to the software.

  • Printed Circuit Board
  • Arduino Nano Microcontroller
  • Microchip MCP4822 dual-channel Digital-to-Analog Converter
  • Texas Instruments TLV4110 Operational Amplifier (2)
  • Ohmite WNBR10FET 0.1 ohm +/- 1%, 1W resistor
  • Panasonic ERO-S2PHF3000 300 ohm +/- 1%, 0.25W resistor
  • Panasonic ERO-S2PHF3001 3k +/- 1%, 0.25W resistor
  • Panasonic ERO-S2PHF1202 12k +/- 1%, 0.25W resistor
  • Panasonic ERO-S2pHF3002 30k +/- 1%, 0.25W resistor

Firmware and GUI Software
*Note: these instructions assume that you have the Arduino IDE and Arduino driver installed. See the Arduino help pages to get started.

Download and extract the IVy zip file locally. Navigate to “source” > “IVy_arduino”. Open the file “IVy_arduino.pde” with the arduino IDE. Compile the code and upload it to the arduino board.

Once the arduino board is loaded, use the Processing application to run the board. For convenience, the Processing code is already compiled and exported to an executable format for Linux 32/64-bit, Mac OSX, and Windows 32/64-bit. These are located in the “application” folder. Within the “application” folder, navigate to the folder which matches your platform. If the 64-bit version does not work on your 64-bit system, use the 32-bit version.

Make sure the arduino board is connected to your computer, and then run the executable. A window showing the IVy user interface should open. Under the “Connection” section, there is a drop down menu displaying all available serial COM ports. Select the COM port that the arduino board is using, and then click the “Connect” button. The status bar at the bottom should display “Connected” if the connection was successful. As long as the IVy interface stays open and the arduino board remains physically connected to the computer via USB, this step does not need to be repeated.

Once the serial connection is established, you can start taking IV measurements. Hook up a device (e.g., a solar cell, resistor, etc.) to the DUT terminals of the sourcemeter circuit. Set the measurement parameters under the “Settings” section of the interface. The “Start voltage” and “Stop voltage” define the range of the voltage sweep. Both the Start Voltage and Stop Voltage should be between 0 and 4 V. Since the DUT terminals cannot switch polarity, you must manually switch the leads to your device to obtain data in reverse bias. When the device is hooked up in reverse bias, click on the “Reverse” radio button under “Settings”. This will tell the interface to record and graph the incoming data with negative voltages.

Click the “Start Sweep” button to begin sweeping voltage while measuring current. Data points should appear on the graph in real-time, and the status bar will say “Running…” Once finished, the status bar will say “Voltage Sweep Complete.”

Under the “Save data” section, type in a file name and click the “Save data” button. This will save the data as a comma-delimited file with a “voltage, current” pair on each line. By default, this file is saved in the same folder as that of the executable for the IVy interface. You can keep taking data by modifying settings, starting a sweep again, and saving the data under a different file name. The graph will overlay the current data on top of previous ones. If this is not desired, click the “Clear Graph” button at the bottom before the next sweep.

Arduino board is not responding: Close IVy and disconnect the board. Re-connect the board, and re-open IVy.

Source code description:
IVy_arduino.pde: Firmware to load onto the arduino board; communicates with Processing application.
IVy_GUI.pde & serialCommWithArduino.pde: Processing source code for the IVy graphical user interface; the two files are interdependent. Details about necessary libraries can be found in the header comments of the code. To edit this code you will have to download the Processing IDE.

The Final Product



39567 Total Views 1 Views Today