Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9881 Discussions

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

COatt
Beginner
966 Views

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
Sergio_A_Intel
Employee
112 Views

Hi,

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

-Sergio

Reply