Method of controlling a light sensor
Patent Information
- Application Number
- CN202211628077.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-12-16
- Filing Date
- 2022-12-16
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-12-16
AI Technical Summary
这就导致环境光感测结果实际上会受到环境光源A闪烁的干扰,而无法产生稳定的感测结果
[0006] One of the objectives of this invention is to provide a control method for a light sensor, which, by dividing the light sensor into an even number of integration time periods and setting the time interval between the integration time periods according to the flicker frequency, can cancel out the flicker component of the ambient light source contained in the light sensing result, thereby generating a stable sensing result and achieving the technical effect of improving the accuracy of the light sensor.
Smart Images

Figure CN116265871B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a control method for an optical sensor, and more particularly to a signal processing control method for an optical sensor. Background Technology
[0002] Light sensors, which are implemented through light sensing technology, are widely used in many applications. For example, ambient light sensors (ALS) can be used in electronic products to sense the intensity of ambient light. The sensing results can be used by electronic products to achieve important functions such as adjusting screen brightness or setting photography parameters.
[0003] like Figure 1 As shown, in the prior art, the ambient light sensor has an integration time IT and a waiting time Idle in each sensing cycle T. During the integration time IT, the ambient light sensor performs analog-to-digital conversion, converting the analog signal generated by the photosensitive element (e.g., photodiode, PD) after receiving light into a digital ambient light sensing result signal through integration, decoding, and other operations. However, as... Figure 2 As shown, if an ambient light source A is an AC-powered light source such as a fluorescent lamp, there will be fluctuations in illuminance intensity, hereinafter referred to as the flicker of ambient light source A. This flicker can be roughly represented as a sine wave, and its average illuminance is denoted as Mean. For ease of explanation, it is initially assumed that the ambient light is mainly contributed by ambient light source A, and other light sources are temporarily ignored. This allows us to focus on the impact of the flicker of ambient light source A. The same applies to other parts of this specification. If, within a sensing cycle, the start time t1 and end time t2 of the integration time IT both fall within the time interval where ambient light source A is above its average illuminance Mean, then the ambient light sensing result obtained after integration will contain a higher component of ambient light source A. Conversely, if the integration time IT falls within the time interval where ambient light source A is below its average illuminance Mean, then the ambient light sensing result obtained after integration will contain a lower component of ambient light source A. This results in the ambient light sensing result being actually affected by the flicker of ambient light source A, making it impossible to produce a stable sensing result.
[0004] While in practice the effect of ambient light source A flicker can be mitigated by averaging the sensing results from multiple sensing cycles, this approach not only requires secondary processing of the ambient light sensing results, thus prolonging the ambient light sensing response time, but also cannot guarantee sufficiently accurate sensing results. For example, even if... Figure 2Averaging the sensing results obtained from the two integration times IT and IT' in the example shown is clearly ineffective in reducing the impact of ambient light source A flicker.
[0005] To address the aforementioned problems, this invention provides a control method for a light sensor, which further reduces quantization errors caused by ambient light flicker, thereby improving the poor accuracy of ambient light sensors. Summary of the Invention
[0006] One of the objectives of this invention is to provide a control method for a light sensor, which, by dividing the light sensor into an even number of integration time periods and setting the time interval between the integration time periods according to the flicker frequency, can cancel out the flicker component of the ambient light source contained in the light sensing result, thereby generating a stable sensing result and achieving the technical effect of improving the accuracy of the light sensor.
[0007] An embodiment of the present invention discloses a control method for a light sensor, comprising: receiving ambient light by a photosensitive element and recording a signal generated by the photosensitive element after receiving the ambient light by a processing unit; determining a flicker frequency in the ambient light by the processing unit; setting signal processing parameters based on the flicker frequency, the signal processing parameters including a sampling time difference, which is the start time interval between two corresponding integration time periods in an even number of integration time periods; and starting the calculation of the ambient light intensity using the photosensitive element and the processing unit. Attached Figure Description
[0008] Figure 1 : Timing diagram of existing optical sensor operation; Figure 2 A schematic diagram comparing the integration time of existing optical sensors with the flicker of ambient light sources; Figure 3 : Flowchart of a control method for an optical sensor according to an embodiment of the present invention; Figure 4 : A schematic diagram of the optical sensor architecture controlled in an embodiment of the present invention; Figure 5 : Timing diagram of the operation of the control method for the optical sensor according to an embodiment of the present invention; Figure 6 Schematic diagram showing the relationship between the flickering of ambient light sources and the sampling time difference in this embodiment of the invention; Figure 7 : A schematic diagram comparing the integration time period with the flicker of the ambient light source in the first embodiment of the present invention; Figure 8 : A schematic diagram comparing the integration time period with the flicker of the ambient light source in the second embodiment of the present invention; Figure 9 : A schematic diagram comparing the integral time period with the flicker of the ambient light source in the third embodiment of the present invention.
[0009] [Figure Number Reference Guide] 1. Electronic device 11 Control Unit 2. Optical Sensor 21 Photosensitive element 22 arithmetic units 23 memory units T sensing period IT Points Time IT's Points Time IT1 First Points Period IT2 Second In-Time Period IT3 Third Points Time Period IT4 Fourth In-Time Period Idle waiting time st sampling time difference Ambient Light Source Mean illuminance Time intervals T1, T2, T3, T4, t1, t2 Detailed Implementation
[0010] To provide a better understanding of the structural features and effects achieved by the present invention, preferred embodiments and detailed descriptions are provided below: First, please refer to Figure 3 This is a flowchart of an embodiment of the control method for the sensor of the present invention. The control method embodiment of the optical sensor of the present invention can be used to control... Figure 4 The optical sensor 2 shown is generally composed of an integrated circuit chip and can be installed in an electronic device 1.
[0011] Embodiments of the control method for the optical sensor of the present invention include: A photosensitive element 21 of the light sensor 2 receives ambient light, and a processing unit 22 records the signal generated by the photosensitive element 21 after receiving the light.
[0012] The processing unit 22 determines the flicker frequency in the ambient light. Specifically, if an ambient light source A, such as a fluorescent lamp powered by AC, exists in the ambient light, as described in the prior art, the photosensitive element 21 will experience fluctuations in intensity with a specific frequency due to the flickering of this ambient light source A. The processing unit 22 can determine the flicker frequency of the ambient light source A by processing the signal generated by the photosensitive element 21.
[0013] Regarding the calculations required to determine the flicker frequency of the ambient light source A, there are several practical approaches. For example, the flicker frequency can be calculated by directly comparing the analog signal generated by the photosensitive element 21; alternatively, the analog signal can be converted into a digital value before calculating the flicker frequency. Since these calculations are not the focus of this invention, they will not be elaborated upon. However, it is worth mentioning that in other applications in this field, the aforementioned electronic device 1 may possess information about the flicker frequency in the ambient light. For example, the electronic device 1 may also receive mains power, or the electronic device 1 may store the mains power frequency of its location. In this case, the calculation unit 22 may only need to detect whether the ambient light received by the photosensitive element 21 is affected by flicker, and then the control unit 11 of the electronic device 1 can receive the corresponding information to determine the flicker frequency in the ambient light, without actually performing calculations to determine the flicker frequency.
[0014] Next, signal processing parameters are set according to the flashing frequency. These signal processing parameters include a sampling time difference, which is explained in detail below.
[0015] After setting the signal processing parameters, the light sensor 2 can be activated to begin calculating the ambient light intensity.
[0016] Please refer to Figure 5 As shown, the following describes how the first embodiment of the present invention sets the signal operation parameters according to the flicker frequency. Compared to the prior art where each sensing cycle T contains only one integration time IT, in the first embodiment of the present invention, the existing integration time IT can be divided into an even number of integration time periods, such as the first integration time period IT1 and the second integration time period IT2 shown in the figure. The start times of the first integration time period IT1 and the second integration time period IT2 will have a sampling time difference st, which is set according to the flicker frequency in the ambient light.
[0017] Please refer to Figure 6As shown, if the flicker of an ambient light source A is roughly represented as a sine wave, the difference between two data points with a 180-degree phase difference on the sine wave (data points 1 and 2 in any set shown in the figure) and the average illuminance Mean of the ambient light source A is close. Alternatively, it can be understood that adding these two data points can cancel out the flicker of the ambient light source A. Furthermore, knowing the frequency of this sine wave allows us to calculate the time interval between the two data points with a 180-degree phase difference and set it as the sampling time difference st. For example, assuming a mains frequency of 60Hz, the mains power is generally rectified before being supplied to the ambient light source A. Therefore, the flicker frequency of the ambient light source A might be 120Hz, meaning one flicker period of the ambient light source A is 1 / 120 = 8.33ms. Thus, the time interval between the two data points with a 180-degree phase difference on this sine wave is approximately 8.33 / 2 ≈ 4.17ms. Similarly, in areas with a mains frequency of 50Hz, this time interval would be approximately (1 / 100) / 2 = 5 ms. However, the above is only a simple example, and in reality, there will be other variations depending on the type of ambient light source A and the power supply conditions.
[0018] Please refer to Figure 7 As shown, if the sampling time difference *st* is set to approximately 4.17 ms based on the flicker frequency of 120 Hz in the ambient light, then there will be a time interval of approximately 4.17 ms between the start time *T1* of the first integration time period *IT1* and the start time *T3* of the second integration time period *IT2*. Furthermore, the lengths of the first integration time period *IT1* and the second integration time period *IT2* can be the same, which will result in a time interval of approximately 4.17 ms between the end time *T2* of the first integration time period *IT1* and the end time *T4* of the second integration time period *IT2*. In other words, the difference between each data point in the first integration time period *IT1* and each data point in the corresponding second integration time period *IT2* (which differs by approximately 4.17 ms) and the average illuminance *Mean* of the ambient light source A is approximately the same.
[0019] Therefore, once the signal calculation parameters are set according to the flicker frequency, the ambient light intensity calculation can begin. For example, in the first embodiment of this invention, two integration operations were performed: a first integration time period IT1 and a second integration time period IT2. The sum of the results of the two integration operations is shown in equation (1) below:
[0020] Where code is the ambient light intensity sensing result, and Vm is the maximum illuminance of ambient light source A.
[0021] Because of the sampling time difference *st* between the first integration time period *IT1* and the second integration time period *IT2*, the sum of the results of the two integration operations in the above formula can cancel out the flicker of ambient light source A, thus obtaining a reading close to the average illuminance *Mean* of ambient light source A, and producing a stable sensing result. In contrast, if... Figure 2 The prior art method shown below, the result of the integration operation within the aforementioned integration time IT is as shown in equation (2):
[0022] because Figure 2 If the integration time IT falls within the time interval where the ambient light source A is higher than its average illuminance Mean, then the ambient light sensing result obtained after integration will necessarily contain a higher component of the ambient light source A. That is, the sensing result reading generated by equation (2) will be greater than the sensing result reading generated by equation (1). Conversely, if the integration time IT falls within the time interval where the ambient light source A is lower than its average illuminance Mean, the sensing result reading generated by equation (2) will be less than the sensing result reading generated by equation (1). This clearly shows that the control method of the present invention can significantly improve the stability of the ambient light sensing result and effectively reduce its influence by the flickering of the ambient light source A.
[0023] More importantly, implementing the sensor control method of this invention does not require additional system resources or alter the sensing conditions. Specifically, this invention generates a sensing result by summing the integration results of several integration time intervals, without needing to perform secondary calculations on the ambient light sensing result, thus not prolonging the ambient light sensing response time. Furthermore, when dividing the existing integration time IT into a first integration time interval IT1 and a second integration time interval IT2, the length of the integration time IT can be controlled to be equal to the sum of the lengths of the first integration time interval IT1 and the second integration time interval IT2, i.e., (t2-t1) / 2=T2-T1=T4-T3. In other words, if the length of the existing integration time IT is 2ms, the sensor control method of this invention can set the lengths of the first integration time interval IT1 and the second integration time interval IT2 to 1ms each. In this way, the sensor control method of the present invention does not add additional integration calculation time compared with the prior art, and the sensing results obtained by the above formula (1) and the above formula (2) can be directly compared without any conversion. This also means that the sensor control method of the present invention can coexist with the prior art method as an independent function in the optical sensor 2 architecture, allowing the user to decide whether to enable the sensor control method of the present invention according to the situation. For example, the computing unit 22 can only enable the sensor control method of the present invention when it detects that the ambient light received by the photosensitive element 21 is indeed affected by flicker.
[0024] Of course, the optical sensor 2 architecture can also use the sensor control method of the present invention, because even if the ambient light received by the photosensitive element 21 is not affected by flicker, the sensing result generated by the signal calculation using the sensor control method of the present invention should be close to the sensing result of the prior art. In fact, because it is divided into the first integration time period IT1 and the second integration time period IT2, the magnitude of the noise influence may be even smaller.
[0025] On the other hand, such as Figure 4 As shown, the computing unit 22 of the optical sensor 2 can be further coupled to a memory unit 23. The memory unit 23 may include static random access memory (SRAM) or other types of caches to store various parameters required for executing the control method of the sensor in the embodiments of the present invention, such as flashing frequency or sample time difference, etc.
[0026] In the first embodiment described above, only two even-numbered integration time periods (the first integration time period IT1 and the second integration time period IT) are used as examples. However, although the flicker of the ambient light source A is usually approximated as a sine wave, its illuminance fluctuations may not be ideal sine waves and may cause some errors. In this case, the error components arising from these non-ideal conditions can be reduced by dividing the integration time IT into more integration time periods (e.g., 4, 6, 8, 10, 12, etc.). Figure 8 For example, in the second embodiment of the present invention, the existing integration time IT can be divided into the first integration time period IT1, the second integration time period IT2, the third integration time period IT3, and the fourth integration time period IT4 shown. The starting time T1 of the first integration time period IT1 and the starting time T3 of the third integration time period IT3 will have a sampling time difference st, and the starting time T2 of the second integration time period IT2 and the starting time T4 of the fourth integration time period IT4 will also have a sampling time difference st. Therefore, the summation of the integration results of the first integration time period IT1, the second integration time period IT2, the third integration time period IT3, and the fourth integration time period IT4 can still cancel out the flickering of the ambient light source A. Furthermore, increasing the number of integration time periods allows the ambient light source A component in the sensing result to more closely approximate the average illuminance Mean. Similar to the foregoing description, if the length of the prior art integration time IT is 2ms, the sensor control method of the second embodiment of the present invention can set the lengths of the first integration time period IT1, the second integration time period IT2, the third integration time period IT3, and the fourth integration time period IT4 to 0.5ms each.
[0027] Preferably, the even number of integration time periods are evenly distributed within the flicker cycle of the ambient light source A. For example, if the first integration time period IT1, the second integration time period IT2, the third integration time period IT3, and the fourth integration time period IT4 are completed within one flicker cycle of the ambient light source A (that is, a phase of 360 degrees), then the first integration time period IT1 and the second integration time period IT2 are preferably 180 / 2 = 90 degrees apart in phase. In this way, since the first integration time period IT1 and the third integration time period IT3 are 180 degrees apart in phase, and the second integration time period IT2 and the fourth integration time period IT4 are also 180 degrees apart in phase, the second integration time period IT2 will also be 180 / 2 = 90 degrees apart in phase with the third integration time period IT3, and the third integration time period IT3 will also be 180 / 2 = 90 degrees apart in phase with the fourth integration time period IT4. This will make the first integration time period IT1, the second integration time period IT2, the third integration time period IT3 and the fourth integration time period IT4 evenly distributed within one flicker cycle, so that the sensing result more accurately reflects the actual illuminance change of the ambient light and simplifies the control of the light sensor 2 circuit. Similarly, if in other embodiments of the present invention there are 6 integration time periods to be completed within one flicker cycle of the ambient light source A, it is preferable to control any two adjacent integration time periods to be 180 / 3 = 60 degrees apart in phase. The configuration of such integration time can be simplified as shown in the following formula (3):
[0028] Where n is the number of integration time periods that need to be completed within one flicker cycle of ambient light source A.
[0029] In addition, although in the foregoing embodiments, the first integration time period IT1 and the second integration time period IT (or together with the third integration time period IT3 and the fourth integration time period IT4) are executed sequentially within one flicker cycle of the ambient light source A, the control method of the sensor of the present invention can actually be designed in other variations. For example, in the third embodiment of the present invention, when the length of one sensing cycle T actually includes several flicker cycles of the ambient light source A, please refer to... Figure 9As shown, assuming that the ambient light source A does not change significantly in a short period of time, the difference between the average illuminance Mean of the two data points 1 and 2, which are 180 + 360 = 540 degrees out of phase on the sine wave, and the difference between them is also close. Therefore, by calculating the time interval between the two data points with a phase difference of 540 degrees, it can also be set as the sampling time difference st. For example, if the flicker frequency of the ambient light source A is 120 Hz as mentioned above, it means that one flicker period of the ambient light source A is 1 / 120 = 8.33 ms. It can then be known that the time interval between the two data points with a phase difference of 540 degrees on this sine wave is approximately (8.33 / 2) * 3 ≃ 12.5 ms. Therefore, the sampling time difference st is set to approximately 12.5 ms. In summary, when a sampling time difference st is set according to the flicker frequency in different embodiments of the present invention, it can be expressed as shown in the following formula (4):
[0030] Where f is the flicker frequency of ambient light source A, and its reciprocal is the length of one flicker cycle, and N is a natural number.
[0031] In summary, the control method of the optical sensor of the present invention, by splitting the light into an even number of integration time periods and setting the time interval between the integration time periods according to the flicker frequency, can eliminate the flicker component of the ambient light source contained in the light sensing result, thereby producing a stable sensing result. Therefore, the various embodiments of the present invention can undoubtedly improve the accuracy of the optical sensor.
[0032] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. All equivalent variations and modifications made in accordance with the shape, structure, features and spirit described in the claims of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A control method for an optical sensor, characterized in that, It includes: An ambient light is received by a photosensitive element, and a processing unit records the signal generated by the photosensitive element after receiving the ambient light. The processing unit determines a flicker frequency in the ambient light; The signal operation parameters are set according to the flashing frequency. The signal operation parameters include a sampling time difference, which is the time interval between the start of two corresponding integration time periods in an even number of integration time periods divided within a single sensing cycle. The sampling time difference is set according to the flashing frequency, as shown in the following formula: ; Where st is the sampling time difference, f is the flashing frequency, and N is a natural number; The integration results of the even-numbered integration time intervals are summed to cancel out the flicker component of the ambient light; and The ambient light intensity is calculated using the photosensitive element and the computing unit, and an ambient light sensing result is output.
2. The control method for the optical sensor as described in claim 1, characterized in that, The even-numbered integration time periods include a first integration time period and a second integration time period. The time interval between the start time of the first integration time period and the start time of the second integration time period is the sampling time difference, and the time interval between the end time of the first integration time period and the end time of the second integration time period is the sampling time difference.
3. The control method for the optical sensor as described in claim 1, characterized in that, The even-numbered integration time periods include a first integration time period, a second integration time period, a third integration time period, and a fourth integration time period. The time interval between the start time of the first integration time period and the start time of the third integration time period is the sampling time difference, and the time interval between the start time of the second integration time period and the start time of the fourth integration time period is the sampling time difference.
4. The control method for the optical sensor as described in claim 1, characterized in that, in, The ambient light is affected by the flicker of an ambient light source, and the flicker frequency determined by the aforementioned computing unit corresponds to the flicker of the ambient light source.
5. The control method for the optical sensor as described in claim 4, characterized in that, If n of the even-numbered integration time periods need to be completed within one flicker cycle of the ambient light source, then the phase difference between any two adjacent integration time periods in these n integration time periods is 360° / n.
Citation Information
Patent Citations
Apparatus and method for generating moving image data in electronic device
CN110830730A
Shooting flicker elimination method and device, shooting equipment and readable storage medium
CN113542532A
Flicker compensation method using two frames
US20150103209A1