bitluni / WeatherStation

25 stars 8 forks source link

Voltage measuring not working #2

Closed ghost closed 1 year ago

ghost commented 6 years ago

Hi! How do I measure the voltage of the ESP? Do I need to conect a voltage divider to A0? I have uncommented the //#define PUBLISH_VOLTAGE in the code but it constantly shows 3,55V.

BavarianBarbarian1 commented 6 years ago

I did it by adding a 100k resistor. Works fine with a 18650 Li-Ion battery to calculate the voltage, 1V equals the input value of 1023. See https://arduinodiy.wordpress.com/2016/12/25/monitoring-lipo-battery-voltage-with-wemos-d1-minibattery-shield-and-thingspeak/ for more information!

ghost commented 6 years ago

@BavarianBarbarian1 sounds promising. Gonna try that out asap.

DPR7 commented 6 years ago

Another solutions starts with ; // ADC setup float bat = 0; float sens = 0; float volt = 1; ADC_MODE(ADC_VCC);