I have an application where I need to keep the TSL2591 in sleep mode and as soon as a value out of range is detected, a hardware interrupt is triggered to wake up the Arduino MKR1310 from deep sleep.
I've made a fork of this library https://github.com/fwag/Adafruit_TSL2591_Library/commit/5d6b71a7e744dea7f318094cc6b6788adffe2bf8 where I've just enabled the Sleep After Interrupt (SAI) and removed the No Persist Interrupt EN bit (NPIEN).
Just forget about the disableI2C/enableI2C functions, because I didn't see any power improvement by disabling I2C and setting I2C pins as inputs.
I've characterized the MKR1310 and it draws 200uA in deep sleep.
The problem is that I see a consumption of more than 450uA on the battery JST connector associated with the Adafruit TSL2591 sensor board. In fact, as soon as I remove the board, the current drops from 650uA to 200uA.
I cannot disable the TSL2591 sensor. Anyway, I made a test and the consumption is of 390uA, so 190uA related to AdafruitTSL2591 sensor board.
Do I need to dissolder some ICs on the sensor board to get the 4 uA declared in datasheet?
Could you add another method to read the value inside the EnableRegister? To corroborate the value written in the EnableRegister (0x00) and check the SAI bit, maybe something like:
in the .cpp:
void Adafruit_TSL2591::getEnableRegister(void) {
uint8_t value = read8(0x00);
return value;
}
I've desoldered U2 creating a short circuit between pin 1 and 5.
I've desoldered R1 (led resistor).
In addition I've desoldered Q21, Q22 and R3 array. I made a short circuit between pins 1-6 and 3-4.
Now I have with SAI enabled a consumption of 450 uA, while in power down (ENABLE register set to 0x00) the expected consumption of 200 uA.
I've checked ENABLE register and it is properly set.
I've opened a support ticket to AMS OSRAM to further investigate this SAI feature which seems not working.
I have just shorted SDA/SCL (external pins) with SDA_3V/SCL_3V.
I'm using already regulated 3.3V coming from Arduino MKR1310.
200 uA is the total consumption (4uA are negligible) on the battery JST pins.
It should be lower (104 uA) according to https://github.com/damdo/mkr1310-lora-lowpower/tree/master but I get 200 uA with Arduino in deepsleep mode without any peripheral connected.
So this has nothing to do with the TSL2591but the MKR module.
If you disconnect the TSL2591 does it drop to 104uA as they claim?
If you want to know the TSL current you need to measure the 3.3V input to that board.
As said if I disconnected the TSL module overall MKR consumption on battery JST pins drops to 200 uA.
Anyway I've also tried to measure directly on TSL2591 3.3V pin and I confirm 270 uA when it is set in SAI mode, while I measure 3 uA in power down (ENABLE register set to 0x00).
The problem is the TSL sensor in Sleep After Interrupt (SAI) mode.
The datasheet states that "Sleep after interrupt. When asserted, the device will power down at the end of an ALS cycle if an interrupt has been generated.".
So between one interrupt and another I'm expecting a different consumption with respect to the active state (270 uA). Otherwise I don't see any sense in this configuration bit.
OK I understand.
When an interrupt occurs the TLS is pulling down the MKR internal pullup resistor. That resistor could be as low as 20K. So when the TLS generates an interrupt it can be drawing 3.3V/20K = 165uA from the MKR supply even thought it might have gone to sleep.
I have the TLS in a closed box so I do not expect interrupts. Also in the final application I expect an interrupt every 10/15 seconds. This is the reason why I'm trying to lower the power consumption due to TLS sensor as much as possible.