Measuring the capacity of the accumulator

Hello everyone, how can I measure the battery capacity and guess how much it will last?
For example, a project with Esp8266 and pir-sb 312. Finger batteries 1.5 V - 3x. I'm new to this field, please teach me. Thank you!

I suggest you look at simil;ar projects on this forum.

That's not what I wanted to know. I need a formula with which to guess the time. Thanks

What's the mAh of the battery?

How much current does the circuit draw?

Battery capacity about 1500 mAh (1.5V*3х)

Consumption of Esp8266 — up to 215 мА
Consumption of Mq2 — up to 150 мА

Well if the capacity is 'about 1500mAhr and the consumption of the ESP8266 is 'up to 215mA' then a simple sum will give you the battery life in hours.

The real issue, and there is no magic formulae around this, is the ESP8266 is unlikley to be using 215mA all the time, sometimes it will be less, and you will only find out how much less and for how long by actually measuring it ......

Is that a measured value or an estimate?

Anyways, Lets say your actual total current is 300mA with a 1500mAh battery. Perhaps 1500/500=5? That's hours. Still the battery will, with proper treatment, settle at being about 85% of its rated capacity for most of its lifetime. Which is the current measurement I use to determine the possible battery run time. Thus (1500*.85)/500=2.55. For me the 1500mAh battery would have a more realistic current capacity of about 1200mAh and give a possible 3ish hours of run time.

Thank you for the detailed information.
3 hours is not enough. Tell me how I can reduce my current consumption. Sleep mode of the microcontroller?
The microcontroller turns on when only the Pir has found an object?

Sure. Turn off anything you can.

Do you mean 3 batteries of 500 mAH or 3 of 1500? Wiring in series you don't accumulate mAH as the same current flows through each battery.

Assuming 1500mAh, your current is ~365mA total, so will last 1500/365 = 4.1 hours.

Read post #7!