Battery discharge curve
#11
(11-22-2019, 04:26 AM)pfeerick Wrote: Schematic suggests a single colour LED, dunno what colour, so no dual colour indication there!

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

If there is an LED, it is not visible from the outside. I tried to toggle pin 27 and saw nothing...

Quote: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

Thanks @ayke  for these info, I've successfully measured the battery voltage with these.
I've measured max voltage of more than 4v, a bit more than what you show on your graph.

How should we use your discharge curve to display the battery level in % ? For now, I implemented a simple linear interpolation between 3.9v and 3.55. Anything above 3.9 is 100%, anything lower is 0%. Is there a smarter way to process the voltage?

Thanks!
Working on InfiniTime, the FOSS firmware for the PineTime: https://github.com/InfiniTimeOrg/InfiniTime

Mastodon : https://mastodon.codingfield.com/@JF
Twitter : https://twitter.com/codingfield
Matrix : @JF002:matrix.org
#12
(12-31-2019, 08:11 AM)JF002 Wrote: If there is an LED, it is not visible from the outside. I tried to toggle pin 27 and saw nothing...

Strange... the backlight LEDs are controlled by different IOs, so it's not for them, and the GPIO port assignment document also says it's a STATUS_LED but it also says 'NOT STAFF' next to it, which makes me think it's not fitted. Undecided
#13
(01-02-2020, 02:33 AM)pfeerick Wrote:
(12-31-2019, 08:11 AM)JF002 Wrote: If there is an LED, it is not visible from the outside. I tried to toggle pin 27 and saw nothing...

Strange... the backlight LEDs are controlled by different IOs, so it's not for them, and the GPIO port assignment document also says it's a STATUS_LED but it also says 'NOT STAFF' next to it, which makes me think it's not fitted. Undecided

I also think it's not fitted. On the schematic, you can see the pin 0.27 on the MCU that is "connected" to LED13, but it's written "NC" (Not connected ?) just below.
Working on InfiniTime, the FOSS firmware for the PineTime: https://github.com/InfiniTimeOrg/InfiniTime

Mastodon : https://mastodon.codingfield.com/@JF
Twitter : https://twitter.com/codingfield
Matrix : @JF002:matrix.org
#14
Oh derp... you're right, you're right! Neither the LED or the current limiting resistor are populated / connected!
#15
@ayke 
could you also share the pure data that you've collected?
#16
(10-30-2019, 06:34 AM)caligari Wrote: Impressive graph. Good job ayke!

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

Impressive chart! 

Did you make this?  Combined with the suggestions below on user feedback, this thread is a total package when it comes to "how you do battery management right."

Playing around with these things via bash & python on a pinebook pro for the same general purposes / satisfying my curiosity.

Using bash to generate the voltage data at the moment, to a file python consumes.  Haven't figured out matplotlib but the provided code looks like a great start, thank you all very much!


Forum Jump:


Users browsing this thread: 2 Guest(s)