This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OPT4048DTSEVM: OPT4048DTS

Part Number: OPT4048DTSEVM

Tool/software:

Dear Daniel,

I decided to use the component in an application where I send a flash of light on a colored sheet and I would like to measure the color and the lux level. It will have to be fast. 
I think to use the INT pin and configure it as a trigger for the conversion. What are the steps in order to speed up the conversion? I will use a conversion time of 600us per channel
. Could you give me your opinion and how to do it so as not to waste time in the conversion. I fear that writing to the register will slow me down. Can you give me the sequence to
do in order? Example? First define the INT pin as input, then write to the 0x0B register to switch to one shot, ... etc. Thank you in advance for your help and advice.

Toufik.
  • Hi Toufik,

    Just to clarify here, the MCU will trigger an interrupt on the sensor each time you flash the light on the colored sheet? Before you start flashing light onto the paper, you would first need to initialize the device configuration (INT pin input, conv time, etc.). Once this is complete, you can start flashing the light and in sync send interrupt signals to the device, which will trigger a measurement. Keep in mind that since the INT pin is used as an input, there is no hardware interrupt to keep track of the measurement, so the controller will have to keep time between the trigger mechanism and the read output. To summarize into steps:

    1. Set the device configuration

    2. Flash light onto the paper. This will trigger a hardware interrupt to the device which will trigger a measurement

    3. The MCU will keep time between the trigger mechanism and completion of a full measurement. In 600us per channel, you will have to wait 2.4ms with an additional buffer to start a new conversion

    4. Repeat steps 2-3 for additional measurements

    Let me know if you have any additional questions.

    Thanks,

    Daniel

  • Many thanks Daniel for your reply and advice.

    In the end, I had to increase the conversion time to 6.5ms and flash duration to 50ms to get something repetitive. The goal is for the result to be repetitive, but sometimes one  measurement out of three gives a very different lux value. How can we improve to get something regular? What type of noise is the component sensitive to and how can it be improved ? I hope you could give some suggestions thanks to your experience with this component.

    Best regards.

    Toufik.

  • Hi Toufik,

    Lower conversion times can pick up flicker from the light source and are more susceptible to noise. Like you mentioned, you were able to get more repeatable measurements by increasing the conversion time to 6.5ms. This is because the device averages the output over a larger interval reducing the noise. The repeatability can be improved even further by increasing the conversion time further, with 800ms offering the best performance; however, it seems like quick conversion is crucial for your application. Ultimately, you will have to experiment with your system configuration to balance timing and performance.

    Additionally, are you always taking 3 samples of data each flash event? From your setup details, 6.5ms per channel is a total of 26ms for all channels. A flash duration of 50ms would only be sufficient for a maximum of 2 samples. Could you clarify here?

    Thanks,

    Daniel

  • Dear Daniel,

    Here is how I proceed, I turn on the led and I wait 5ms to be sure that it is at its maximum level, I trigger the INT during 1ms (high to low) to make a measurement with the blue led with a conversion time of 6.5ms. I wait 50ms to be sure that the conversion is complete then I read the registers and display them.

    I wait 1s and then I start again with the green led.

    After few seconds I restart the operation under the same conditions without touching the setup. I don't always get the same result.  Very curious.

    Many thanks

  • Hello Toufik,

    How are you driving your LEDs and do you have a clean power source for this?

    Admittedly the level of variation you are seeing leads me to believe there is something more than this that is causing your output differences, but it is something to keep in mind for best results.

    Thank you, 

    Joseph Scherphorn

  • the led is turned off after reading the measurements.

  • What I mean is;   do you have a way to know that a certain LED is receiving the same current each time you iterate through your tests? 

  • Dear Joseph, yes the led current is the same. see attached image.

  • Dear Jeoseph, I improved the results by adding a big capacitor 2200uF on the power supply of the led driver.

    Many thanks for your help.

  • Hi Toufik,

    Just wanted to check in on this to make sure that you are no longer seeing this issue with this capacitance change. Could you please confirm?

    Thanks,

    Daniel