ESP8266 Developer Zone The Official ESP8266 Forum 2018-08-08T18:51:28+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=11546 2018-08-08T18:51:28+08:00 2018-08-08T18:51:28+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11546&p=22625#p22625 <![CDATA[Re: Measuring Battery Life]]>
system_get_vdd33() * 1000L / 1024

Same result (because 1 << 10 == 2 ^ 10 == 1024)

Statistics: Posted by blubb — Wed Aug 08, 2018 6:51 pm


]]>
2018-08-08T02:52:05+08:00 2018-08-08T02:52:05+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11546&p=22614#p22614 <![CDATA[Re: Measuring Battery Life]]>
blubb wrote:
Why not just try it?

The 107th (0x6B) byte has to be 0xFF.
system_get_vdd33() returns the voltage in 1/1024 Volt.

So calculate system_get_vdd33() * 1000L >> 10 to get the battery voltage in mV.

It works here... (ESP-01)



Blubb,
How does your logic work
Do you take the value returned by vdd multiply it by 1000 then bitshift it over 10 bits?
I am unsure on how that will return the mV, Can you enlighten?
Thank you!! =)

Statistics: Posted by AgentSmithers — Wed Aug 08, 2018 2:52 am


]]>
2018-08-02T00:46:24+08:00 2018-08-02T00:46:24+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11546&p=22320#p22320 <![CDATA[Re: Measuring Battery Life]]>
blubb wrote:
system_get_vdd33() directly measures the supply voltage. No other pins are required for this. The SDK manual also says that TOUT pin needs to be suspended. I am using the very simple ESP-01 modules. I have no idea what they did to that pin, but it works just fine.


Gotcha, So TOUT for me I think is A0 on my board. Can't tell from the Schematic directly but I think that's the pin it is talking about. I just need to leave it floating.
So Basically I need to hook up my device via battery to 3.3 and GND then make sure my default.bin offset 107 is set to FF then run the command and see what I get.
Correct?

Statistics: Posted by AgentSmithers — Thu Aug 02, 2018 12:46 am


]]>
2018-08-02T00:26:45+08:00 2018-08-02T00:26:45+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11546&p=22314#p22314 <![CDATA[Re: Measuring Battery Life]]> Statistics: Posted by blubb — Thu Aug 02, 2018 12:26 am


]]>
2018-08-02T00:18:40+08:00 2018-08-02T00:18:40+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11546&p=22312#p22312 <![CDATA[Re: Measuring Battery Life]]>
blubb wrote:
Why not just try it?

The 107th (0x6B) byte has to be 0xFF.
system_get_vdd33() returns the voltage in 1/1024 Volt.

So calculate system_get_vdd33() * 1000L >> 10 to get the battery voltage in mV.

It works here... (ESP-01)


That's interesting. Do I need to put a voltage divider for this example? After reviewing the command it seems it pulls from
Pin 3/4 aka VDD3P3
https://wiki.wemos.cc/_media/products:d ... v1.1.0.pdf

This here above shows those are Pins GPIO 16 (D0) and 14(D5) . Do both these pins detect a voltage somehow or do I have to add a Voltage + to one and GND to another?

Statistics: Posted by AgentSmithers — Thu Aug 02, 2018 12:18 am


]]>
2018-08-01T20:37:54+08:00 2018-08-01T20:37:54+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11546&p=22307#p22307 <![CDATA[Re: Measuring Battery Life]]>
The 107th (0x6B) byte has to be 0xFF.
system_get_vdd33() returns the voltage in 1/1024 Volt.

So calculate system_get_vdd33() * 1000L >> 10 to get the battery voltage in mV.

It works here... (ESP-01)

Statistics: Posted by blubb — Wed Aug 01, 2018 8:37 pm


]]>
2018-07-31T00:06:27+08:00 2018-07-31T00:06:27+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11546&p=22271#p22271 <![CDATA[Re: Measuring Battery Life]]> Thank you!

Statistics: Posted by AgentSmithers — Tue Jul 31, 2018 12:06 am


]]>
2018-07-23T08:44:49+08:00 2018-07-23T08:44:49+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11546&p=22176#p22176 <![CDATA[Measuring Battery Life]]> The batter will be connected to pin 3v3 and gnd.
https://wiki.wemos.cc/products:retired: ... pro_v1.1.0
Thanks!
-Agent

Statistics: Posted by AgentSmithers — Mon Jul 23, 2018 8:44 am


]]>