Measuring 24VDC w/Arduino

HI All,
I did a search on measuring Volts but im still a little confused on best approach.

I want to Monitor the battery level of my generator, 24 VDC, with my arduino.. It seems a voltage divider would give me what i need however I want to protect my UNO from burnout i.e. if a resistor fails or a spike happens... what is the best approach to this?

Thanks all...

Add a [u]protection diode[/u] at the Arduino's input. If there's a chance of wiring it up backwards (or otherwise getting a negative voltage) use the Zener-diode method, or use two diodes.

These protection circuits require a current-limiting resistor (so the voltage gets clamped without frying the diode) but since you're using a voltage divider you don't need any additional resistors.

Thanks, that's exactly what I was looking for!

DVDdoug:
Add a [u]protection diode[/u] at the Arduino's input. If there's a chance of wiring it up backwards (or otherwise getting a negative voltage) use the Zener-diode method, or use two diodes.

These protection circuits require a current-limiting resistor (so the voltage gets clamped without frying the diode) but since you're using a voltage divider you don't need any additional resistors.