Battery discharge curve
#1
I fully charged my PineTime and then started measuring the battery voltage until it was completely empty. Here is the chart:
[Image: pinetime-battery-log-plot.svg]
You can see the raw data here. It contains two axis: the x axis is the raw 12-bit ADC value and the y axis is the number of seconds since measuring started.

As for methodology: I charged the PineTime for about 3 hours so it must be completely full. Before measurements started, there was maybe a gap of one or two minutes. The screen was on all the time (refreshing every ~10 seconds) and LCD_BACKLIGHT_HIGH was on all the time as well. The CPU was in sleep mode most of the time between displaying the results. However, it was connected with a debug wire which AFAIK prevents the CPU from going to sleep. Measurements were sent to the host using ARM Semihosting.
To my surprise, it still took almost 7 hours for the battery to run empty.

This data could be useful for developing a discharge indication algorithm for the PineTime.
#2
can you share your code so we can run this test on more devices to get more statistical significance? maybe log 20 charge cycles per dev unit?

Sent from my SM-G960F using Tapatalk
#3
Sure,  here is the code:

Code:
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator)
import json
data = json.load(open('pinetime-battery-log.json'))

# Set things up.
fig, ax = plt.subplots(figsize=(10, 8))

# Massage the data to be easier to interpret, and draw it.
xaxis = [e[0] / 60 / 60 for e in data]
yaxis = [e[1] * 2 / (4095 / 3.0) for e in data]
ax.scatter(xaxis, yaxis, s=1)

# Draw some labels.
plt.xlabel('Time (hours)')
plt.ylabel('Voltage')
plt.title('Battery discharge curve')

# Draw the grid.
plt.grid(which='both')
plt.minorticks_on()
plt.grid(b=True, which='minor', alpha=0.3)
ax.yaxis.set_major_locator(MultipleLocator(0.1))
ax.xaxis.set_major_locator(MultipleLocator(1))
ax.xaxis.set_minor_locator(MultipleLocator(10/60))

# Show the chart.
plt.show()

Note that this is the first time I use matplotlib, I might have done some weird things.
#4
haha, ment code running on device Wink
#5
Impressive graph. Good job ayke!

The pinetime-devkit0 lacks a discharging protection, so that graph suggests to firmware developers to cut off consumptions at +/- 3.55V disabling devices and indicating about current operation mode and state.

A power monitor should be implemented in software. I suggest following states and indications:

[Image: aEkROZn.png]
#6
no led indication when battery is low. LED might actually consume more power then the nrf52 chip Wink

Sent from my SM-G960F using Tapatalk
#7
maiden Wrote:haha, ment code running on device  Wink


Sorry, realized that after posting the code.

It was written in Go using TinyGo. Much of the code is a bit of a mess and depends on non-upstreamed changes. I'll post the code once it is ready.

Conceptually, it just measures the voltage using the ADC on pin 31 (AIN7) with the following settings:
  • reference voltage: internal (0.6V)
  • gain set to 1/5
  • positive/negative channel resistors bypassed
  • acquisition time 3µs
  • single ended mode
#8
(10-30-2019, 07:17 AM)maiden Wrote: no led indication when battery is low. LED might actually consume more power then the nrf52 chip Wink


An alternative is to do 0.2s-on 0.8s-off indication during 3 seconds when the user press the button. Just to say it is alive but almost dead.
#9
is the indication led multicolor or single color? flashing red 3 times when battery is critical and user presses button would be enough to inform the end user.

general user interface guidelines:
green = operational, everything is ok
orange = partial functionality, loading, connecting, searching etc.
red = i am broken, out of power, shutting down, BAD!

then on top of that you can flash for different lengths, periods and cycle times. (ex. 0.5 sec lit, 1 sec dark, 2 times every 5 sec).

but i those are more for debugging / developer feedback then user feedback.

Sent from my SM-G960F using Tapatalk
#10
Schematic suggests a single colour LED, dunno what colour, so no dual colour indication there!

http://files.pine64.org/doc/PineTime/Pin...191020.pdf


Forum Jump:


Users browsing this thread: 1 Guest(s)