IV Curve of a Diode

Hi everyone,

I am trying to obtain the IV curve of a diode for a university project. It is my first project with Arduino, so I think I am making really simple mistakes which are getting me stuck here.

I am using the circuit I uploaded in the image. I am creating a step function signal (0V-5V)with the Arduino which is smoothed with the RC circuit. This smoothed signal controls the transistor, which enables the current between the 5V and the shunt resistance to pass. This current goes through the shunt resistor and the diode until it goes to ground.

Measuring the voltage in V1 and V2, the intensity through the diode can be measured ((V1-V2)/Rs) and with V2 the voltage drop is measured. The circuit is quite simple.

When I put the circuit into work, the measured voltages V1 and V2 are equal. Therefore, there is no voltage drop in the shunt resistance. I do not know where is the part where I make the mistake, maybe it is too obvious, I am sorry.

If someone could help me I would be really thankful. Thanks everyone.

Circuito.PNG

I also thought of creating different voltage signals with a voltage divider. Mixing the resistances I have, I can create several different voltages. However, when Vout is conected to the resistance, the diode and ground, the value of Vout changes. I would like to know why and how can i fix it

No obvious issues in your schematic, other than that it appears overly complex for measuring the current & voltage curve of a diode (all you really need is a power supply, 1k pot, diode, current meter and voltage meter).

Thanks for your reply. The key is that I don't have any current meter nor voltage meter available. I have to figure out a way to measure both without them.

Circuito.PNG

Post your code and the values it reads for V1 and V2. Double check your circuit for continuity. Repost the
circuit with all the component values given and transistor and diode part numbers.

You could connect V1 and V2 to analog inputs of the Arduino, but that gets you only so far: the readings are referenced to Vcc, not really stable, and you need to measure Vcc (it's probably somewhere between 4.5V and 5.2V depending on your power source, and may fluctuate a bit) to be able to calculate the actual values of V1 or V2.

Much more stable is if you read using the internal 1.1V reference - of course you need appropriate voltage dividers on V1 and V2 to get in range. Then you can calculate the values using a stable reference. You still need a way to measure the actual value of the internal reference, as it has a 10% tolerance.

Finally, I still don't see the use of that transistor. I'd ditch that part, replace it by a pot, Rs a 10-20Ω precision resistor to be able to sense the current, and find a way to measure the two voltages: the actual value of the 5V source at V1, and the mid point at V2.

In any case you're going to need a mutlimeter. I really can't believe your university asks you to do an electronics project and they don't even have a tool as basic as a multimeter available. Otherwise, just run out to your nearest electronics store and get one. They're pretty cheap.

The transistor provides higher current, that's the whole point - not much of a curve if you're limited to a
few mA.

Thank you for your answers everyone. After trying several ways, I have decided to use a voltage divider. Combining different resistances, I can generate a good range of different voltages (with 10 resistances I will be able to take ~30 data points). That voltages will go through the shunt resistance and the diode and I will measure the voltage with the analog inputs. I attach a scheme of the circuit. I know it may not be the more appropiate way, it will take a lot to do the measurements.

The cause of no having basic material available is that we are no longer going to the university because of the Covid-19. For one of the lab courses, they asked us to buy an Arduino and a basic electronic kit (resistors, wires, diodes, transistors...) in order to keep on with the lab projects.

MarkT:
The transistor provides higher current,

No higher than what the power supply itself can deliver... which is why I don't see a point in that transistor (or the ability to switch on/off the circuit for that matter).

That's not going to do you any good.

The first thing to do is to
interchange the diode and the Current Sense
resistor. Then there is only one reading needed
to set the current. It will be more accurate
that way. Sure, you still have to measure two
voltages to find the drop across the diode,
but that is the unknown and will average out
when measured several times as per good
science.
Herb
PS It is not a shunt resistor.

Labeling the values of the resistors and capacitors in the above schematics would be helpful to troubleshooting the problem.

Actually the simplest solution with an Arduino is using a single resistor and diode.

Use the "secret voltmeter" trick - basically measuring the internal reference against Vcc, allowing you to calculate Vcc - this can in turn also be used to find the actual voltage of the internal reference if you have accurately measured Vcc. You can get away with not having a multimeter if you have a power source of which you know the exact voltage.

A mobile phone charger will be pretty close to 5V, but do NOT plug it in to the USB socket as then the actual Vcc is one diode drop less. Use the 5V pin. Assume that is 5V, and call it a day. Should be good enough but don't forget to mention this potential source of error in your project report.

Now you can measure the voltage across the diode on an analog input using the internal reference - no voltage divider needed as the typical voltage drop over a single diode is 0.6-0.8V.

Now you have everything you need. That one voltage combined with the value of the current limiting resistor tells you everything, as long as the current is low enough that the power source can keep its voltage stable.

If you don't trust your power supply, measure Vcc together with the voltage over the diode. Assume the internal reference to be 1.1V, calculate with that. Create your curve. The curve will be correct in shape, just a little offset due to the tolerance of the internal reference.

wvmarle:
A mobile phone charger will be pretty close to 5V, but do NOT plug it in to the USB socket as then the actual Vcc is one diode drop less.

I have a mobile charger that provides 5.5V with no load. I would think the onboard regulator does better job. Maybe the 3V3 one is the most reliable voltage reference source available on Arduino Uno because it is unloaded.