Page 1 of 1

optimyze deep sleep with PCF8591

Posted: 09 Feb 2020, 06:50
by rudloffl
Hello all,

I'm working on a project I called "growinator" (esp + PCF8591 with 4 soil moisture sensors) :D

I will use the deep-sleep model, but I noticed that when in sleep mode, the LED on the PDF8591 is still on (therefore draining the battery).
I'm looking for a solution, but I need your input to take the right decision/solution:
- Maybe it's fine and I don't need to over-think that ! Tests are in progress
- I could use a ESP GPIO to power the PCF8591 (can the GPIO support that ? Will the I2C be detected properly ? Do I need moffset ? Is a level shifter OK ?)
- Is there a solution I'm missing ?

Any idea what would be best ?


Re: optimyze deep sleep with PCF8591

Posted: 09 Feb 2020, 13:56
by Ath
Ask yourself if the LED is needed for anything (monitoring activity and such), and if it's redundant, remove it by either soldering it off, or cutting it from the circuitboard with a boxcutter... (I usually do that for the ESP01 boards I have)

Re: optimyze deep sleep with PCF8591

Posted: 09 Feb 2020, 17:50
by rudloffl
I agree with your idea, but I was looking for something more elegant.

The led is only draining mildly the battery, I would like to make sure there is not something more consuming running in the background (and is most likely consuming much more than the led).

My project was up and running all night in deep sleep mode (250 sec on and 10 sec sleep to work the battery) and i lost less than 10% battery ( will run with a solar panel in the future).

I will try something with a level shifter to have the i2c running on 5 volts, and pilot the i2c vin with a gpio (that I will put high on boot). I will keep you informed.

Re: optimyze deep sleep with PCF8591

Posted: 09 Feb 2020, 18:14
by Shardan
Ooops.. double post, sorry.

Re: optimyze deep sleep with PCF8591

Posted: 09 Feb 2020, 18:38
by Shardan
Using a GPIO to switch on/of the PCF might not work.

The PCF8591 uses the I²C-interface.
I²C runs an initialization process when the ESP boots up.
This init process might run before you can start up the PCF via GPIO.
So initializing I²C will not find the PCF in this case.

Just an Idea I had when reading this:
A solution might be using an external watchdog timer like a TPL5010
together with a controllable (enable/disable) voltage regulator.
The TPL5010 sends a "WAKE" pulse every n seconds, usually to a CPU.
This could set a simple FlipFlop to switch the voltage regulator on.
When measuring is done, a GPIO pulse resets the FlipFlop, voltage
regulator goes back to standby.
FlipFlop might be bulit with a CD4001 cmos logig gate circuit,
the quiescent current is below 1µa @5V. The TPL5010 takes 0,05µA.

Re: optimyze deep sleep with PCF8591

Posted: 11 Feb 2020, 06:29
by rudloffl
I like the idea, but it's way beyond my skills ! Thanks for your input.

Would use a GPIO "high on boot" such as SD2 or SD3 help me in your mind? I will test and let you know ... /GPIO.html

Thanks again