Following on the heels of the success with my nRF52840DK power consumption, I moved to my XIAO nRF52840 board. This was the board I wanted to run my Zigbee F.A.R.T, sensor on.
I used the same arrangement as before, with the Nordic Power Profiler Kit (PPK) supplying 3.3v. I soldered a connector to the battery terminals underneath the XIAO board and wired the PPK to them.

As before, I decided to start with Blinky! I reset it all back to the original Zephyr sample and flashed it.

Very familiar pattern! 3.2mA when the LED is on and about 2.5mA when it’s off. Average consumption was 2.17mA.
I added in the same CONFIG changes as I had on the DK, but unfortunately, the code wouldn’t compile! The problem was the CONFIG_SERIAL setting. Setting it to n prevented the code from compiling 🤬
I left it at “y” and added my overlay changes, which turn off lots of the peripherals.

This vastly improved the situation! Same 1 second on/off blinking of the LED, but the average power consumption was now only 650µA. That’s about 140 days on battery power. This was very encouraging.
Fixing the config
The solution to the compilation problem was to add CONFIG_CONSOLE=n. With that setting in place, I was able to compile and flash the code.
This didn’t affect the power consumption at all though. It stayed at an average of 650µA.
So I chose to look at the periods when the LED was off.

Zooming in showed the “off” periods used about 300µA on average. This was higher than the DK consumption, but perfectly acceptable for my needs!
Back to Zigbee!
Happy enough Blinky and with a solution to the compilation error, I moved back to my Zigbee code.
I flashed it on and…

…the power consumption was up at 8mA!!!! Whilst the LED was supported to be flashing, it wasn’t.
My heart sank! 8mA was a measly 10 days on a battery. Not good at all.
I then realised that this pattern was the same as the DK experiments. It was the Zigbee radio listening for signals!
I immediately opened Home Assistant and started the pairing process. Sure enough, the device appeared and got added in, with the two temp probes showing!

In the same fashion as the DK, the consumption then plummeted to an average of 410µA! Phew.
410µA is about 210 days on battery power, which exceeds my battery life target of 6 months!!
Given my amateur code, I’m confident there is room to shave more off the top of this. The DK was down at 250µA, so I know it’s possible.
I just need to more experience with Zephyr, Nordic and the XIAO board! As I’ve said about one hundred times, I’m an amateur at embedded programming and there is nothing wrong with that 🙂
Every day is a school day.
What’s next?
My code needs more work. I’ve been trying to add some status LED support e.g. ready to pair, identifying, etc, but they don’t work properly yet.
I’ve love to get the consumption down to 200µA. If 400µA is the best I can do, I’m still chuffed with that!!
Support
If you find my blog posts useful and want to show your appreciation, you can always buy me a coffee. Your support is appreciated!

Leave a comment