# Determine average supply current of switching regulator in DCM (calculate dutycycle)

For a project, I need to calculate how many hours my battery powered device can operate. The device consists of a ESP32-WROOM-32D, display, reed-switch and switching regulator.

The device is powered by 4 AA batteries in series, which gives me 2800mAh at 6V.

The operating hours, are where the ESP32 is in deepsleep and using the ULP co-processor to count the pulses from the reed-switch. When this happens, the display is fully turned off. So it can be expelled from the operating hours calculation.

The ESP32 draws 0.1mA when the ULP is active during deepsleep at a duty cycle of 1%. Source, p31: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf

The switching regulator IC I use is the LM3578A by Texas instruments. Using this IC is a must given by my supervisor... This IC claims to have a power consumption of 2mA at output OFF and 14mA at output ON. Since the ESP32 only draws 0.1mA in deepsleep, the regulator will operate in Discontinues Conduction Mode (as I understand it).

Now this is where it gets tricky for me.

How do I know the duty cycle of this IC? When is it drawing 14mA and when 2mA? Without this data it is impossible to calculate the operating hours.

I've seen this calculation for calculating the duty cycle of a DCM switching regulator. But I do not fully understand it. Source: https://www.allaboutcircuits.com/technical-articles/discontinuous-conduction-mode-of-simple-converters/

If any clarification is needed, please let me know!

• I think the most difficult part is to know the efficiency of the converter is this operating mode. If your circuit regulates $V_{out}$ and you know the output current, then, having the efficiency on hand, you can have an idea of the input current. Efficiency in light-load conditions must be measured on a real converter, it is extremely difficult to predict correctly. Apr 30, 2021 at 16:37
• The startup losses are much larger as well as the external losses in the inductor DCR, NPN Vce/Ic and Schottky Vf@ Ipk P = 0.3 x IF(AV) + 0.090 IF2(RMS). So without budgeting all the losses, the info given was insufficient. Apr 30, 2021 at 18:36
• Why use a switching regulator that draws much more current than your load. That doesn't make any sense. May 1, 2021 at 9:49
• @andyaka The device I’m making can be powered from two sources. Batteries (6V) or a vehicle (12V). When using batteries, things like a display and an extra actuator are turned off or not there. So only the ESP is drawing current. When using the vehicle source, the display backlight and the actuatoe are on. Drawing 220mA of current. And I need to calculate the operating hours when using the battery source. Hope this explains it a bit more! May 1, 2021 at 10:14
• It still doesn't make any sense. May 1, 2021 at 10:23