Autonomo Charging Status

Hey guys,
I jumpered SJ7 and am reading the A1 pin to get the charging status. Ideally, I would just get a 0 or 1 to let me know it was charging. When using analogread, I get a value somewhere between 0 and 800. 0 when no light and some number higher when there is light. However, it doesn’t appear to be linear. If I could know how to correctly read this signal to match when LED2 was on, that would be great. I started poking around the docs on the charging chip status, but it looks like I will have a small learning curve. If you guys could assist, it would be greatly appreciated. Thinking I may need a resistor or two for a simple digital signal? Thanks in advance…

Here is a link to the datasheet for the chip…

You should be able to use the ditigalRead() with A1.

I’m not sure if you need to also set the pinMode for A1 first.

I tried digitalRead first, but it always returned zero.

Can you confirm which revision of the Autonomo you have?

Looks like it is Rev 5

I was just checking as the charge status feature (SJ7 -> A1) was added in Rev.3.

Anyway, to use an analog pin for digital IO, you do need to set the pin mode on the SAMD platform. I believe this might have been unnecessary on the AVR platform.

Note, the charge indicator, LED2 will also light up when the battery is charging. If LED2 is off, you will receive a LOW reading.

Here is a test sketch, change the pin as required:

#define PIN A13

void setup() 
  pinMode(PIN, INPUT);

void loop() 
  SerialUSB.println("Reading: " + String(digitalRead(PIN)));

That was the first thing I tried and then switched to analog. Digital always returns zero. I will try another board…

Do you have a link for the schema for Rev.5, I can only find up to Rev.4b.

No…not finding schema for rev 5. I do have a 4b board…I will try it on that one as well and post back.