Battery charge measurement