Additional sensor27-commands and known issues added

Christian 2018-10-04 14:48:31 +02:00
parent 5fb678a5b7
commit 0dd23546f9
1 changed files with 15 additions and 0 deletions

@ -53,6 +53,8 @@ The APDS-9960 chip (or breakout board) must be connected to the ESP8266 and the
| Sensor27 || Show APDS9960 gesture/RGBC mode | | Sensor27 || Show APDS9960 gesture/RGBC mode |
| Sensor27 | 0 / off | Disable APDS9960 gesture mode/Enable RGBC mode | | Sensor27 | 0 / off | Disable APDS9960 gesture mode/Enable RGBC mode |
| Sensor27 | 1 / on | Enable APDS9960 gesture mode/Disable RGBC mode | | Sensor27 | 1 / on | Enable APDS9960 gesture mode/Disable RGBC mode |
| Sensor27 | 2 / on | Enable APDS9960 gesture mode/Disable RGBC mode with half gain|
| Sensor27 | 3 ...255 | Set ATIME register for different integration times|
### Example rules ### Example rules
#### Power on light when ambient light is below 100 lux. #### Power on light when ambient light is below 100 lux.
@ -75,3 +77,16 @@ Right: decrease color temperature
![GY-9960-LLC](https://ae01.alicdn.com/kf/HTB1kp4EpL9TBuNjy1zbxh4pepXaO/3Pcs-GY-9960-LLC-APDS-9960-RGB-Gesture-Sensor-Module-Board.jpeg_640x640.jpeg) ![GY-9960-LLC](https://ae01.alicdn.com/kf/HTB1kp4EpL9TBuNjy1zbxh4pepXaO/3Pcs-GY-9960-LLC-APDS-9960-RGB-Gesture-Sensor-Module-Board.jpeg_640x640.jpeg)
![](https://ae01.alicdn.com/kf/HTB10vNSlhSYBuNjSsphq6zGvVXa9/RGB-Proximity-Sensor-Detection-Direction-Gesture-APDS9960-APDS-9960-Non-Contact-Module.jpg_640x640.jpg) ![](https://ae01.alicdn.com/kf/HTB10vNSlhSYBuNjSsphq6zGvVXa9/RGB-Proximity-Sensor-Detection-Direction-Gesture-APDS9960-APDS-9960-Non-Contact-Module.jpg_640x640.jpg)
![](https://ae01.alicdn.com/kf/HTB16R.JeUl7MKJjSZFDq6yOEpXah/APDS-9960-RGB-Ambient-Light-Short-range-Gesture-Module-Color-Module-Light-Module.jpg) ![](https://ae01.alicdn.com/kf/HTB16R.JeUl7MKJjSZFDq6yOEpXah/APDS-9960-RGB-Ambient-Light-Short-range-Gesture-Module-Color-Module-Light-Module.jpg)
## Known issues:
1. The different PCBs on the market seem to differ quite substantially regarding to their electrical characteristics. We have at least one case report, where this led to a malfunction on an ESP8266-board within TASMOTA but in another library too. The exact technical reason can only be suspected, but it is probably related to electrical noise and/or power consumption.
In the case from above the sensor measured an incorrect high proximity value, which resulted in repeated triggering of a „LONG“ gesture. The solution was to decrease the gain factor for proximity and gesture. Therefore the argument 2 (sensor27 2) was introduced to change this at runtime.
If you experience gesture sensing problems you could try this out, but if you measure proximity values <25 with nothing in front of the sensor (e.g. web interface after sensor27 0), then there is very likely another problem. It can be assumed, that the gesture sensitivity will suffer with reduced gain, so first try option 1 (=default).
Beside that an „as-good-as-possible“ wiring and maybe an additional capacitor over VCC and GROUND might be helpful.
2. The measurement of the light level is quite shortly described in the data sheet of the APDS9960 and the open-source-libraries use wether the ambient-light-value directly from the sensor or calculate a LUX-value from RGB. Both variants are usable and differentiate between low and strong light, but the absolute values are questionable and at the moment we have an uncalibrated sensor.
All (known) solution use a fixed integration time, which is more or less the same as a fixed exposure time in photography. In contrast the TSL2561-library (from JOBA) uses various integration times and maybe this is possible on the APDS9960 too.
To eventually achieve this in the future, the option to set this integration time at runtime was added. Every argument between 3 and 255 sets the ATIME-register.
The formula is: integration time = (256-ATIME)*2,78 ms, so with the default value of 219 we get (256-219)*2,78 = 102,86 ms. That means a smaller ATIME makes the integration time longer and more photons are captured, which might be usable for (very) low light conditions, because otherwise the sensor will saturate too early. The opposite is valid for a bigger ATIME value.
The change of this value only makes sense for users, who wether need to change the sensitivity, if the sensor resides behind dark glass or want to contribute to the development of a new LUX-calculation in the driver. If we get enough feedback, this could lead to an improvement on the software side. Feel free to open (or search for) an issue, if you have measured the APDS9960 against other devices with different ATIME-values at different light levels. This is not a trivial task though.