Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abnormal power consumption in sleep mode #53

Open
fwag opened this issue Feb 4, 2025 · 1 comment
Open

Abnormal power consumption in sleep mode #53

fwag opened this issue Feb 4, 2025 · 1 comment

Comments

@fwag
Copy link

fwag commented Feb 4, 2025

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'm using https://www.adafruit.com/product/1980 Adafruit TSL2591 High Dynamic Range Digital Light Sensor - STEMMA QT because I couldn't find the version without SparkFun qwiic.

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?

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_TSL2591.h"
#include <ArduinoLowPower.h>

#define PIN_D7 (7u)
#define TLS2591_INT_THRESHOLD_LOWER (0)
#define TLS2591_INT_THRESHOLD_UPPER (50)
#define TLS2591_INT_PERSIST (TSL2591_PERSIST_ANY) 

Adafruit_TSL2591 tsl = Adafruit_TSL2591(2591); 

void configureLightSensor(void) {
  tsl.setGain(TSL2591_GAIN_MED);  // 25x gain
  
  tsl.setTiming(TSL2591_INTEGRATIONTIME_100MS);  // shortest integration time (bright light)
  tsl.enable();
  
  tsl.clearInterrupt();
  tsl.registerInterrupt(TLS2591_INT_THRESHOLD_LOWER,
                        TLS2591_INT_THRESHOLD_UPPER,
                        TLS2591_INT_PERSIST);
}

void isrLightSample (void)
{
  tsl.clearInterrupt(); 
}

void setup() {
  tsl.begin();
  configureLightSensor();
  pinMode(PIN_D7, INPUT_PULLUP);
  LowPower.attachInterruptWakeup(PIN_D7, isrLightSample, FALLING);
  USBDevice.detach();
}

void loop() {
  LowPower.deepSleep();
  delay(100);
}
@fwag
Copy link
Author

fwag commented Feb 5, 2025

Brief update

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant