We have a raspberry pi 4 with 2 12v motor drive L298, 5 ultrasonic sensors, and raspberry pi camera but we need to know how to calculate the battery usage of all these chips, could anyone help with this
You can get wattage readers that plug to your wall and then you plug your devices to it. But if you don't want to get one this is how you do it.
Find out how any watts you use in total (Pi 4 is 5W, motors are 3W... you get the idea) then divide that by 5V. That'll be an estimate of how many amps you need an hour (assuming you are using a 5V battery pack).
Failing that, get a battery pack and run the system at full usage constantly until loss of power while recording it with a camera. The minutes from power on till power failure are what you need. Then use the rule of 3 to calculate the power usage. Example : You run your system with a 6A (6000mAh) battery pack. That means you can run at 6A for 60 min. Your system shuts down in 46 min. So if: 46 min = 6A
60 min = x
Multiply 60 min by 6Amps then divide by 46 min.
60min x 6A= 360
You need a battery with 7830mAh per hour of operation of your device.
Now you only need to find a pack or packs capable of outputting that total amount of current and you are done.