Finally we got our prototype boards and proof of concept firmware code done and we are a bit stuck on the average power consumption over time for the entire sensor that is ~650uA.
This is way of what we expected (~60-100uA, that is easily achievable on older version of the sensor working in mesh networking mode based on a module ~15 years old) so the question is if we are doing something wrong or the nrf52840 based module was not the best choice to start with.
Some background to better understand our intended application:
Standalone battery driven sensor
We use an internal “clock” (timer) connected to an external oscillator ticking passed time from the installation moment (connect with phone and setup time and sensor user friendly name).
Sensor measures elongation every 1 hour and only if the value has changed writes it into internal memory (1M is enough, shared between program ca 340kB and the rest can be used as storage for the acquired points).
Sensor also senses if there is an open circuit as an interrupt (we hold the pin low for closed circuit and it goes high if open) – it is a critical fault of the bolt so it is expected to happen only once, but should be checked for if during the installation the sensor was started before everything was properly installed….
Elongation is measured as a combination of a rotary magnetic encoder angle position (voltage value) that is read and interpreted by the ADC on the module and an interrupt counter (reed switch) for each full rotation (basically adding/subtracting offset to encoder/ADC value)
On cold start (battery ON) the sensor resets the elongation to 0 and starts measuring from that encoder angle position.
Through I2C we control an external I2C bus to GPIO (PCA9538APWJ) that was previously needed to control an RGB LED to give some feedback to the user, but we will be ditching that one since there are enough GPIOs now that together with 3 mosfets should do the trick.
User can connect to the unit at “any time” and ask to download the data to the phone. I say “any” because we were thinking for the sensors module to switch major components like BT off for 15 seconds, then back on for 15 seconds and if there aren’t any connection probes go back to “sleep” again…
Our programmer decided to go with the Zephyr RTOS approach for the underlying building blocks.
So our understanding is that we need at least one timer running on the nrf52840 to have the time measurement, but digging through the documentation (too late?) we found this:
https://devzone.nordicsemi.com/f/nordic-q-a/114626/what-are-ultra-low-power-options-with-rtc-wakeup
If this means that to run one timer the absolute minimum is 418uA and sleep states on 52840 are basically an ON/OFF state switch then this will not work for us….
Do you have a module in your production palette that would provide:
Bluetooth 5.0(or higher)
Internal clock
Internal memory 1M
ADC
2 interrupts
3 GPIO
Much more granular/better control of the run/idle/sleep/deep sleep cycles
Best regards,