ADC Leakage?

TAMeyer

Member
Greetings:

Summary:
On an AXE091 a 20X2 ADC reading is taken from a backup battery for a DS3231. With the 5V P/S off, the battery appears to “back feed” into the entire circuit, surely draining the battery.

The battery (without the diode shown in the schematic) pegs the ADC at 1023, so a divider is needed. Makes sense.

But how is the power getting back into the circuit as a whole?

The PIC18(L)F1XK22 datasheet states: Max ADC impedance is 10K.

I'm a novice and do not understand how voltage relates to impedance with regard to a power source. Perhaps a better understanding of Ohm's law is in order.

In any case, is the 10K max relevant to the issue?

The associated forum URLs are at the bottom of this post.

Thanks in advance,

Terry

[HR][/HR]
Detail
The attached shows 3 schematics

1/ MaceTech’s ChronoDot that uses the DS3231
2/ A “Topper” board holds a backup battery and sits directly on the ChronoDot
3/ A 20x2 which is placed in an AXE091 (no prog or decouples shown)

Battery: Panasonic CR-2477 / 3V – 1000mAh

The code referring to ADC is:
Code:
        Let ADCSetup = %0000000000001000     'ADC3
And later

Code:
BatteryCheck:
    Readadc10 3,BatteryADC        'Read ADC3 into VAR "BatteryADC"
                        'Per the manual
‘On X2 parts you must use the ADC channel, not the pin ‘number, in the readadc
                        'command (e.g. readadc10 0,w1 NOT readadc10 A.0, w1)
        
    Sertxd ("Battery ADC :",#BatteryADC,CR,LF)
        If BatteryADC < 450 Then Toggle BattLowLED    'See Scratchpad for ADC-Volts table
            EndIf                        'Min Battery Spec is 2.3V
        If BatteryADC > 450 Then Low BattLowLED
            EndIf
    Return
The complete code is found as an attachment

The problem is with the ADC connection to the 20X2.

With the AXE091 P/S off, and the ChronoDot’s “BAT” connected to pinC.3 of the 20X2, a small amount of power remains as evidenced by the AXE091’s power LED. The terminal continues to function showing the correct time, any alarms and the ADC reading. Even with the terminal closed, programming is disallowed.

Obviously, this will drain the battery. Removing the ADC connection solves the problem but defeats the whole idea.

Using the 1st diode found in a parts drawer (an IN4001), the problem is solved. The orientation has been double checked per the schematic. The diode’s band faces the BAT.

But this is a cheap fix, and I didn’t learn anything.



Voltage Measurements5V PowerOn5V PowerOff
ChronDot BAT3.17V3.17V
20X2 pinC.3110mv68mv


ADC Measurements5V PowerOn5V PowerOff
With Diode~501No Terminal
Without Diode7071023 (Term runs on BAT)

So with a 1023 reading, the battery is blasting the ADC

That observation, the extracts and forum references below suggest a voltage divider.

The IN4001 has ~ .7 voltage drop.

Is this the correct solution?

[HR][/HR]
Background
PIC18(L)F1XK22 Datasheet / Page 213

For the ADC to meet its specified accuracy, the charge
holding capacitor (CHOLD) must be allowed to fully
charge to the input channel voltage level.

The maximum recommended impedance for analog
sources is 10 k.

Picaxe Manual 2 / Page 32
The default Vref +signal is the power supply (V+) and Vref- signal is 0V, so the
analogue voltage range is the same as the power supply to the PICAXE chip.


http://www.picaxeforum.co.uk/showthread.php?4852-08M-ADC-Input-impedence&highlight=ADC+leakage

http://www.picaxeforum.co.uk/showthread.php?13524-Making-best-used-of-ADC-resolution-for-reading-battery-voltage&highlight=ADC+leakage
 

Attachments

Last edited:

hippy

Technical Support
Staff member
But how is the power getting back into the circuit as a whole?
The most likely explanation is that the ADC input pin has an ESD protection / clamping diode to the +V of the PICAXE chip; so it's as if you had connected a diode from the ADC input to +V.
 

besupreme

New Member
The battery is paralleled to B-E of the transistor, and connected to the 32kHz output of the DS3231. I don't understand what you try to do..??

Your Picaxe is probably off now, because with the 1N4001, Picaxe VDD is below brownout. Probably VBat - 0.7V - 0.5V, which are the forward voltages of the 4001 and the internal Picaxe protection diodes.
 

BeanieBots

Moderator
As stated by Hippy, it is because you are applying a voltage to an input on a device which is not powered.
Nearly all chips (including PICAXE) will not be happy with this for the reasons Hippy gives. In short, you are trying to power the chip via its input protection diode. These diodes are not designed for such large currents and can easily fail which in turn can destroy the chip.
Your solution of a diode is the correct one.
 

TAMeyer

Member
@hippy/@BeanieBots

Insightful.

The diode placement was trial and error.
So now that I know it's correct, I need to learn why.

Your answers give me enough to info to do exactly that.

Thank you

[HR][/HR]
@besupreme

The actual circuit works as described. Efforts this AM to combine 2 schematics into one clear and consistent graphic for this post fell short. A corrected schematic has been uploaded….thanks for the prompt.
 
Top