ESP32c3, low speed i2c bus on batteryoperation (power management config?)

Dear Forum.
After emailing tech support I discovered this forum is highly active so try posting same question here :
When running the esp32c3 on batterypower the I2c bus goes very slow (1 second update) somewhere around 3,5-3,4v battery. As I understood the manual it should cope down to 2,8-2,9v battery voltage ??

I think Iam looking for information how to configure power management ? I have tested sleepmodes/wakeup as I suspected it went into light sleep and tested several i2c bus config but no change. Iam running 3xAAA nimh batteries as lipo is not allowed in EX environment and seems working fine with charging via usb C port, I will look into amperege capacity at low voltage on nimh batteries but not there yet. Perhaps it is cpu clock speed throttling due to battery voltage and if so I hope this can be configured ? The i2c bus speed goes back to full speed after usb c charging (somewhere around 3,6volts and higher batteryvoltage).

Hopefully someone kicks me in the right direction where to look.

Hi dizzy,
FAIK, The SCL is derived from the core system clk. So that is a thing and the transmission rate can reach 100kbit/s in standard mode, 400kbit/s in fast mode, and 3.4Mbit/s in high-speed mode for I2c
This link may help get a little closer but others will also comment. https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/system/power_management.html

API level , but can be done.
Also the Hardware reference speaks to it as well

By default, ESP32-C3 first enters the Active mode after system resets, then enters different low-power modes
(including Modem-sleep, Light-sleep, and Deep-sleep) to save power after the CPU stalls for a specific time (For example, when CPU is waiting to be wakened up by an external event). From modes Active to Deep-sleep, the Number of available functionalities 1 and power consumption2 decreases and wakeup latency increases. Also,
the supported wakeup sources for different power modes are different3. Users can choose a power mode based on their requirements of functionality, power consumption, wakeup latency, and available wakeup sources

HTH
GL :slight_smile: PJ

1 Like

i dont know much, but maybe add a capacitor on the power,
how are you measuring the voltage? is it browning out?
going low when power is demanded

this link is not the answer, but may help

PS what is the IIC device connected?

Also, as always, check out

and/or

1 Like

Dear PJ_Glasso.
Thank you for link, I have been browsing this section on my own and hope to bounce a thought with you : I have not yet implemented sleep modes but when thinking for two seconds thanks to your post there is probably sleep mode functions depending to incoming voltage in core code. When voltage starts fluctuating maybe these functions is activated lowering cpu clock speed (which controls i2c bus speed) ?

The setup here is a grove 3axis gyro LIS3DHTR together with the oled display ssd1315 on i2c bus and our own sensors(analog) on gpio. It works surprisingly well but I have to cleanup these minor features.

Sooo…the display eats amperes and when batterypack goes down in the lower end I see in the logs voltage spiking down to 3,2volts at 3,5volts rms and perhaps this activates “automated sleep functions/power saving” in cpu core code ? I see on the wifi link that none of the modem-sleep/light sleep is active as the wifi link is updated continuously (RF circuits is on). Is there a way to access these “core functions” as it is a riscV cpu (hacking cpu code would be so awesome, never done that) ?

Please be patient and correct me if Im thinking wrong again =0)

(Im starting to learn nimh battery discharge curve, they seem a bit weak compared to lipo at low level voltage. I fully understand nimh is not recommended for the ESP32c3 board but other factors decided battery type for me).

Dear cgwaltney.
I think you are perfectly right. The voltage spikes down to 3,2 volts I see in the log should be possible to fix with capacitors as you suggest. Thank you very much for the links sharing valuable concrete knowledge with 0,22uF and 0,1uF capacitors =0)

I hope to remember reporting back here after I tested for a longer time. Please be patient, Im double as stupid than I look =0)

I Yes the problem with non lithium battery is it does not have as strong a current delivery but
the drawback is you cannot let it drop below minimum voltage limit or perminent damage may be done

lithium usually requires some sort of charge controller to ensure this, which is good and bad

I am not necessarily recomending this product, just an example

as for power you may want to connect an additional “power bus” to the sensors, in other words additional pathways from the battery positive and negitive to the sensors power lines this may help to prevent the microcontroller from browning out additional pathways would result in less resistance and less voltage drop… also remember not only does the power need to go out, but it also has to have a return pathway, so ground or negitive is as important as positive

i have not tested current on OLED but i do know on my projects OLED and IIC devices are power hungry

you may test to reduce polling and update frequency of IIC and OLED are you using U8G2 OLED library

may check out

setPowerSave

updateDisplay

updateDisplayArea

there are ways to structure your code to limit the amout of updates to the display needed and to only update portions of the screen to minimize computationl power

anyway good luck and keep us posted if you have progress and findings

I would ask if all the devices are the same speed capable, may be the slowest device leaves it in the lower clock speed without some system code intervention or device reset or system reset?
Have you tried the switching the display off after idle time? is it always displaying the sensor output? There are modes where the radio is ON while low power but not supported in the Seeed libraries, but in the Nordic SDK. FYI.
HTH
GL :slight_smile: PJ