Close

Power optimizations

A project log for RISE

Solar powered Bluetooth Low Energy window blinds

tiit-rtsepTiit Rätsep 04/14/2015 at 14:250 Comments

Long time since I last wrote here. We had some contract work and there was not much progress on RISE. This week we have been working on testing the solar panels and charging. We needed to minimize quiescent power to maximize the amount of energy stored per day. For that we needed to track down what was consuming the most power. To do that I started from an empty board and only populated the power supply part. Measured it's consumption and outputs - all ok. Then added blocks of functionality one by one and measured total consumption. I found out that the main power consumers were our GMR sensors. Each sensor uses up to 10 mA. That's way over our power budget. To fix that we needed to be able to control the power supply of these sensors. For that we spun a new version of the board and fixed the firmware a bit. Since we need the sensors only when the motor is moving we'll have the power supply turned off for most of the time and only turn it on with the motor. We also wrote in sleep modes for all the peripheral chips on the board and optimized the debug code. Still having debug printouts enabled increases our consumption by over 1 mA. The weird thing about the nrf51 chips is that after being flashed they will have an internal debugger active and the only way to go into really low power modes is to power cycle the chip.

We spent a whole day chasing a very weird bug. After we got the new boards we had the firmware turn the magnetic sensors on and off at specific times. Well after that fix our code started to fail at random times. The failure seemed to be that for some reason one or both of the magnetic sensors stopped giving out a signal. At first we were sure it was something in the electronics and we debugged that part a lot. But on a scope and logic analyzer the outputs and power supply of the sensors were behaving perfectly. It turns out the way we were reading the sensor signals in a GPIOTE interrupt on the nrf51 was being broken by the commands that turned on and off the pins internal pull-ups. For some reason that caused the interrupts to work erratically - it still worked most of the time but failed every now and then. The fix was to re-enable the interrupts after each change to pin configurations was made. That seems to have cured this nifty bug for now.

Discussions