I'll start reading about SLA batteries - thanks for the tip.
They are also referred to as VRLAs
, the most common type you'd find in hardware/department stores would be as replacement batteries for emergency or outdoor security lights.
On the suggestion of a voltage regulator: I agree that's a good idea and I'm not familiar with how they work. If I have a solar panel that outputs 9V in daylight, that voltage level will obviously fluctuate depending on time of day and clouds, etc. The 9V should be good for an arduino to run on, but do arduinos handle the voltage fluctuations? Would it be better to regulate it back to a constant 6V? Or perhaps run everything off of the battery and only use the solar panel to recharge batteries during the day?
There are two main types of voltage regulator you'd use on small to mid-sized electronics projects, linear regulators and switching regulators. Both can usually handle a varying input voltage, provided it stays within the operational input voltage range for the specific regulator.
The official Arduinos, and most of the derivatives, use linear voltage regulators to provide the proper voltage for the micro-controller and pins to power off-board devices (i.e. the ones marked 3V3 and 5V). These are effective, but inefficient because the decrease in voltage from the input to the output + the voltage dropout (basically the voltage drop necessary for the regulator to function) has a proportional relationship to the heat generated by the linear regulator. The amount of waste heat generated, therefore how inefficient the regulator's performance is, depends on the excess power it has to dissipate and that's determined by the decrease in voltage at a given current level. So for your application this heat is going to be wasted energy, which will decrease the effective battery life for your project, and will increase the temperature within whatever encloses the electronics.
For example, if you had 9 VDC
coming into an Arduino's barrel jack while the board is drawing 250 mAs, the power needed to be dissipated would be ~3 VDC
(for the sake of argument I'm just using a voltage dropout of ~1 VDC
the exact value will vary with the current) * .250 A = 0.75 Watts. If you had 12 VDC
as the input the power to be dissipated would be about twice as much.
In contrast, switching regulators use components like capacitors and conductors to store energy and release it at specific intervals to either raise or lower the effective output voltage. They are very efficient (over 90% efficiency is very achievable) and generate relatively little heat, but can cause some ripple on the output voltage and other electromagnetic interference issues. Many pre-built modules have capacitors or filters to reduce or eliminate these unwanted by-products. Although if you get one without these, or they aren't sufficient, you should add them to your design. Here's an example
of a step-down regulator module on a small PCB, and here's an even more compact one in a potted package
Finally, one slightly different alternative I didn't mention is to just have a step-up or step-down (whichever is appropriate) transformer. A transformer can convert between two voltage levels, but it doesn't have a fixed output level. Instead, the shift is proportional to ratios between the primary and secondary windings. So you would still need to use a voltage regulator for the Arduino (but the built-in one would be fine). If the battery would need one to charge would depend on the type, for a LiPo I would want some voltage regulation but a SLA would work provided the voltage highest voltage is a volt or two above the battery's nominal voltage. Also, a the power on each side of the transformer will be equal (minus some internal losses because we are dealing with real world devices) so for a given voltage increase or decrease on the output side, the current will change inversely as well.