# Project 1: Arduino as a Laboratory Interface

## Abstract:

The purpose of this lab was for students to familiarize themselves with driving a circuit with a pwm signal where they must charge a capacitor and then use this circuit to drive a diode. They were then tasked with observing the voltage drop through the resistor to calculate the current going through the diode and used this information to conduct statistical exercises.

## Description:

For this project students had to start by creating a series circuit driven by a pwm signal in order to charge a capacitor. The ony things necssary to complete this circuit was the arduino, a resistor, and a capacitor. The first thing that they had to deal with was the RC time constand of the circuit. They found that in order for the circuit to produce an average voltage which is necessary in order to be able to drive a diode then it must have a very high RC time constant. In order to achieve this either the value of the resistor had to be increased or the value of the capacitor. The reason they chose to increase the value of the capacitor was because if the value of the resistor was too high then it would not be possible to power the diode.

After this circuit was built they then added another branch to it to make it parallel and added another resistor and the diode. The only reason that the resistor was added was in order to be able to calculate the voltage drop through the resistor and using that and the resistance to calculate the current going through the diode to conduct a statistical analysis.

How to caculate current: $ I = \frac{V}{R} $

The first exercise was just an introductory exercise for these concepts. Students were told to create a distribution of 10,000 randome numbers drawn from a normal distribution with a mean of 25 and a standard deviation of 6. They then were told to create a normal plot for the distribution and compare it to the expected normal plot for those parameters. Then they were told to find the probability that any single random number drawn from the distribution would be greater than 35.

The second exercise required students to begin with the Shockley model and deriving a new equation from it. In order to do this they took away the -1 in the parenthesis because it was negligible, they then solved for Vd as a function of I, they then used new values A and B, which can be found by observing their data, to rewrite the equation getting.

$ V_{d} = Aln(I) + B $

They then used the data from their experiment, plotted it, added a polyfit to it to find values for A and B, and estimate the value of Io and N.

## Circuit:

Resistor 1: 330 ohms Resistor 2: 130 ohms Very high capacitance in order to have a high RC time constant.

## Data:

In order for students to derive the first graph they had to plot the time on the X axis and the voltage of the diode on the Y axis. By observing this data they were able to choose the time interval of the data that would be helpful for them to find the values necessary. It is evident that the data is only useful from the time that the diode actually begins to light up, so the point where the two lines begin to seperate, and the point where the diode reaches max voltage, which is the point where the top line flattens out at two volts.

After they found this time (roughly 140 to 195) they created another graph where the X axis was the natural log of the calculated current and the Y axis was the voltage of the diode. They then created a line best fit for the data which in turn calculated the values for A and B. Using these values they used the derived equation from above and found the values for Io and N.

## Exercise 1:

## Results/Conclusion:

In the second exercise, after concluding the analysis and doing the calculations they found that at a room temperature of 70 degrees farenheit, the vaule for N was 5.01205 and the value for Io was 2.46231. The reason for variation in these numbers could be a result of error in the resistor or capacitance values or noise when it came to observing the current since they used 14 bits instead of 10 which increased the accuracy of the readins but also could have added a little extra variation. In the first exercise they found that given their random distribution the probability of a random number drawn being greater than 35 was 4.5%. This project was a lot of fun to do, the circuit was not that complex of a task and the code was not that bad either but it was challenging enough that we learned some new things about Python and observing data.