Hello there 
I'm working on a low power project that involves sending data to a device every minute or so from the Arduino nano 33 BLE to an android phone, kinda like a beacon device.
I succesfully achieved my goal three days ago by modifying the batteryLevel.ino example and using nRF connect for mobile Everything works as expected.
The problem here is the low power implementation, I've followed all recommendations posted in the forum (setting to low all unused pins, leds powered down and cutting the 3v3 jumper) and besides that, it still draws between 0.8mA and 1.5mA when no connection is set and around 3.5mA when connected to my device.
So my question, Is there a way to tell BLE to avoid broadcasting when there is no data to be sent? Like using a delay (not by comparing millis() with an old value) inside the BLE sequence to avoid having the mcu active all the time.
Also, i'm wondering if there a way to reduce the transmission power? Because couldn't find any "setTxPower" command while searching in the library and I've read on the datasheet that it can be set below 0dBm and up to +8dBm.
Thanks in advance.
juanios:
I'm working on a low power project that involves sending data to a device every minute or so from the Arduino nano 33 BLE to an android phone, kinda like a beacon device.
That is not how the GATT protocol works. You can update your data at whatever interval you like but the client decides whether it reads the data at that interval. When the client subscribes to the data it can read the data at the interval set by the sensor, but it does not have to. So, the client will also decide how long your battery in the peripheral/server lasts. For example, a heart rate monitor device, when you do not start activity recording on a watch the data is not read the the sensor battery will last longer.
juanios:
The problem here is the low power implementation, I've followed all recommendations posted in the forum (setting to low all unused pins, leds powered down and cutting the 3v3 jumper) and besides that, it still draws between 0.8mA and 1.5mA when no connection is set and around 3.5mA when connected to my device.
Can you post an example code?
Do you make use of sleep? On the Arduino BLE this can be done by calling delay.
juanios:
So my question, Is there a way to tell BLE to avoid broadcasting when there is no data to be sent? Like using a delay (not by comparing millis() with an old value) inside the BLE sequence to avoid having the mcu active all the time.
In BLE data is not send when it is not requested. The BLE library function just stores the data in a characteristic. The client decides whether it wants to read the data or not.
juanios:
Also, i'm wondering if there a way to reduce the transmission power? Because couldn't find any "setTxPower" command while searching in the library and I've read on the datasheet that it can be set below 0dBm and up to +8dBm.
The BLE specification currently does not have a way to set transmission power. The entire protocol was designed to be low power. Many BLE devices will live off a coin cell for many months or more than a year. Itβs up to the application (how often do you read the sensor, do you use sleep,...) how long the battery lasts, the radio has been taken care off by the standard and Arduino has tested it for compliance (which usually involves setting Tx power to the lowest level possible with the used antenna design).
Additionally, the radio of the Arduino 33 BLE supports other low power radio protocols and therefore the datasheet shows features a proprietary protocol could use.