I am trying to achieve an ultra low power gesture detection on the Arduino Nano 33 BLE Sense board but whatever I tried it is still above 5mA. I know that using these functions:
I can reduce it a lot, down to ~250 microAmpere but also cut of the power to IMU sensors required for making gestures. Is there any other way of achieving this low power consumption and using IMU at the same time? Something like IMU.end() when it is not needed while I am doing some other functions or defining this digitalWrite(PIN_ENABLE_SENSORS_3V3, HIGH/LOW) when it is needed? Any kind of help is welcome. Thanks!
I need to make a new gesture every 10 seconds. So basically after each gesture I would like to turn off everything related to IMU as I guess only in that case I can go around ~1mA or even lower. Otherwise, it will be more than 5mA, which is way too much for my project. So basically here I need to available every 10 seconds in order to make gesture for my tinyML model.
I did not understand you before. I thought you asked me if there is some constraint regarding IMU stabilization after power off/on. That information I do not know but based on experiments and way I tried it never happened. And this is my idea:
So basically, enable power to 3V3 sensors and initialize IMU every time before collectData task starts and cut it off both after it is completed. Based on my experiments, it never happened as it is always off. Considering this, seems that putting this constantly off and on is not the solution (or I made mistake somewhere else). I am not sure if it is possible to control it via ADC or GPIO pins with some triggers (like switch that opens the circuit when it needed)?
I solved the issue by adding this additional line:
digitalWrite(PIN_ENABLE_I2C_PULLUP, HIGH);
I defined it as LOW in the setup and did not change it, which affected IMU and did not allow it to use sensors for collecting gesture data. By adding this, the code works as expected, turning on IMU when needed and immediately after data is collected, ending the session.