A semiconductor diode is a two terminal nonlinear electronic device which conducts current predominantly in one direction. Due to it's nonlinearity a diode is one of the simplest examples of a device which does not follow Ohm's law.
# Example Python code to demostrate ohm low. from I2Brick import * import matplotlib.pyplot as plt %matplotlib inline port = I2Brick('COM4') #Windows: Initialize serial communication with I2Bricks #port = I2Brick('/dev/ttyUSB0') #Linux: Initialize serial communication with I2Bricks print(ard(port)) #test communication between ARD and PC R_sense=100 voltage= current= for v in range (0, 4000,25): dac(port,0, v) #set dac voltage ADC0 = adc(port,0) #read adc0 voltage ADC1 = adc(port,1) if (ADC0<0 or ADC0>4096): ADC0 = 0 if (ADC1<0 or ADC1>4096): ADC1 = 0 voltage.append((ADC0 - ADC1)/1000) #calculate voltage current.append(ADC1/R_sense) #calculate current port.close() plt.plot(voltage, current) plt.plot(voltage, current,label='Diode: 1N4148') plt.axis([0,0.9,0,14]) plt.title('i-v curve') plt.legend() plt.xlabel('Voltage [V]') plt.ylabel('Current [mA]') plt.show()
I2Brick Firmware 3.0. Supported brick: ARD, OLD, DAC, ADC
Advanced Semiconductor Analyser
For comparison, the 1N4148 was tested with the Peak Electronics Atlas DCA75 Pro Advanced Semiconductor Analyser (right).
There are more results for the simple I2Bricks I-V curve tracer controlled by Python code below.