I’m trying to make a datalogger for a bucket rain gauge.The rain is filling the bucket. When the bucket is full, it is turning and triggering a contact with a magnet. One have to record the contact with timestamp. I’m using BLE for initial configuration (including time) and to retrieve data. So, most of the time, BLE is off and I will start it by pushing a button.
Now, I’m trying to use the XIAO nRF52840 without Sense. Non-mbed version 1.1.1. Current is measured on a 18650 LiPo connected to Bat’s pins.
- Blink using delay in the main loop (when LED off): 21 µA
- Blink with timer/callback and suspendLoop() : 21 µA
- same as previous + attachInterrupt(raingaugePin, raingauge_callback, ISR_DEFERRED | FALLING) : 38 µA
Why such an increase? Can I minimize it?
@daCoder , I have questions on what you proposed. In your code with semaphore, you are using System Off Sleep. I think I can’t use it because I need to preserve timing function. I’m using xTaskGetTickCount(). Is my high power consumption increase related to high accuracy gpio management? Should your low accuracy version of the interrupts library improve this?