SBAA432A april   2020  – july 2023 OPT3001 , OPT3001-Q1 , OPT3004 , OPT3006 , OPT3007

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction to TI's Light Sensor Portfolio
  5. 2Material Inspection
  6. 3Sensor Board Hardware Design
  7. 4Build-up Standalone Light Sensor Test Platform
    1. 4.1 Functional Test
      1. 4.1.1 Communication Test
      2. 4.1.2 Sensor Function Test
    2. 4.2 Test Equipment
    3. 4.3 Hardware Platform
    4. 4.4 Software Code Examples
  8. 5Summary
  9. 6References
  10. 7Revision History

Sensor Function Test

The user needs a way to observe if the converted digital value changes under different light sources to test the light sensor function.

The OPT4001 device measures light and updates output registers with proportional ADC codes. The device output is represented by two parts, 4 bits of EXPONENT and 20 bits of MANTISSA. The arrangement of binary logarithmic full-scale range with linear representation within a range helps to cover a wide dynamic range of measurements. MANTISSA represents the linear ADC codes proportional to the measured light within a given full-scale range. The EXPONENT represents the current-full scale range selected. The selected range can be automatically determined by the auto-range selection logic or is manually set.

The MANTISSA can be determined using the following equation:

Equation 1. MANTISSA=RESULT_MSB8+RESULT_LSB

where RESULT_MSB, RESULT_LSB, and EXPONENT are parts of the output register as shown in Table 4-3 and Table 4-5. Descriptions of the RESULT_MSB, RESULT_LSB, and EXPONENT values can be found in Table 4-4 and Table 4-6. The RESULT_MSB register carries the most significant 12 bits of the MANTISSA and the RESULT_LSB register carries the least significant 8 bits of the MANTISSA. The MANTISSA is then computed using the preceding equation to get the 20-bit number. EXPONENT is directly read from the register, which is 4 bits.

Once the EXPONENT and MANTISSA portions are calculated, the linearized ADC_CODES value is calculated using the following equation:

Equation 2. ADC_CODES =MANTISSA E

With the maximum value for register E equal to 8, ADC_CODES is effectively a 28-bit number. The semi-logarithmic numbers have been converted to a linear ADC_CODES representation, which is simple to convert to lux using the following formulas. To calculate lux for the PicoStar package from TI, use the following equation:

Equation 3. luxPicoStar=ADC_CODES ×312.5×10-6

Use the following equations to calculate lux for the SOT-8 package.

Equation 4. luxSOT-8=ADC_CODES ×437.5×10-6
Table 4-3 OPT4001 Result Register 00h (Read Only)
Register 0h (offset = 0h) [reset = 0h]
15141321111098
EXPONENTRESULT_MSB
Read-0hRead-0h
76543210
RESULT_MSB
Read-0h
Table 4-4 OPT4001 Result Register 00h Field Descriptions
Bit Field Type Reset Description
15-12 EXPONENT Read 0h EXPONENT output. Determines the full-scale range of the light measurement. Used as a scaling factor for lux calculation.
11-0 RESULT_MSB Read 0h Result register MSB (Most Significant Bits). Used to calculate the MANTISSA. Representing light level within a given EXPONENT or full-scale range.
Table 4-5 OPT4001 Result Register 01h (Read Only)
Register 1h (offset = 1h) [reset = 0h]
15 14 13 21 11 10 9 8
RESULT_LSB
Read-0h
7 6 5 4 3 2 1 0
Counter CRC
Read-0h Read-0h
Table 4-6 OPT4001 Result Register 01h Field Descriptions
Bit Field Type Reset Description
15-8 RESULT_LSB Read 0h Result register LSB (Least Significant Bits). Used to calculate MANTISSA representing light level within a given EXPONENT or full-scale range.
7-4 Counter Read 0h Sample counter. Rolling counter which increments for every conversion.
3-0 CRC Read 0h CRC bits. R[19:0]=MANTISSA=((RESULT_MSB<<8)+ RESULT_LSB X[0]=XOR(E[3:0],R[19:0],C[3:0]) XOR of all bits X[1]=XOR(C[1],C[3],R[1],R[3],R[5],R[7],R[9],R[11],R[13],R[1 5],R[17],R[19],E[1],E[3]) X[2]=XOR(C[3],R[3],R[7],R[11],R[15],R[19],E[3]) X[3]=XOR(R[3],R[11],R[19])

Users can set up a standard test platform to compare the lux value, the light sensors detect, and the lux meter value. The values are not exactly the same but there is likely a positive correlation under different light sources.