I am using INA125 amplifier, a PIC controller, a load cell and a ESP 8266 wifi module. how can I calculate the power consumption to select a battery?Do I just add up the currents of my 4 devices or is there something I am overlooking?
- Read the data sheets and calculate or measure the current. Your answer will be in mA.
- Decide how long you want the battery to last. Answer will be in hours.
- Multiply the two together. The answer will be in mAh. This will be the minimum battery capacity you require.
- Purchase the next larger size.
In all such cases, you should carefully check the power requirements of the devices you intend to use.
The INA125 can be powered from 2.7V to 36V, most PIC controllers have a power source range of 2V to 5.5V and the ESP8266 appears to require 3.3V (max).
The key driver here is the ESP 8266 which would appear to require the use of a regulator to ensure it is not powered from a voltage that is too high.
All the devices listed would happily run at 3.3V which greatly simplifies interfacing as they will all be on the same power rail (you will need to make sure your load cell can operate in this environment).
Now read the datasheets and calculate the required current. If you use a linear regulator, this will also be the battery load current.
I am not going to go into switching regulators in any detail at this point, although they have higher efficiencies than linear regulators, depending on the specifics of the circuit. At very low Vin to Vout differences, this advantage disappears - even switch mode devices have a minimum dropout voltage, although some exist that can have the performance of a good low dropout device.
You have not stated what type of battery, but I can give a little guidance for Li+
A typical Li+ battery has a linear discharge curve and at 3.5V (the minimum input to a linear regulator for 3.3V, typically, although there are very low dropout voltage regulators; the dropout voltage is usually load dependent), the battery will be at about 40% of rated energy (very manufacturer dependent, check the datasheet; this is typical of the devices I used some years ago); i.e. if it states 2000mAH, then you would have a useable energy of about 60%, or 1200mAH.
Note that for all battery chemistries, the discharge curve and useable energy is dependent on the load, with a low load typically yielding higher useable energy.
Take this useable energy, divide it by the load and you have the length of time the battery will last.
Alternatively, take the load and multiply it by the time you wish the battery to last and then multiply it by the useable energy factor (0.6 in this case).
You will need to have a useable energy factor whatever you do.
Here is my suggestion if this is intended for a hobby application. Use a single Li cell, that makes it easier to charge, using something like this one. Use a DC-DC step up like this one to power the load cell and the amplifier. The PIC can possibly be powered directly from the Li cell. Use a LDO regulator for the ESP8266. If you want to go cheap, you could use a diode to drop the voltage or even connect the ESP8266 directly (In my experience they have survived 4.2v but it is not recommended). Again this recommendation is for people looking for a quick and cheap solution and not for commercial development.
The key to designing battery powered devices is efficient power control. Make sure the PIC and its peripherals are powered down when not in use. The amplifier and load cell should be powered on only when taking the measurement.
As for the battery capacity the other answers have all the information you need.