Battery discharge curve
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.
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
Sure,  here is the 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.title('Battery discharge curve')

# Draw the grid.
plt.grid(b=True, which='minor', alpha=0.3)

# Show the chart.

Note that this is the first time I use matplotlib, I might have done some weird things.
haha, ment code running on device Wink
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]
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
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
(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.
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
Schematic suggests a single colour LED, dunno what colour, so no dual colour indication there!

Forum Jump:

Users browsing this thread: 1 Guest(s)