1 Reply Latest reply on Jun 3, 2020 4:38 AM by LePo_1062026

    Get Battery level using ADC

    Neeraj Dhekale

      Hello,

      I want to confirm whether it is the right way forward to do so. I will be using a CR2032 coin cell or 3.7V 500mAh (regulator AMS1117 3.3) battery. I have given terminal of a battery to P3[5] pin directly without using any resistor and I am getting the correct value for battery voltage. My anxiety is that whether this method is correct or not? it should not be like it will consume more battery than usual due to this connection.

       

        • 1. Re: Get Battery level using ADC
          LePo_1062026

          NeDh,

           

          The SAR input resistance is 2.2K ohms.   This means when the SAR is sequencing to Battery input, it will draw about 3/2.2K = 1.4mA when sampling this input.   Therefore, minimize when this input is read.

           

          You have the VDDA as your reference source.  I'm assuming that Battery is the source of VDDA.  This means that your ADC measurement will be at or near the maximum ADC count.  This is because the input is a ratio of your Vref.  Since VDDA = Battery then (input/VDDA)*((1<<12)-1) = (Battery/Battery)*(4095) = 4095.

          To avoid this, use a Bandgap Vref as your reference.  This will be mostly immune to changes in VDDA.

           

          There is a Low Voltage Detect (LVD) circuit in the PSoC.  This circuit is basically a comparator with a selectable voltage threshold.  It is intended to quickly (because it is constantly on) detect if VDDD drops below the set threshold.  The result can be polled or an interrupt can be launched if VDDD drops below the selected threshold.

           

          This circuit is constantly ON and the input resistance is ~1M ohms or higher.   Will the LVD work better for you?

           

          Len