Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
854 Views

A method of reading battery voltage on Ubilinux (and Yocto)

A few days ago I discovered a way of obtaining the current battery voltage on both Ubilinux and Yocto with no extra hardware required. I've not seen any reference to this method elsewhere, so I thought I'd post it.

The battery voltage is read by the "basincove" adc, part of the hardware on the Edison. It can be accessed through sysfs, with the device located at /sys/devices/platform/bcove_adc/basincove_gpadc. It is operated by setting /path/to/basincove_gpadc/channel to 1, then writing 1 to /path/to/basincove_gpdac/sample. The result of the ADC conversion is then returned in /path/to/basincove_gpadc/result. This is (I believe) a 10-bit value, representing a voltage between 0 and 4.5v.

I've uploaded a proof-of-concept https://github.com/cjo20/EdisonVoltage/ here

1 Reply
Highlighted
Employee

Re: A method of reading battery voltage on Ubilinux (and Yocto)

Hi,

Thank you for uploading this guide. This will surely be useful for other members of the community.

-Sergio

0 Kudos