Advertise battery level with Bluefruit LE Friend

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
27percent
 
Posts: 3
Joined: Sun Mar 02, 2014 3:44 pm

Advertise battery level with Bluefruit LE Friend

Post by 27percent »

Hey there, forum!

I asked a question on last night's Ask an Engineer & Ladyada said I should post it here for a more comprehensive answer

I have a Bluefruit LE Friend hooked up to a PowerBoost 500c, I'm trying to get the BLE Friend to advertise it's battery level so all central devices around it can see how much charge is left. I'm planning on using it as a cell phone power bank and, instead of indicating power with LEDs or an LCD, I'd love to do it over BLE.

There's an AT command to echo out the main power supply voltage (AT+HWVBAT) & a BLE service/characteristic for percentage battery remaining, but there's no easy way I can think of to hook the two together to advertise the remaining power. I know I'd have to run a line directly from the battery to the BLE Friend since to PowerBoost always outputs 5.2v, is the BLE Friend/PowerBoost combo even capable of doing this kind of thing or should I pick up an RFDuino or BLEnano to do it instead?

Thanks for your help :-)

J

User avatar
ktownsend
 
Posts: 1447
Joined: Thu Nov 05, 2009 2:18 am

Re: Advertise battery level with Bluefruit LE Friend

Post by ktownsend »

You won't be able to output the battery level as is with this setup because you can't really measure the current as is. The reason a command is specified to monitor input levels is that these boards are often run from a LIPO cell (4.2V max) into a voltage divider, and by measuring the voltage level after the divider we can determine the charge remaining as a rough percentage. Using the external boost you don't get the same consistent drop in the supply voltage as the battery slowly discharges.

You'll need to add an MCU into the picture and a current monitoring device (ex. https://www.adafruit.com/product/904), read the current and then update the BLE data. This has nothing to do with RFDuino or whatever else .... you'll have the same issue on any platform with a boost like this.

Locked
Please be positive and constructive with your questions and comments.

Return to “Wireless: WiFi and Bluetooth”