eCircuit  Center 
Source Measure Unit Series

About SPICE | SPICE Basics | Running SPICE | CIRCUIT COLLECTION
SPICE Commands | SPICE Downloads | About | Contact | Home

Ultra-Lite Digital SMU

Part 2 - Hardware Prototype using an Arduino

 

pic


Let's build an ultra-lite SMU to learn digital control. Why? A small system provides an easy on-ramp to grasp bigger ideas without getting lost in a myriad of circuit details. Later, you can develop more complex SMU's on a solid foundation.

 Part 1 - describes the essential blocks of a digital SMU (with SPICE file).
 Part 2 - builds a prototype with the Arduino and a just few components.

Back to SMU Series
  

SMU SPECIFICATIONS

 

SCHEMATIC

Here's the schematic of our SMU showing connections between the Solderless Breadboard, a DAC board and the Arduino UNO Board.

sch

CIRCUIT NOTES

 

PROTOTYPE

There is no easier way to prototype a circuit than with the Solderless Protoboards. Drop in a component and begin wiring! You can easily test, modify and experiment with your design.

A handy online drawing program (www.cirkitstudio.com/) allows you to create a parts-based wiring diagram as shown below.

sch

Please note, the diagram above is only a suggestion. Arrange parts and wire the circuit anyway you prefer!

PARTS LIST

Even with the most basic components, you can build a working SMU. Feel free to select alternate components for preference / availability / cost.

Qty
(Ref)
Description Part Number
(Digikey option)
1 Arduino Uno Rev3 Microcontroller Board A000066
1 USB Cable Type A/B generic
1 DAC Breakout Board, 12-Bit, I2C Interface MCP4725 (Sparkfun)
1 Solderless Breadboard, SparkFun Electronics PRT-12002 (1568-PRT-12002-ND)
1 pkg Jumper Wires, Various Lengths, M to M, Adafruit Industries (1528-2185-ND)
2
(R1,R2)
RES 100K OHM ≤5% any available
1
(C1,C2)
CAP CER 1nF X7R any available
5
(Rs)
RES 100,1K,10k,100k,1M OHM ≤1%
(Various values for different ranges)
any available

 

FLOW CHART

The overall code blocks for the SMU is fairly straightforward.

pic

 

ARDUINO BASICS

Here's the fast track version of running a C program (sketch) on your Arduino Board.

 

THE CODE

The program is straighforward, many examples have been published for writing the DAC and reading the ADC inputs.

DAC Code

We need to add the Wire library for the MPC4725 DAC board and set its address.

pic

The writeDAC function handles the low levels details of writing an integer value into the 12-bit DAC registers.

pic

 

Setup()

This code excecutes once in the Arduino Sketch.

pic

The code sets up the SMU test.

 

Loop()

This code runs continuously. The main SMU controll loop code simply follows the flow chart above.

pic

 

The code above implements the control loop functions.

 

Display Result and Averaging

This code displays all the SMU measuments every 250 ms on your computer screen. The variable testTime keeps track of the time (ms) since the program started.

pic

Because the measurements may be noisy, we'll apply a running average to the readings.

pic

The code implements a circular buffer that subracts the oldest value and adds the newest value. The average is simply the sum total of the buffer divided by the number of readings in the buffer.

Finally! We'll calculate the resistance measurement from the averaged values Rcalc = MVave / MIave.

 

FV TEST

What can we test even though the analog circuitry has NOT been prototyped? Good news! We can jumper the Arduino's 3.3V supply directly into the A0 analog input.

 

Back to SMU Series