Electronic – Simulating Photodiode sensor in LTspice

ledlight-sensorltspicephotodiodesimulation

I am designing a current source that is going to control LED. With help of the DAC and microcontroller, I generate a voltage that goes to OP-amplifier, and afterward, I am opening my NMOS transistor. I have attached my schematic of the simulation below. I want to add a photodiode power sensor for the better accuracy of my circuit. Now my question is how could I simulate the photodiode relating to the luminosity power that my LED is emitting. Is it possible that I could connect these two in LTspice? I am new at LTspice and I would need it for my university project. I thought I could use an arbitrary behavior current source, using it as I would simulate temperature. My photodiode power sensor is S130C from Thorlabs. I would be thankful for any advice on how could I realize my problem.

Thanks
Current source schematic and LDO
Current source schematic and LDO

enter image description here
Response graph of my photodiode power sensor

Best Answer

Now my question is how could I simulate the photodiode relating to the luminosity power that my LED is emitting. Is it possible that I could connect these two in LTspice?

You can use nodes to carry information other than voltage or current, but LT spice still thinks that they are voltage or current. The way to do this is with b-sources which can handle different functions.

enter image description here Source (modified by me): https://datasheet.octopart.com/NSCW100-Nichia-datasheet-22171761.pdf

First model the diode (a first order polynomial fit with 35, if you want to get more accurate digitize the graph and fit it with a second order poly)

enter image description here

You can then use the luminosity with another model to model the photodiode, you would need to use

V(LUM)

in the second bsource for the photodiode. I would finish this but those equations would take a bit of solving and a lot of time. (and actually there is a bunch of luminosity to responsitvity equations that involve radiometry, so you need to know the distance between the sensors, and how much power is moving from source to detector which is the subject of chapters in books)

But that being said if you can come up with a function for the photodiode, you can use the signal from V(LUM) in the photodiode equation with a b source to come up with the photodiode voltage.