Hi!
I have developed a wearable based on Arduino Nano 33 BLE Sense. The device collects data from built-in and external sensors and sends them over BLE to a custom Android App. I want the device to operate over night continuously as the data are related to sleep efficiency.
In brief, I write acceleration, gyroscope, light and noise data characteristics on every loop iteration. At first I used a delay of 1000 ms at the end of the loop (with the same behavior). Now this needs to be set at 100ms as in the loop I also sample data from a heart rate sensor, which didn't work with a delay of 1000ms (took some time to figure out).
I also write two characteristics (heart rate and skin temperature) using the micropocessor's timer interrupts at 1 and 5 minute intervals.
On the Android App I save the transmitted data every one second so the 100ms delay is useless in this case, but still have to respect it in order to sample correctly the heart rate.
The device is powered by a 3.7 V battery with a capacity of 200mAh.
The whole Arduino-Android system is working great. My problem is that during the night, the android app receives a notification that the arduino is disconnected from BLE. And this is happening on random(?) occasions. For example, in my first use over night the device was transmitting data successfully for about 2 hours. Next night it disconnected after only 10 minutes. What is even more strange, is that on every loop I check for the BLE central connection, and if connected I keep the built-in LED on high, else on low. However, when the device is disconnected, the LED is kept on high, meaning that the central is still connected.
I suspect it may be a problem of the Voltage level after some period passes. Maybe the BLE chip needs a certain Voltage level to operate? Even so, I read that the nrf52840 can operate from +5.5 down to +1.7v , which my battery can supply. So that shouldn't be a problem.
Overall, the device is "alive" for about a total of 6 hours.
Any ideas appreciated. Thank you in advance!