I want to use this Single Cell Li-Ion Solar Battery Charger (BQ24210). The pins /CHG and /PG are an open collector outputs and it will be connected to two low power LEDs as shown in the schematic. If I would also like to connect /CHG and /PG pins to GPIO pins of the ATMega328p microcontroller. What would be the best way to do this? The two GPIOs will be configured as digital input. Thanks.


simulate this circuit – Schematic created using CircuitLab


1 Answer 1


If the ATMega328p is operated from the 3.3V supply, you can connect them directly, but you should enable pullup resistors in the ATMega, because the voltage drop of the LED may be high enough that the pins will not be reliably pulled up to a logic '1' when the outputs are off.

If the GPIOs get switched accidentally to outputs, a fair bit of current will flow to the BQ so it might be more conservative to use a series resistor perhaps 470 ohms. The minimum (internal) pullup is 20K so that will result in an extra 80mV or so of output voltage, not disastrous.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.