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

Mosfet 1: http://www.onsemi.com/pub/Collateral/2N7002L-D.PDF

Mosfet 2: http://www.onsemi.com/pub/Collateral/BSS138-D.pdf

Mosfet 3: https://www.infineon.com/dgdl/Infineon-BSS84P-DS-v02_07-en.pdf?fileId=db3a304330f68606013118ac7a9b4549

Best regards,

Fran Martin

  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Andy aka
    Aug 16, 2017 at 17:16
  • \$\begingroup\$ @Andyaka Thanks! Yes, the MCU is powered direcly from the battery. What problems are there in leakage currents through the divider resistors? \$\endgroup\$
    – FranMartin
    Aug 16, 2017 at 17:28
  • \$\begingroup\$ By 'directly' do you mean MCU Vcc is connected directly to the battery? If not, please show the power supply circuit. \$\endgroup\$ Aug 16, 2017 at 19:37
  • \$\begingroup\$ @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. \$\endgroup\$
    – FranMartin
    Aug 18, 2017 at 14:37

2 Answers 2


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.

enter image description here

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
ADC10CTL1 = INCH_11;                        
delayMs(1);                                     // Allow internal reference to stabilize
ADC10CTL0 |= ENC + ADC10SC;                     // Enable conversions
while (!(ADC10CTL0 & ADC10IFG));                // Conversion done?
unsigned long temp = (ADC10MEM * 5000l);        // Convert raw ADC value to millivolts
return ((unsigned int) (temp / 1024l));
  • \$\begingroup\$ +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? \$\endgroup\$
    – SamGibson
    Aug 18, 2017 at 19:30
  • 1
    \$\begingroup\$ @SamGibson fixed (funny how when reading back a sentence you wrote, your brain 'fills in' missing words!) \$\endgroup\$ Aug 18, 2017 at 21:41
  • \$\begingroup\$ @BruceAbbott Thank! This way saving area of the PCB, components and I have two more free pines of the MSP430G2553 \$\endgroup\$
    – FranMartin
    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

  • \$\begingroup\$ 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. \$\endgroup\$ Aug 16, 2017 at 19:23
  • \$\begingroup\$ @calcium3000 Where would you put that resistance? Sorry if it's a silly question, I'm just starting out in electronic design. Thank you. \$\endgroup\$
    – FranMartin
    Aug 16, 2017 at 19:46
  • \$\begingroup\$ @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. \$\endgroup\$ Aug 16, 2017 at 19:49

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.