A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By amadeuspzs
#92379 Thanks for the clarification. I had some time to update the schematic:

  • Removed mosfet for Si7021
  • Reduced resistor values for the potential divider
  • Added a 1K resistor between GPIO16 and RST
  • Added a 0.01uF cap between ADC and GND

Image

I also simplified voltage conversion:

Code: Select all// Ideal ADC and voltage divider behaviour
// is 4.2/1024.0
// For accurate battery voltage measurements
// use an accurate voltage input, measure ADC
// and replace values below (assumes linear response)
#define vbatt_calibration 4.2/1024.0

// switch on ADC circuit
digitalWrite(adcPowerPin, LOW); // inverted

// first adc reading is garbage, so take another
int adc = analogRead(A0);
adc = analogRead(A0);   

// switch off ADC circuit
digitalWrite(adcPowerPin, HIGH); // inverted

float vbatt = vbatt_calibration * float(adc);


A single calibration per board is fairly linear as far as initial tests go.

I have PCBs arriving soon so will do more testing.
User avatar
By davydnorris
#92382 I use an INA219 or more recently an INA226 for my battery voltage and current measurements and it works a lot better than the ADC.

I have also switched all my sensors over to 2.8 or 1.8 volt versions, and run my ESP at 2.8V with a high efficiency buck converter instead of an LDO - I've found this works better with battery power, especially when the battery is new and the voltage is high. An LDO converts all that voltage difference into heat and burns through the early stages of the battery fast, whereas an buck converter doesn't.

I initially used a buck/boost but found that when you get down to the point the boost kicked in, the battery was depleted and it just drew more current to make up the voltage, burning down the last of the battery, so it was a waste of components for very little benefit in the end. Moving everything to 2.8 volts gave me much more.
User avatar
By Pablo2048
#92383 Do you have any efficiency and EMI measurements of your buck converter in whole range of loads? I didn't see any type of converter with efficiency > 70% overall in range of 100uA-500mA. They are way worse actually and produce large EMI. LDO in such case was better (at least according to my measurements...).
User avatar
By jankop
#92387
davydnorris wrote:I have also switched all my sensors over to 2.8 or 1.8 volt versions, and run my ESP at 2.8V with a high efficiency buck converter instead of an LDO

I have experienced that the ESP8266 does not work reliably at voltages lower than 3V.