I have a system that measures the amount of time a certain spot is in the sun. I am using a phototransistor to measure the sunlight and I display my readings on an LCD. I tested out this system for the first time today and I powered it using a 9V battery connected through the DC jack. It ran out of battery in 8 hours but I wanted it to run for at least 24 hours but preferably more.
My first thought was to turn off the LCD but the lcd.noDisplay() method only blanks the screen and does not turn off the backlight. Is there a way to turn of the backlight?
My other question is what is the best way to power an Arduino Uno? I want it to be portable but also last for a long time. And if there is no better solution, can I provide it with backup batteries that kick in one by one when the first one dies
When choosing a battery for any project one needs to look at the amphour rating of the battery. So you look at your project's current draw. A standard 9 volt PP3 type battery is about a 1.0 amphour battery so even with a 100 mA light load you are lucky to see 10 hours.
More batteries is not a good solution. A larger battery with a higher amphour rating is what you want. Today with new battery chemistry this is not a problem.
With portability battery weight may be a factor but simply put you need more battery. Rather than letting your Aeduino regulate the voltage ypou may also want to look at using a buck converter to get 5.0 volts and power the board that way.
The Arduino UNO for example has two onboard voltage regiulators, one for 5.0 volts and another for 3.3 volts. When supplying the board using the DC jack and 9 volts any voltage over about 7.5 volts is dissipated as heat so wasted power.
The best low power Uno-compatible approach is to use an Arduino Pro Mini instead, with the power LED removed (and the voltage regulator, if you wish).
Power it with a 3.7V or 4.5V battery through the 5V pin, and put the Pro Mini in power down sleep mode between measurements. Wake it up to record a measurement and go back to sleep, as described in this excellent tutorial.
9V battery discharge curve:
9V-12V is about the worst way to power your Arduino. 1/2 your current is dissipated as heat by the voltage regulator. A hard +5 is best, but not trivial for batteries.