Thursday, 30 March 2017

batteries - Use GPIO to disable voltage divider



I'm using a voltage divider to read the battery level of a wireless sensor platform using STM32L151. I'm shooting to use 20k for R1 and 10k for R2, to be under the 50k limit of the MCU's ADC peripheral.


How do I calculate the current wasted by the divider?


Originally, I was planning on using a P-channel MOSFET to enable the divider when taking measurements to reduce power consumption, but I see that MOSFETs have leakage current and raise the part count.


Can I just set the GPIO to push-pull as the ground for the divider and set it low when I want to measure and high when I don't?



Answer



First thing - if the ADC is okay with 50K you can use 150K and 75.0K (the source impedance will be exactly 50K).


The current used by the divider will be 4.3V/225K = 19.1uA.


Unlike most micros, I think you can actually lift the lower end of the divider and reduce the current, if you pick a 5V-tolerant input that is shared with the ADC and use another 5V-tolerant pin for the divider control. At least that is what it looks like to me. You would set the control pin to low/output for divider operation and have the ADC input active. To disable set both pins to digital inputs.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...