P2 charge indicator

Hi @dj_guigui - I'd reach out via support.particle.io to change your order. Alternatively, you could give the Particle Argon a shot.

Just coming up to speed here. I also discovered that the CHG variable is not reliable. And there's no software fix.

I am working on a battery powered project and I need to detect charging correctly so I don't put the device into ULTRA_LOW_POWER when I am trying to charge the battery.

Two Questions:
Is it possible to use the VUSB pin to detect if the USB cable is connected? I could use that with the voltage to get an estimate of charge state.

Second, would it be possible to update the docs to reflect the actual functionality? It's very misleading.

1 Like

I previously checked and there does not appear to be a way to check USB power on RTL872x.

On the nRF52, there's a line that runs from the USB 5V line directly to the MCU. This does not power the MCU, but rather is used to determine if the USB interface is powered, and the MCU turns off the USB block in the MCU when USB is not powered/connected to save power. Thus the MCU can detect whether there is power on the USB interface from a register.

This doesn't exist on the RTL872x.

There is now a warning in the docs about the CHG pin on the Photon 2.

There is now a warning in the docs about the CHG pin on the Photon 2.

Awesome. Thanks for that. And thanks for the info about the 5V line.

HI -

Little late to the party, so my apologies if this has been addressed.

@benjenkins Have you though about using an external charger IC? I am using the ISL9301IRZ on the PMIC for BSoM's, but it should work for you as well. It is a really nice charger IC which also allows for battery disconnect when not in use.

This IC does have "charging output" that can be monitored by the uC that can alert you when it is charging and when it is done charging.

Regards,
Friedl.

Hello,

Do you have any news about the problem?
Has this already been corrected on current models?

Best regards

I've just purchased a Proton2 and discovered it still has this issue, so obviously not solved yet.

I found a note here which says CHG doesn't work:

But when I look at the Photon2 datasheets, but there is no mention here of CHG not working:

In fact the "known errata" section of the datasheet for the Photon2 is empty:

I am not surprised ! There are no more responses to my messages. I really have the impression that this is not a priority despite the fact that in my opinion it is an important problem since it affects the battery part. The reason why the problem is not listed in the documentation unfortunately seems quite obvious to me.

It appears to half work, but maybe that's what others have said above.

If I have a battery attached and a VUSB attached, then the following works fine. If I drive the VUSB low, the charger LED turns off, and CHG input goes high, so the code all works as expected.

However, if the VBUS is open circuit, then I see the problem and the CHG input goes low and incorrectly indicates the charger is connected.

From what I can see, there seems to be no other way to tell if VUSB is 5V on the Photon2.


#include "Particle.h"

// Define the pins we're going to call pinMode on
int LED = D7; // This one is the built-in tiny one to the right of the USB jack

void setup() {
pinMode(LED, OUTPUT);
pinMode(CHG, INPUT_PULLUP);
digitalWrite(LED, LOW);
}

void loop() {
digitalWrite(LED, !digitalRead(CHG));
}

The Photon 2 datasheet and Photon 2 from Argon migration guide now list the CHG pin as not supported and have the same warning as the Device OS firmware API guide.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.