Table of Contents
An IV curve is a graph showing the relationship between the current and voltage flowing through a device. The y-axis is on a logrithmic scale.
In this code, I used Python to create these graphs and find theshold and hold voltages for each device.
Data is recorded into a txt file in 3 columns. The columns are time, current and voltage in that order. First, we need to access the files. For this, I used the pandas library.
I'll walk you though reading the raw data from one file:
# this is where all data files are
basePath = r'C:\Users\Ted Mburu\NbO2'
# this is the name of the desired file
# format: IVNb (0.95)Ti (0.05)O_2 (24)Sample Number (05162022)Date (05)Device Number
fileName = r'IVNb0p95Ti0p05O2_24-05162022-05.txt'
# finds a substring of text inside a larger string of text inbetween certain substrings
def find_between( s, first, last ):
try:
start = s.index( first ) + len( first )
end = s.index( last, start )
return s[start:end]
except ValueError:
return ""
# gather information from the filename
# the % of Nb
NbPercentage = str(int(find_between(fileName, "IVNb", "Ti").split('p')[1]) / 100)
# the % of Ti
TiPercentage = str(int(find_between(fileName, "Ti", "O2").split('p')[1]) / 100)
# sample number
sampleNumber = find_between(fileName, "-", ".txt").split('-')[1]
# combines the basepath adn filename to navigate to the specific file you're opening
filePath = ''
if (NbPercentage == "0.95"):
filePath = basePath + r'\Doping05\ '.rstrip() + fileName
elif (NbPercentage == "0.90"):
filePath = basePath + r'\Doping10\ '.rstrip() + fileName
else:
filePath = basePath + r'\Doping0\ '.rstrip() + fileName
# reads the contents of the file
df5 = pd.read_csv(filePath, names=['Time (s)','Current (A)','Voltage (V)'],sep='\t',skiprows=1)
data=df5.values
df5.head()
# store the t, I, and V values in their own respective lists
t= data[:,0]
I= data[:,1]
V= data[:,2]
Now the data in that one file is stored in the t, I and V variables. Now we can graph it using matplotlib.
plt.rcParams['figure.figsize'] = (11,6)
plt.figure(0)
plt.grid()
# graphs data as continuous function on a log scale on the y axis
plt.semilogy(V,I)
plt.xlabel('Voltage (V)');
plt.ylabel('Current (A)');
# creates a title for the graph about the data its showing
nb = 'Nb' if NbPercentage == "1.0" else r'Nb$_{'+ NbPercentage +'}$'
ti = '' if TiPercentage == "0.0" else r'Ti$_{'+ TiPercentage +'}$'
sample = ' sample ' + sampleNumber
title = nb + ti + r'O$_2$ 2x2 $\mu$m$^2$,' + sample
plt.title(title);
Result:
The data on the graph above is everything that is in the txt file. There is a lot of work that goes into filtering out the "bad" data before we can analyze the graph.
When the data starts being recorded, the device hasn't "burned though" the threshhold to start taking data we want to analyze. On the left side of the graph, you can see as the voltage oscilates through around -2 to 2 Volts, some of the current doesn't reach the max value. We need to get rid of that data.
To do this, we will find the index of the first value that is close to the max value in the current list (variable I) and remove all the data before that index in the time, current and voltage lists.
# find the largest current value in the data
largestCurrent = np.amax(I)
# We are looking for the first time the current gets close to that value
maxCurrentThreshhold = largestCurrent * 0.99;
indexOfFirstLargeCurrent = np.argmax(I > maxCurrentThreshhold)
# this is the index of the first data point after "buring though"
index = np.size(I) - indexOfFirstLargeCurrent
# same data as before but the "bad" data has been removed
plt.rcParams['figure.figsize'] = (11,6)
plt.figure(0)
plt.grid()
plt.semilogy(V,I)
plt.xlabel('Voltage (V)');
plt.ylabel('Current (A)');
This is one of the most important parts of the analysis.
A threshold voltage can be found when the current starts at 0 A and the starts heading towards the max value. This happens twice per oscilation of the voltage. After passing a certain threshold, the current will rapidly increase to the max.
A hold voltage can be found when the current starts at the max value and ends at 0 A. The current will hold on to a large value until it reaches a certain point then it will rapidly decrease.
Both the threshold and hold voltages in each oscillation exist when the 2nd derivative is at its highest value.
We need to break up the all the data in the filtered graph above into individual oscilations. After doing this, we should group all sections with threshold voltages together and all sections with hold voltages together. We will find the point of inflection of each oscillation in each group then average them to get a good approximation for the threshold and hold voltages for the entire device.
we need to find the index of the points of inflection in the current array then match that index to its respective voltage. This will give us
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services.
- Get a free API Key at https://example.com
- Clone the repo
git clone https://github.com/your_username_/Project-Name.git
- Install NPM packages
npm install
- Enter your API in
config.js
const API_KEY = 'ENTER YOUR API';
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
For more examples, please refer to the Documentation
- Add Changelog
- Add back to top links
- Add Additional Templates w/ Examples
- Add "components" document to easily copy & paste sections of the readme
- Multi-language Support
- Chinese
- Spanish
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Your Name - @your_twitter - email@example.com
Project Link: https://github.com/your_username/repo_name
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!