Keep low power mode and Bluetooth on until data is received.

Hi.

I am developing a small notification monitor. 

It used a 150mha battery and a 0.92 oled.

I want it to be connected to my phone via Bluetooth and when I send a string via Bluetooth to the device, it's shows the text 5s.

My code is a simple loop that if there's something in serial read, display it.

I wanted to put the device in low power consumption without losing connection until something is received, the wake up, display and go back to low power.

I have read that is possible but I didn't found any example, and all the examples I find is to send information and not to receive it.

Thanks in advanced.

Parents
  • Hi,

    This is a common usage scenario with Bluetooth Low Energy. While in a connection the central and peripheral communicates at regular intervals (the connection interval). A peripheral that normally should do nothing (like your device) will then sleep and wake up on every connection event to exchange data. If there are no data, an empty packet is exchanged to keep the link alive, and the device will go back to sleep. There is also a concept called slave latency, which allows the peripheral to skip some of these connection events to save even more power.

    The key point here is to make sure the device enters sleep mode while it doe snot do anything, while the connection is active. And ensure that you use a fairly long connection interval (though you must take into account requirements you may have on latency). This mechanism works the same regardless of if you are sending or receiving data (or both).

    As this is the fundamental concept of Bluetooth Low Energy most examples that demonstrate a connection will show you how to implement this. If you are using the nRF Connect SDK, you can take a look at the UART over BLE examples (Bluetooth: Central UART and Bluetooth: Peripheral UART). Note that the examples themselves are not very low power due to the use of UART, but they demonstrate the Bluetooth part of this (and you can easily strip away the UART code if you want to base your application code on this).

Reply
  • Hi,

    This is a common usage scenario with Bluetooth Low Energy. While in a connection the central and peripheral communicates at regular intervals (the connection interval). A peripheral that normally should do nothing (like your device) will then sleep and wake up on every connection event to exchange data. If there are no data, an empty packet is exchanged to keep the link alive, and the device will go back to sleep. There is also a concept called slave latency, which allows the peripheral to skip some of these connection events to save even more power.

    The key point here is to make sure the device enters sleep mode while it doe snot do anything, while the connection is active. And ensure that you use a fairly long connection interval (though you must take into account requirements you may have on latency). This mechanism works the same regardless of if you are sending or receiving data (or both).

    As this is the fundamental concept of Bluetooth Low Energy most examples that demonstrate a connection will show you how to implement this. If you are using the nRF Connect SDK, you can take a look at the UART over BLE examples (Bluetooth: Central UART and Bluetooth: Peripheral UART). Note that the examples themselves are not very low power due to the use of UART, but they demonstrate the Bluetooth part of this (and you can easily strip away the UART code if you want to base your application code on this).

Children
No Data
Related