Shop OBEX P1 Docs P2 Docs Learn Events
Measure energy of light pulse? — Parallax Forums

Measure energy of light pulse?

CuriousOneCuriousOne Posts: 931
edited 2013-08-09 10:04 in BASIC Stamp
I want to measure energy of light pulse (photo-flash) using BS2.

I currently have the following set-up: OPT101 sensor from TI placed in apropriate enclosure with IR pass filter, so it only reacts to my photo flash burst. I've connected it to digital scope and I can see the shape of the pulse. Since I can vary the length of the pulse, I want to determine what lengths I'll need to produce light energy in 1/2, 1/4, 1/8 amounts.

The flash pulse is 1500 microseconds. So logically, shortening it twice should also give twice less energy, but that does not work, since the peak intensity of flash is for about 100 microseconds and then drops exponentially.

So my idea is as follows: The OPT101 output trough the diode is connected to 0.01uf capacitor, which is connected to BS2 via 220 ohm resistor. And the sample code, TestPhototransistor.bs2 will be used from the "what's a microcontroller" book.

Should this work properly?

As I noted, I don't need absolute or exact measurement of light energy, I just need relative measurements, so I can via trial and error, find the light pulse duration that will provide 1/2, 1/4, 1/8 of light energy.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-08-09 07:45
    The OPT101 produces an output voltage proportional to the irradiance of the photodiode and you want to measure that voltage. See EMESystems' "app-notes" webpage for a discussion of measuring voltages with a Stamp using RCTIME.

    You'll want a diode (and a resistor) between the OPT101 and the capacitor so the OPT101 doesn't discharge the capacitor when there's no light. The charge on the capacitor is the equivalent to the energy in the light pulse.
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2013-08-09 09:06
    I'll emphasize what Mike said about "diode (and a resistor) between the OPT101 and the capacitor ...". The resistor is important because without it what you have is a peak detector, not an integrator for the area under the curve. A peak detector might be okay too, if you just want a rough estimate; there may be a strong correlation between peak and duration.

    The measurement via RCTIME is going to be a bit indirect and tricky. It would be easier if you have an ADC that you can add to the Stamp. Then you can measure the voltage with no fuss.

    If what you want is really the area under the light intensity curve, the OPT101 might be configured as an integrator instead of a straight amplifier. The OPT101 gives you access to the feedback path, so disconnect pin 4 from pin 5 or any other resistor you have from pin 5 to pin 2, and connect a capacitor from pin 5 to pin 2 instead. Pin 5 output to the ADC input. There will have to be a reset mechanism, which could be a resistor from OPT101 pin 2 to to a Stamp pin, which is held high until just before the flash, and then turned to an input so that the flash integration can occur.
  • CuriousOneCuriousOne Posts: 931
    edited 2013-08-09 10:04
    Well, initially I went via ADC way and picbasic pro (since it provides support for built-in ADC) but even on smallest power fluctuation, ADC reading was changing considerably. As I guessed, this is because by default, reference for ADC is used from 5v power supply, not precise internal reference, and you need to write to specific registers to enable it. However, their support is almost non-existent and mostly consists of "check datasheet". So this is why I decided to try the other way.

    Regarding the resistor and capacitor, with which values to start with?
Sign In or Register to comment.