# MSP430G2553: measure the voltage of a non-rechargeable 3.6V battery

I am designing a circuit to measure the voltage of a non-rechargeable 3.6V battery. This battery powers the microcontroller (http://www.ti.com/lit/ds/symlink/msp430g2253.pdf) with which I want to measure its voltage.I simulated both circuits and they seem to work, which do you think is better? Thanks in advance.

simulate this circuit – Schematic created using CircuitLab

Best regards,

Fran Martin

• Is your MCU powered directly from the battery you wish to measure? If so then both will work fine but watch out for device leakage currents draining the battery through the pot divider resistors. Aug 16, 2017 at 17:16
• @Andyaka Thanks! Yes, the MCU is powered direcly from the battery. What problems are there in leakage currents through the divider resistors? Aug 16, 2017 at 17:28
• By 'directly' do you mean MCU Vcc is connected directly to the battery? If not, please show the power supply circuit. Aug 16, 2017 at 19:37
• @BruceAbbott Yes, MCU Vcc is connected directly to the 3.6V battery(datasheet: cellpacksolutions.co.uk/wp-content/uploads/2015/06/…). I considered the option of powering the MCU through a LDO set to 3V but in the end I decided to feed it directly through the battery. Aug 18, 2017 at 14:37

If the MCU is powered directly from the battery then you don't need any external circuit, because the MSP430G2553's ADC has an internal voltage divider for reading Vcc.

Example code (from Fix It Until It's Broken):-

/** Reads the MSP430 supply voltage using the Analog to Digital Converter (ADC).
On ez430 boards, this is approx. 3600mV
@return Vcc supply voltage, in millivolts
*/
unsigned int getVcc3()
{
ADC10CTL0 = SREF_1 + REFON + REF2_5V + ADC10ON + ADC10SHT_3;  // use internal ref, turn on 2.5V ref, set samp time = 64 cycles
delayMs(1);                                     // Allow internal reference to stabilize
unsigned long temp = (ADC10MEM * 5000l);        // Convert raw ADC value to millivolts
return ((unsigned int) (temp / 1024l));
}

• +1 - I'm not sure of the accuracy of that built-in voltage divider on ADC10 channel 11 (the datasheet seems to state only a typical value, not a range of variation between devices or range over temperature), but it may suit the OP's purposes. Just to be clear, there seems to be a word missing in your answer and I'm not sure I can guess it correctly to edit for you - you said: "[...] you don't any external circuit [...]". Did you mean "[...] you don't need any external circuit [...]" or something else? Aug 18, 2017 at 19:30
• @SamGibson fixed (funny how when reading back a sentence you wrote, your brain 'fills in' missing words!) Aug 18, 2017 at 21:41
• @BruceAbbott Thank! This way saving area of the PCB, components and I have two more free pines of the MSP430G2553 Aug 24, 2017 at 8:55

I see two advantages to Circuit 2, but neither are critical here. As with many design questions it ultimately comes down to weighing benefits against the cost, both of which happen to be minor in this case.

1. When PIN_CONTROL is inactive, the ADC pin sees a high impedance in Circuit 2, whereas in Circuit 1 the ADC pin sees an undivided 3.6 V. If your ADC were actually running at 2.5V that might cause issues, but in this case it's just a 2.5Vref and the MSP430 can accept VCC + 0.3V on any of its input pins. So we don't really care about that here.
2. If you were concerned about leakage current at the ADC input, Circuit 2 would prevent it from continuously drawing from the battery. I don't think the MSP430 ADC is well-characterized but I did find this forum post on the TI forum that quotes it at 50 nA static leakage current:

Input impedance of ADC in MSP430F5438

• I second this. First, I believe making a robust design across components (i.e. changing from an MSP430 to some other manufacturer whose microcontroller cannot handle the extra ADC voltage) is always good practice. And second, if you can afford an extra resistor in your circuit, might as well reduce the current consumption by a smidgen. Aug 16, 2017 at 19:23
• @calcium3000 Where would you put that resistance? Sorry if it's a silly question, I'm just starting out in electronic design. Thank you. Aug 16, 2017 at 19:46
• @FranMartin I was just speaking (typing?) of the extra resistor in circuit 2 compared with circuit 1. I also forgot to mention the extra MOSFET. Aug 16, 2017 at 19:49