Measuring Battery Life
-
- Posts: 195
- Joined: Sat Apr 01, 2017 1:21 am
- Contact:
Measuring Battery Life
Postby AgentSmithers » Mon Jul 23, 2018 8:44 am
The batter will be connected to pin 3v3 and gnd.
https://wiki.wemos.cc/products:retired: ... pro_v1.1.0
Thanks!
-Agent
-
- Posts: 195
- Joined: Sat Apr 01, 2017 1:21 am
- Contact:
Re: Measuring Battery Life
Postby blubb » Wed Aug 01, 2018 8:37 pm
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)
-
- Posts: 195
- Joined: Sat Apr 01, 2017 1:21 am
- Contact:
Re: Measuring Battery Life
Postby AgentSmithers » Thu Aug 02, 2018 12:18 am
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?
Re: Measuring Battery Life
Postby blubb » Thu Aug 02, 2018 12:26 am
-
- Posts: 195
- Joined: Sat Apr 01, 2017 1:21 am
- Contact:
Re: Measuring Battery Life
Postby AgentSmithers » Thu Aug 02, 2018 12:46 am
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?
-
- Posts: 195
- Joined: Sat Apr 01, 2017 1:21 am
- Contact:
Re: Measuring Battery Life
Postby AgentSmithers » Wed Aug 08, 2018 2:52 am
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!! =)
Who is online
Users browsing this forum: No registered users and 288 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.