Close

SPI Low Power Success

A project log for Wireless BLE Kinesis Advantage (Custom Controller)

Replaces the stock controller with an nRF52 BLE SOC and MCP23S17 io expander. BLE Kinesis with great (few months) battery life.

mike-wMike W 10/19/2018 at 05:080 Comments

So everything went as planned, using SPI the whole loop executes in under 1ms (compared to 8ms with i2C at 400kHz). I didn't even have to set the SPI speed, the default for the nrf52 was plenty fast.

Next, I added delay(17) at the end of the loop, so the CPU get's to sleep for 17/18 = 94.4% of the time! That alone brought the idle (not typing) current down to around 2mA. This should extend battery life considerably as it was hovering around 7-8mA before.The only negative to SPI is that since it uses an extra pin, I've had to go back to using TX/RX pins for led(s). 

2 mA is already pretty good but I since I was back at this project again, I might as well try get it lower.

Turned off some functions that weren't going to be used and lowered bluetooth power since the keyboard is always going to be close to the computer.

  NRF_UARTE0->ENABLE = 0;  //disable UART
  NRF_TWIM1 ->ENABLE = 0; //disable TWI Master
  NRF_TWIS1 ->ENABLE = 0; //disable TWI Slave
  NRF_NFCT->TASKS_DISABLE = 1; //disable NFC, confirm this is the right way

// and lowered bluetooth power from -4 to -8
Bluefruit.setTxPower(-8);

aaand it went down to 1.6mA! Might not seem like much but that's a 20% reduction in power consumption.

I'm pretty happy with that, if we were only running the board without any LED(s) on a 3,000mah that would be (0.7 * 3000/1.6) / 24 = 54.7 days continuously! If we factored in that the board would at most be used 8 - 12 hours continuously (without a single break of 15 mins). That's over 100 days of battery life. cool.

I've finished routing the new V3 board and sent it to the manufacturers (PCBgogo) again since they were plenty fast and the boards worked perfectly. Only difference is now that I know it works, I decided to splurge on Matte Black with gold immersion.

Discussions