setTxPower usage and battery life


#1

Saw setTxPower was implemented for the latest firmware. With my TurnerOnner project, I run through coin batteries in a week or two. Now that I can set transmit power, I’m wondering how low I should set the gain. For my application, the DK doesn’t send data out, it’s just watching for Particle Events. Does setTxPower affect receiving capabilities, or is it truly for transmission only? If I set it as low as possible, would it still receive events just as well?

Thanks,
-Nick


#2

Oh, and how much power can I save turning off the status LED?


#3

BLE is bidirectional, so syncing of the radios and sending data always requires data to be sent both ways. So turning down the transmit power of bluz will affect the range no matter what your application does. Chances are you can probably turn it down a fair amount if your board and gateway are in the same room, but it will require some tuning and experimenting from your side. This can definitey increase the battery life if you can turn it down as much as possible.

Turning off the LED will also save a fair amount of power.

You can also look into turning down the connection interval. This is a little hidden at the moment, but the nrf51 gateway has a Particle function to do this. You can see the code here: https://github.com/bluzDK/bluzDK-firmware/blob/develop/user/applications/bluz_gateway/bluz_gateway.cpp#L48

By calling that function with the parameters “250,250” you will increase the connection interval by 10x. This means the radio will transmit 10 times less often, saving you a lot of battery. The downside is it will increase latency, but that doesn’t sound like much of a big deal for your application.

This function is still not documented, but it does work just fine. It also doesn’t get remembered between power cycles at the moment, so you would have to call it again if the gateway reboots. We will make this easiest to access in future releases, but you can use it now. When you call it, it will disconnect all bluz DK boards currently connected, then they will automatically reattach.