PaxInstruments / t400-electronics

Electronics for the Pax Instruments T400 temperature datalogger
20 stars 9 forks source link

Leakage current in battery Vbat_EN circuit #74

Closed Tsillen closed 9 years ago

Tsillen commented 10 years ago

The Vbat_en pin is (i assume) used to enable the measuring of the battery voltage. When a microcontroller pin is low it is not 0V or (GND) but somewhere around 0.4 - 0.7V . When the battery is at 3.7V and vbat_EN pin is low. There is a leakage current of ~120uA. leak1

The same goes for when the Vbat_en pin is high. It is around micro vcc +0.5V. This has a leakage current of -60uA worst case. leak2

One could fix this by using a logic level mosfet to enable / disable the voltage measurement.

charlespax commented 10 years ago

The idea is to have VBAT_EN drop low only when reading the battery voltage. When not reading the battery voltage VBAT_EN would be set to high impedance. Is there any current when VBAT_EN is high impedance?

Here is the related schematic: screen shot 2014-09-08 at 17 08 44

Tsillen commented 10 years ago

According to some internet searching when the arduino pin is high impedance (defined as output) it is an equivalent of 100M ohm resistor up to the top voltage rail (5.5V). This results in an leakage current of -60uA when the output is in high impedance state.

I did a test with an n channel mosfet. When the mosfet is enabled (measuring voltage) the leakage current is again at around 120uA. But when we are not measuring thus vbat_en = 0.4V the leakage current is ~400nA when using an pulldown on the gate of the mosfet to keep it low or ~1.5ua when no pull-down is used.

charlespax commented 10 years ago

The ATmega32U4 datasheet states (p.65), "All port pins have individually selectable pull-up resistors with a supply-voltage invariant resistance." The internal pullup resistor can be enabled or disabled in software. Also note the T400 operates at 3.3 V.

Below is the I/O Pin Equivalent Schematic from page 65. screen shot 2014-09-08 at 17 38 14

Tsillen commented 10 years ago

You could do some real life testing to determine the leakage current. Something like a Ucurrent could help.

charlespax commented 9 years ago

The Atmega32U4 datasheet indicates the I/O input leakage current is 1 uA. This is fine. Closing issue.

screen shot 2015-01-25 at 17 51 09