Sending Battery Level in Advertisement Packet

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ShCh_1406391
Level 1
Level 1

Hello,

   

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?

0 Likes
1 Solution
Anonymous
Not applicable

In real time means on actual advertisement, right?

   

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

View solution in original post

0 Likes
5 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Consider posting your project, makes life easier to troubleshoot.

   

 

   

“File”                                                           Designer

   

“Archive Project”

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

In real time means on actual advertisement, right?

   

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

0 Likes
Anonymous
Not applicable

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.

   

Regards

   

  Paul

0 Likes
ShCh_1406391
Level 1
Level 1

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.

0 Likes
Anonymous
Not applicable

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?

   

Alex

0 Likes