Sorry in advance if I don't use all of the correct terminology. I'm currently working on a project with two HCSR-04's, One H-Bridge (with its own power supply), as well as a mosfet connected to another power supply. I will be having the Ultrasonic sensors running as long as my UNO is on. Should I get a bigger power source? I'm only looking at powering the device for 2 hours max at a time. Thanks!
Instead of speculation, just hook up a 9v battery and time the operation until it no longer operates as desired.
Generally the small rectangular 9V batteries are very poor at providing power and will not last long. Even if it did last two hours it is a very expensive way of powering a project.
A 9V battery regulated by a 7805 chip will lose 45% of its power to the regulator.
Connect it through a DC-DC buck converter directly to Arduino VCC and you'll lose about 5%.
What I don't get is why not run the board off the motor power, using a buck converter?
The way to approach this analytically is to look at the battery discharge curve for the battery under consideration (e.g. 9V-Alkaline-tests.htm) and to determine the current draw of your project to estimate the useful lifetime of the battery.
To roughly budget current draw:
- Arduino Uno nominal current draw is 45 mA and it will drop out of regulation at 7 VDC.
- HCSR04 active current draw is 15 mA (HCSR04.pdf) times two plus the 45 mA for the Uno gets us to 75 mA for Uno + 2 x HCSR04.
- You don't specify a particular H-bridge, but assuming a L298 (L298_H_Bridge.pdf), your Iss (24 mA typ) and Is (50 mA typ) currents are coming from a different power source and the logic pin loading on the Arduino Iih is negligible (100 uA).
With a 75 mA draw, we're referencing the 100 mA discharge curve from the first link as a reasonable upper bound. At that discharge rate the carbon zinc battery in the table in first link is quoted as 52 mAH so we would expect it to last about 52 mAH/75 mA = ~40 minutes. The alkaline batteries are quoted at 310 mAH or more so we would expect about 310 mAH/75 mA = a bit over 4 hours.
Note that the first table in the first link give discharge to 0.1 volts and we may have problems after the battery voltage drops below the 7 volts specified for the Uno. A more careful analysis would take the mAH from the x-axis at the point the battery hits 7 volts on the y-axis. From that perspective the carbon zinc battery is immediately in trouble trying to supply ~100 mA even when fresh. The alkaline batteries would be derated to about 200 mAH.
If I haven't blown this analysis then a 9 V alkaline battery should meet your 2 hour requirement with a margin of about an hour or more. A 9 V carbon zinc battery will not.
As a final note, battery performance suffers at temperature extremes so, depending upon your application, that may have to be considered.
This is why I think the converters are worth the extra price, 9V 50mA converts close to 5V 90mA.