My arduino is run by a 9V battery and and I need to make a battery life indicator for this 9V battery. I just need a red LED to light up when the battery voltage reaches below a certain limit.
Also, I need another similar battery life indicator for the same arduino. This is for a 6V battery source which is used to power a servo motor.
You could use a voltage divider to bring the nominal 9V down to the 0 - 5V range and connect that to an analog input, and have your sketch read that and turn the LED on when required.
If your 9V battery is one of those little PP3 things, they're a relatively expensive and inefficient way to power an Arduino since they have a tiny charge capacity and very low current capability, and the voltage is too high which means the voltage regulator throws a lot of the energy away as heat. Search for Arduino battery power to see some better alternatives.
In terms of battery charge indicators, it depends on whether the battery provides such an interface. Many do not, some do. I would suggest whatever battery support you use, you get rechargeable batteries, so you don't have to keep replacing them.
Since Battery discharge is not proportional, you don't need the whole spectrum of the 9V mapped into the 5V of the analog input.
You can use zener diodes (one or more) to lower the voltage like shown in this circuit:
In the example, the two 5V zeners in series lower the input in 10V, so you have a better resolution of the remaining voltage, that is significative for measuring the charge. I did use this circuit, because a 12V battery is dead when it reaches 10V, no need to measure under this voltage.
So lets say you'll consider a 9V battery dead when it reaches 7.5V, you just need to measure with big precision this 1.5v. So If you use a zener of 4.3V, you have
an arduino ready signal and wont be misusing so many steps of the ADC.
This way you'll get more precision when reading the battery charge.
Hope this helps.