Hello,
I have a project which uses a small battery. (Panasonic-BSG CR-2477/HFN) This is a 3V0 1000mAH Lithium with a max discharge of 200mA. In this project is a EPS32 which when power applied the WiFi radio comes on and becomes a AP and has a little web page. Everything works off the bench power supply but when we connect the battery the ESP32 will not start. We verified this with the bench supply by limiting the current to 200mA, but will start when the current limit is set to 420mA. When I look at what the power draw should be it is less than the 200mA of the battery. We are using the Arduino environment. So a few questions
Has anyone else seen and be able fix this issue?
It seems that the startup is higher than the 200mA so how can I adjust the WiFi power output?
How can I adjust the clock frequency and turn off the second processor in Arduino? I would like to try to reduce any overhead current.
How can the brownout detector be adjusted in Arduino?
I haven’t use bluetooth before. What is the power draw for BLE?
Everytime I look at using BLE it seems very overwhelming how can you use it just to connect send a small packet of data then turn off?
I guess the overall question would be why is the ESP32 requiring so much startup power and how to I handle it so I can use the only battery which fits the physical restraints of this project.
Many thanks in advance.
Rob
Hi Rob,
Does the battery only output 3.0V? I think that’s the problem, because that’s not enough… The ESP32 needs at least 3.3V in the 3.3V pin or 5V in the Vin pin.
A constant Wi-Fi connection or AP is not suitable to run on batteries, your project with a 1000mAH battery will only last 1 or 2 hours…
P.S. I’m currently working on a Project for the “Learn ESP32 with Arduino IDE” course that will show how to power the ESP32 with LiPo/Li-Ion batteries. That project will be published in 1 or 2 weeks…
Hi Rui,
Thank you for the relpy. I think I should have given more information. I am using a VWROOM module on a custom board which has a ACC and temp. This sensor sleeps almost all of the time, only waking on an event. When an event happens the ESP32 connects to WiFi sends a small packet then goes back to sleep. The AP mode is only to see the MAC address so it can be recorded and entered to a receiving module then the AP mode is turned off. When I look at the datasheet the EPS32 can go down to 2.2V, so the 3V0 battery (fresh 3V2) should be fine. (the data sheet also has different voltages throughout. 2V2, 2V3, 2V8).
There seems to be another problem. We set the power supply to 3V0 and we are only able to run it if the current is set over 400mA, but set the current any lower then we have issues. If I turn the WiFi off the ESP32 runs and everything works on serial, turn it on then the current goes past what the battery can handle (200mA) and the voltage drops and then the ESP32 resets and does it all over again until the battery is dead.
At this point it seems that there is a current spike when turning on the WiFi but when you look at the data sheet max power is 225mA for WiFi. If the WiFi output power is lowered and the CPU frequency is lowered then it might work on the battery selected (only battery which will fit). But why is there such a large current draw. (I still need to connect a scope up to see exactly when it is happening)
I also looked at the data sheet and I don’t see a Bluetooth current spec. Bluetooth LE is another option we can use and should use. At the time, WiFi seemed simpler to use. The receiving end is another device which has a ESP32 and will relay the sensor packet on WiFi. So both modules could be setup for Bluetooth. I don’t see an issue with the other module due to the fact that is had 500mA LDO and is connected to power wall adaptor.
Out of the many issues I have, at this point I need to reduce power so it can work with the battery as a test. When using the arduino environment I don’t know how to adjust the WiFi power output or adjust the clock frequency. All the information I see is when using the Espressif environment.
Any help would be appreciated.
I look forward to your updated course. I still need to find time to go through your other courses. I am very interested in the LoRa course but with multiple nodes and one gateway.
thanks
Hi Rob, I’ve experienced the exact same problem. With the ESP32 and using Wi-Fi, I also get those current spikes of 200mA… 300mA up to 400mA every time…
I think the datasheet is simply wrong or it depends on the actual chip that you are using… Lowering the frequency should definitely help, but I don’t think there’s any easy way of doing that with the Arduino IDE (you would need to re-compile the libraries): https://github.com/espressif/arduino-esp32/issues/1286
These chips are poorly documented and with frequent errors, I think only testing will give you the real results for power consumption… BLE would definitely help saving power.
For a short moment doing a BLE server demo test looked promising.
At this point it looks like I will have to abandon the ESP32 for this part of the project.
I have images for the WiFi and BLE currents and both have the spikes. The WiFi is quite large compared to the BLE. BLE was looking good but when connected to the target battery the voltage dropped (due to insufficient current) and the brownout kept hitting the reset. If I could adjust the brownout it might work, but I don’t know how to adjust it in Arduino. When the testing was done with a Lipo battery and LDO the ESP32 would run. The Lipo has a larger instant draw current than the little battery which I need to use.
Thank you for the link. I gave it a try and now I just get errors.
—————————–
Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: “SparkFun ESP32 Thing, 80MHz, 921600”
Build options changed, rebuilding all
Archiving built core (caching) in: C:\Users\rob\AppData\Local\Temp\arduino_cache_468224\core\core_espressif_esp32_esp32thing_FlashFreq_80,UploadSpeed_921600_e69a1cd0b73574ac238175625f31854a.a
D:\Users\rob\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libesp32.a(panic.o):(.literal.commonErrorHandler_dump+0x30): undefined reference to `xPortInterruptedFromISRContext’
D:\Users\rob\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libesp32.a(panic.o): In function `commonErrorHandler_dump’:
/home/larryb/esp32/esp-idf/components/esp32/./panic.c:648: undefined reference to `xPortInterruptedFromISRContext’
D:\Users\rob\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libesp32.a(phy_init.o):(.literal.esp_phy_rf_init+0x20): undefined reference to `coex_preference_set’
D:\Users\rob\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libesp32.a(phy_init.o):(.literal.esp_phy_rf_init+0x24): undefined reference to `coex_resume’
D:\Users\rob\Documents\Arduino\hardware\espressif\esp32/tools/sdk/lib\libesp32.a(phy_init.o): In function `esp_phy_rf_init’:
/home/larryb/esp32/esp-idf/components/esp32/./phy_init.c:385: undefined reference to `coex_preference_set’
/home/larryb/esp32/esp-idf/components/esp32/./phy_init.c:385: undefined reference to `coex_resume’
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for “BLEDevice.h”
Used: D:\Users\rob\Documents\Arduino\libraries\ESP32_BLE_Arduino
Not used: D:\Users\rob\Documents\Arduino\hardware\espressif\esp32\libraries\BLE
Not used: D:\Users\rob\Documents\Arduino\hardware\espressif\esp32\libraries\BLE
Not used: D:\Users\rob\Documents\Arduino\hardware\espressif\esp32\libraries\BLE
Not used: D:\Users\rob\Documents\Arduino\hardware\espressif\esp32\libraries\BLE
exit status 1
Error compiling for board SparkFun ESP32 Thing.
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
—————————–
In your Arduino IDE, you need to go to File -> Preferences and enable the “Show verbose output during compilation” option to print more details about the error that it’s giving. In order to lower the ESP32 frequency, you need to re-compile the ESP32 add-on. It doesn’t work by simply changing the settings during upload.
Have you considered using LoRa in your project? It’s lower power and it very likely that the current spike won’t go above 70mA from my tests (but it depends on the sensors that you’re also going to use).
Thank you, I will look at what you suggested.
LoRa would be a good radio but over kill. Maybe the nFR24 would fit better. This sensor’s range is only about 50ft plus some attenuation for being in a little bit of water. For the most part the issue is size and costs. The size I have is not much larger than the ESP32 and the height is the battery thickness plus the PCB. I can’t even get a 350mA Lipo to fit due to the length. I am thinking that the CC2540 might be the only solution. It is small enough and will run on the battery which will fit. One big issue I have is firmware development is not my strong area right now so starting another processor is not what I am looking forward to.
Thank you for the suggestions.