Hello,
I developed an application for the nrf51822 Smart Beacon, SDK11 s130, that basically advertises the battery lvl of the beacon, the staus of button_1 and the number of times that button_1 was released. For handling the button events I am using app_button.h and for measuring the battery lvl I am using nrf_adc.h.
I am updating the battery status every 12 hours and advertising every 1 minute and on every button event. Since the maximum advertise interval I can get from the advertise configurations is about 10s, I am sending one package, stopping the transmission, using a timer to count 1 minute, sending one package again and so on.
Despite some irregular measures from the adc, my application works fine. My problem is that the Beacon runs out of battery in less than 3 days, when it was supposed to last several months. In my main loop, inside int main(void), I have only sd_app_evt_wait() to put the chip into sleep mode. All the rest is triggered by interruptions of the button and the timer. The payload is only 12 bytes long. In my adc event handler function I have nrf_adc_stop() to lower the consumption between conversions.
I do not know what is causing the beacon to die so fast. The only thing I can think of is the timer for the 1min adv interval. Is the timing preventing the chip to enter into sleep mode while it is counting? I thought the longer the adv interval the better it would be for power consumption, that is the only reason I am using the timer.
Thank you!