You are here

Sending Battery Level in Advertisement Packet | Cypress Semiconductor

Sending Battery Level in Advertisement Packet

Summary: 5 Replies, Latest post by azheng1023_1510621 on 30 Oct 2015 11:25 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
Shalin Chikhalkar's picture
9 posts


I am trying to send the battery level in the advertisement packet. I am using the CY8CKIT-042-BLE. I used the constant broadcaster sample application provided by Cypress and tried to modify it. I used the Timer to decrement the value of the battery as showed in the video lectures. I am able to put custom data in the advertisement packet, but not real time data. Can any one help me?

user_14586677's picture
7646 posts

Consider posting your project, makes life easier to troubleshoot.


“File”                                                           Designer

“Archive Project”


Regards, Dana.

roit's picture
Cypress Employee
221 posts

In real time means on actual advertisement, right?

If that is the case, try using the API 'CyBle_GapUpdateAdvData' after every data change.

Paul Donnelly's picture
7 posts

Hi Shalin,

How are you measuring battery voltage? It would be good to have this type of functionality baked into a drop in component. At the moment it's not clear how to achieve this without adding external components.

A simple once per day BAT check to indicate if the coin cell is OK or LOW will do. If LOW I can mod the advertising packet so an observing smartphone can take action. In my particular application measurements don't need to be high accuracy or frequency but they do need to be low power and I'd prefer not to add any external components. 

Riot is correct, updating the advertisement is fairly straight forward using CyBle_GapUpdateAdvData. You can actually do a whole host of things with this. Have a look at the 100 Days Project 9 Dynamic Broadcasting.




Shalin Chikhalkar's picture
9 posts

Thank you all for the comments,

@Paul: I am using the onboard ADC and the battery measuring sample code provided in Project 045 the Optical Heart rate Monitor.


azheng1023_1510621's picture
11 posts

Hi Shalin,

I am using the same code but it always gives 100%. I did not suspect anything until the battery suddenly died. It seems that there should be some time between 100% and when the battery died (which the code cannot measure).  Now I am questioning its accuracy. Have you done any test to determine how accurate it is?


Log in to post new comments.