ESP32 and CR2032 battery

andrew_p
Posts: 30
Joined: Sun Jan 01, 2017 5:37 pm

ESP32 and CR2032 battery

Postby andrew_p » Sun Jan 15, 2017 11:10 pm

My understanding is that ESP32 should be able to run on CR2032, but I have no success with that. Trying a simple hello_world example works fine with an external 3v power source, but switching to battery a throws the following error:

Code: Select all

I (65) boot: Partition Table:
I (71) boot: ## Label            Usage          Type ST Offset   Length
I (82) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (93) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (104) boot:  2 factory          factory app      00 00 00010000 00100000
I (116) boot: End of partition table
I (122) boot: Loading app partition at offset 00010000
I (558) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512)
I (559) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x05b20 ( 23328) map
I (567) boot: segment 2: paddr=0x00025b30 vaddr=0x3ffb3140 size=0x02364 (  9060) load
I (583) boot: segment 3: paddr=0x00027e9c vaddr=0x40080000 size=0x00400 (  1024) load
I (593) boot: segment 4: paddr=0x000282a4 vaddr=0x40080400 size=0x13814 ( 79892) load
I (644) boot: segment 5: paddr=0x0003bac0 vaddr=0x400c0000 size=0x00000 (     0) load
I (645) boot: segment 6: paddr=0x0003bac8 vaddr=0x00000000 size=0x04540 ( 17728)
I (652) boot: segment 7: paddr=0x00040010 vaddr=0x400d0018 size=0x20a60 (133728) map
I (665) boot: segment 8: paddr=0x00060a78 vaddr=0x50000000 size=0x00008 (     8) load
I (679) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (689) heap_alloc_caps: At 3FFB54A4 len 0002AB5C (170 KiB): DRAM
I (699) heap_alloc_caps: At 3FFE8000 len 00018000 (96 KiB): D/IRAM
I (710) heap_alloc_caps: At 40093C14 len 0000C3EC (48 KiB): IRAM
I (720) cpu_start: Pro cpu up.
I (726) cpu_start: Starting app cpu, entry point is 0x40080b10
I (0) cpu_start: App cpu up.
I (741) cpu_start: Pro cpu start user code
Guru Meditation Error of type IllegalInstruction occurred on core  0. Exception was unhandled.
Register dump:
PC      : 0x400eb0e0  PS      : 0x00060f30  A0      : 0x8008093a  A1      : 0x3ffe3c10
A2      : 0x00000000  A3      : 0x0c00001c  A4      : 0x3ffe3b7f  A5      : 0x00000031
A6      : 0x00000000  A7      : 0x3ffe3b84  A8      : 0x800eb19a  A9      : 0x00000000
A10     : 0x00000027  A11     : 0x3f405000  A12     : 0x3ff480c8  A13     : 0x00000000
A14     : 0xffffffff  A15     : 0x2d580210  SAR     : 0x00000004  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0xffffffff

Backtrace: 0x400eb0e0:0x3ffe3c10 0x4008093a:0x3ffe3c30 0x40080ae3:0x3ffe3c60 0x40078365:0x3ffe3ca0 0x4007857c:0x3ffe3cd0 0x40078ab4:0x3ffe3d50 0x40080101:0x3ffe3e70 0x40007c34:0x3ffe3eb0 0x40000740:0x3ffe3f20

                                                                                   Rebooting...
ets Jun  8 2016 00:22:57

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
cmd len 2147483262
Falling back to built-in command interpreter.
OK
>ets Jun  8 2016 00:22:57

rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3ffc0008,len:4
load:0xffffffff,len:-1
and then the error reappears in the indefinite loop..

Do you guys have any experience with ESP32 running on a CR2032 or similar (small) battery?

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 and CR2032 battery

Postby ESP_Sprite » Mon Jan 16, 2017 1:24 am

The problem you're having is current supply (or actually: internal resistance), not voltage. For a random CR2032 (eg http://data.energizer.com/PDFs/cr2032.pdf), the typical Ir is mentioned as 10-40 ohm (10,000-40,000mOhm). You can look at the internal resistance as a resistance that is in series with an ideal voltage source. Now, when the ESP32 starts up, it can easily pull 300mA. Even in the best case (Ir=10 ohm) this would mean the internal resistance would eat up (U=I*R, 0.3A*10ohm=)3V of the available 3V. In other words, when the ESP32 starts up, it pulls so much current out of the poor CR2032 that the voltage drops entirely to zero, resetting/crashing the ESP32.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: ESP32 and CR2032 battery

Postby kolban » Mon Jan 16, 2017 1:36 am

If one wanted to use a CR2032 form factor battery, would it be possible to connect some number of them in parallel? If so, what would be the minimum number required in order to operate correctly?

If CR2032's are not able to be used, what then would be the qualities of acceptable batteries? Would the cheap 3.7V 550maH drone batteries be usable? (for example ... http://www.ebay.com/itm/4PCS-Syma-X5SW- ... 1925098453)
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 and CR2032 battery

Postby WiFive » Mon Jan 16, 2017 2:19 am

The default phy init is for partial rf calibration, right? Shouldn't it be possible to skip all RF calibration at the possible consequence of reduce RF performance (assuming there is stored cal data)? Battery capability in this mode should be testable by removing the external power after the device boots once and then enters deepsleep. Other considerations are to limit WiFi tx power or if the device is operating in ble mode only it should also significantly reduce power consumption. What else draws peak power (pll startup?) and are there any ways to reduce/limit that? So with the right settings (and maybe the help of a supercap?) it may work. This is why it would be nice to have a comprehensive power consumption study with data/graphs as I requested in document requests.

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32 and CR2032 battery

Postby ESP_igrr » Mon Jan 16, 2017 2:38 am

WiFive wrote:Shouldn't it be possible to skip all RF calibration at the possible consequence of reduce RF performance (assuming there is stored cal data)?
PHY init can be performed by the application itself — just uncheck CONFIG_ESP32_PHY_AUTO_INIT option ("Component config" -> "WiFi" -> "Initialize PHY in startup code"), and then do PHY initialization in app_main, selecting the desired RF calibration option (full | partial | none)
WiFive wrote:it would be nice to have a comprehensive power consumption study
Indeed, it would be :)

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 and CR2032 battery

Postby WiFive » Mon Jan 16, 2017 3:58 am

ESP_igrr wrote: just uncheck CONFIG_ESP32_PHY_AUTO_INIT option ("Component config" -> "WiFi" -> "Initialize PHY in startup code"), and then do PHY initialization in app_main, selecting the desired RF calibration option (full | partial | none)
OK, excellent. So what do we miss out on skipping partial cal? What is the main benefit: frequency compensation, antenna tune?

andrew_p
Posts: 30
Joined: Sun Jan 01, 2017 5:37 pm

Re: ESP32 and CR2032 battery

Postby andrew_p » Mon Jan 16, 2017 6:21 pm

I'm looking for a possible battery options for a simple prototype, which performs the following cycle:
1. Power is on
2. Connect to WiFi
3. Send email/HTTPS request
4. Turn itself off (cut the power)

Since CR2032 does not look like an option, what would be a good choice? And how many cycles (like 1-4 steps above) we can expect? I'm thinking about the following ones, but don't know what is a better choice?

- 3.2v 14500 600mAh / 800mAh / 1200 mAh [amazon]
- 3.7v 18650 5000mAh [amazon] - I'm actually not sure if ESP32 can handle 3.7v, but Sparkfan ESP32 Thing uses 3.7v 400mAh battery.

User avatar
rudi ;-)
Posts: 1731
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP32 and CR2032 battery

Postby rudi ;-) » Tue Jan 17, 2017 1:38 am

hi
not sure if you know about this youtube video "17 days on a coin cell esp8266" there was tested LIR2450, CR2032 and other in parallel mode too.
andreas spiess wrote to esp8266 wrote: If it transmits every 2 minutes, it ran 26 hours on a small LIR2450 button cell.
If it would transmit each hour, it would last for 17 days and on 2 AA batteries 425 days

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 and CR2032 battery

Postby ESP_Sprite » Tue Jan 17, 2017 1:44 am

I'd say: use a LiIon/LiPo and whack a low-quiescent-current 3.0V LDO after it to make sure the voltage doesn't get too high.

andrew_p
Posts: 30
Joined: Sun Jan 01, 2017 5:37 pm

Re: ESP32 and CR2032 battery

Postby andrew_p » Tue Jan 17, 2017 3:05 pm

rudi ;-) wrote: there was tested LIR2450, CR2032 and other in parallel mode too.
I'm looking at LIR2450, datasheet says max discharge current is about 200mAh, which may not be sufficient for ESP32 boot, according to ESP_Sprite post above

Who is online

Users browsing this forum: No registered users and 67 guests