Hi everyone! I am trying to get result of max471 voltage sensor with D1. I looked for library but couldn’t find one. Compiled with arduino and it is working.
This sketch works on d1 mini and compiles, but gives false result.
The other margin of error that is probably creeping in is that the AO port can only read up to 3.2V, not 3.3V, on the D1’s.
A poor decision on the resistors they picked when boosting the 1V native maximum on an ESP AO pin to the WeMos operating voltage of 3.3V. When I asked them about the poor decision they said they simply copied the resistors from the NodeMCU layout, classic.
So perhaps use 3.2 and 5 but then also a calibrating factor of something like * 0.92
regarding the voltage measurement, i usually use a 1 mega ohm trimpot, like this. the viper is hooked up to the analog pin, the other 2 are vcc and gnd. then i can calibrate easily until in serial monitor shows exactly 1023, when maximum voltage is applied.
(first of course i set a target voltage around 2 volts, with the multimeter hooked up to viper, not the mcu, to protect the analog pin)
my shopping experience unfortunately shows that you do not get faster from ebay, because 99% of ebay sellers are from china
i usually buy from aliexpress. they have this at 1.09 usd
I was connecting them wrong now I got almost same value as multimeter. I disconnected VIN pin from D1 mini.
there is one problem though, I can’t get update only when I hard reset the esp.
int battery = map(analogRead(A0), 0, 1023, 0, VOLTAGEMAX); // is defined in millivolts
if (battery != oldBattery) {
Blynk.virtualWrite(BATTERY, analogRead(A0)); //or, to get millivolts: battery);
oldBattery = battery;
}