The idea to create this module came a few months ago while I was working with the OV2640 (ESP Camera). Keeping in mind that it can be used with an MCU and that the image quality is decent for some scenarios, it could be considered a good option. However, the main problem I faced was the idle consumption. The sensor has a low-power mode, but for a battery life of one year, it wasn't enough.

So, relays came to mind, which is obviously not a great solution, but that is more or less where the idea originated. Something that allows the device to stay in sleep mode most of the time and wake up periodically, enabling the use of more power-hungry devices for months or even years.

But before continue I'll give you some juicy info to judge by yourself if this is interesting or not:

734.000 times less idle consumption!

Demo note at the bottom.

Sleep modePowerTimer

But less continue with design.

The idea is as follows: 

The latch provides energy to the MCU, sensors, and modules. We do some processing; once it's done, we program the RTC and raise the DONE signal. When the RTC alarm triggers, it sets a high level to the SET pin and starts the cycle again. On the other hand, if we have an external module, we could have asynchronous wakeups based on specific conditions.

The architecture is the following:

LATCH R/S:

This is a standard R/S LATCH but with a couple of modifications, though nothing serious. First, here is a definition:

An R/S latch is a fundamental building block in digital electronics that uses feedback to hold a stable state. When the S (set) input is activated, the output Q becomes 1. When the R (reset) input is activated, Q becomes 0. When both inputs are inactive, the latch keeps its previous state. Certain input combinations (depending on implementation) may be considered invalid.

So, in summary, it is like a switch with two buttons: one allows the energy flow and the other cuts it.
Regarding the modifications or relevant parts, I would highlight the first one:
I've used an AO3401A P-Channel MOSFET. It might be a bit oversized, with up to 30V VDS and a max current of 4A, but it is quite cheap. I've split the tracks on the DRAIN and SOURCE to improve heat management. Regardless, I've tested it with a load of 1A, and it looks safe to use.

The final modification is at the SET input; I've added another MOSFET to work as a switch. This way, if we have a high level at the RESET signal, it won't allow both to be active at the same time, preventing an uncertain state caused by both signals being high.

RTC:

This component's primary purpose is to produce periodic or programmed interruptions to wake up the system by raising a signal on the SET pin.
I've chosen the RV-3028-C7. The most relevant features are the following:

Ultra-low power consumption in working mode: around 45 nA!

Wide voltage range, from 1.1V to 5V. This range defines the module's voltage range, but I think it's a useful range for most scenarios.

Timer, Alarm, and external interruptions. These options are independent, so you can use all of them at the same time. The only thing to keep in mind is that once an interrupt is raised, we use the same signal and need to check via software which interrupt was active.

I2C interface.

RV-3028-C7 Datasheet

OR Gate:

This is a custom OR gate made with diodes to avoid the power consumption of a specific IC. Since there is no potential difference between the inputs, if all inputs are at a high level, we will have 3.3V minus the diode voltage drop.
Regarding the diodes themselves, I selected a high-speed diode (LL4148). I thought it would help improve the wakeup speed, but it doesn't change anything, and they are more expensive, so it's not a great solution.
A final point to mention is the RTC interrupt. The interrupt pin of the RTC is open-drain (open-collector), and goes to a low level when active. Therefore, we need to apply a high level with a pull-up resistor to create a voltage difference. We also need to "invert" the signal, so I've used a P-Channel MOSFET that is OFF when there's a high level at the gate and ON when there's a low level.

Software:

To manage this module, I've created an Arduino Library with some examples. Basically, this library consists of two different parts:

RTC:
Despite being a simple RTC, the management of this component is quite complex. To speed up the development, I've used an existing library (constiko RV-3028-C7 Library) and made some modifications to simplify its usage.

Most features work, but there is an issue with the timer functionality. When checking the signal, the interrupt is raised, but it doesn't pull the voltage down enough to trigger the SET pin, so the power doesn't turn on. Apart from that, everything is working so far.

Done singal:
This is a simple digital signal that sets a high level to trigger the RESET pin and cut the power to the device itself.

Arduino Library

Conclusion:

I believe this module is an interesting option for periodic scenarios, such as environmental sensors, infrastructure photography, or security systems in isolated locations. As shown in the PowerProfiler captures and the video, the reduction in power consumption is massive, resulting in a huge jump in battery life for the same circuit—going from less than one day to nearly a year.

However, there are some potential drawbacks. I've noticed the wakeup speed is a bit slow; I can't provide an exact number yet, but it is noticeable. Additionally, in asynchronous scenarios with high-frequency wakeups, it's not ideal because a collision between the RESET and SET signals could occur, causing the device to hang.

Note:

Video Demo

The demo can be see at the video (Future upload). For both scenarios is basically the same code, but at compilation time, base on each uncommented flag, we compiled the powerTimer specific library and their calls or we use the native ESP32 Sleep calls.

  1. But the logic is basically the same:
  2. Create the GUI with LVGL.
  3. Get sensor measurements.
  4. Show the GUI with the measurements.
  5. Wait 5 seconds to show the numbers.
  6. Going to sleep.