0
\$\begingroup\$

Here's my setup:

I'm trying to measure 18650 battery voltage of the UPS. UPS in question does provide voltage reading, but on the output of the regulator. Strange choice, given that the whole point of the regulator is to output stable 5V. Anyways, since RPi does not have an ADC, I thought I would hook one up to it. My wiring is:

  • ADC V - 5V Rpi
  • ADC G - Rpi G
  • ADC SCL - Rpi GPIO 3
  • ADC SDA - Rpi GPIO 2
  • ADC ADDR - Rpi GND (not sure if this is strictly needed)
  • ADC A0 - Battery + terminal

Without hooking up A0 to the battery terminal, UPS and Raspberry Pi turns on just fine. As soon as I hook up A0 to Battery+ two things happen:

  • RPi Power LED turns on along with UPS RPi Power LED
  • UPS refuses to turn on, acting like there's a short in the system

I must admit I'm pretty new to using ADCs. I was under the impression that the wiring here makes sense - ADC, RPi and UPS all share common ground, and hooking up Batt+ to A0 would allow it to measure potential. Apologies in advance if I'm doing something obviously stupid here. Any advice is appreciated.

\$\endgroup\$
1
  • \$\begingroup\$ What do you mean by 18650? \$\endgroup\$
    – bardulia
    Commented Nov 15, 2023 at 22:40

2 Answers 2

1
\$\begingroup\$

As soon as I hook up A0 to Battery+

.. you violate the ADC absolute maximum specs.

Look into the datasheet: The input is only allowed VDD+0.3V, and VDD is 0V as long as the regulator is OFF.

There is a diode between the ADC input and VCC, and thus the battery will reverse power the chip (and the RPi). As there is potentially a high current flow, this can damage the pin.

\$\endgroup\$
2
  • \$\begingroup\$ I see. I was under the impression that is only an issue when the ADC is powered, that is, there's voltage supplied to the V pin. Since, when RPi is on, voltage is 5V, and max voltage of 18650 is 4.2V, I'm in the clear. I didn't realize supplying voltage on A0 when the chip itself is unpowered may be harmful. Good to know, thanks! \$\endgroup\$
    – Nik I.
    Commented Jan 23, 2021 at 20:29
  • \$\begingroup\$ What would be the canonical way of solving this? I'm a programmer by trade and I only dabble in circuits. I could hook up a transistor between A0 And Batt+ and activate it from the Raspberry Pi as it powers on. Would that make sense? \$\endgroup\$
    – Nik I.
    Commented Jan 23, 2021 at 20:35
1
\$\begingroup\$

The ADS1115 maximum analog input pin voltage is its supply voltage + 0.3V. Which means, an unpowered ADS1115 can take 0.3V on its input without exceeding the safe limits.

The ADC also has protection diodes from analog input pins to supply pins.

If you connect the analog input directly to a battery, current will flow via protection diodes to the 5V supply node, trying to power the all the circuitry up, and there is nothing to limit current.

It is possible that the overvoltages and overcurrents may have damaged your chips and circuits.

Perhaps a resistive divider of two 10k resistors would help, so the battery is not directly connected.

\$\endgroup\$
1
  • \$\begingroup\$ I'm trying to measure 18650 battery voltage. There are two, but they are connected in parallel, so max V is still 4.2V. I think Turbo J is onto something, though - I can't hook up A0 with the ADC powered off, since then VDD is 0, A0 is ~4V and the delta is > 0.3V \$\endgroup\$
    – Nik I.
    Commented Jan 23, 2021 at 20:31

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.