Comparators for digital input mode
You can't put 12 volts into a Uno input pin in any case.

You could run it into a voltage divider and divide it down to somewhere on the range 0 to 5 V, and then do an analogRead to see exactly (or almost exactly) what the resulting voltage is.

I don't really see where comparators come into it in this particular case. I mean, you could use a comparator to turn the LED on, but then where does the Arduino come into it?




  I've actually tried with voltage divider, I went pretty high on my resistors, taking the 12V source and hooked in 4x1M resistors but the 12V never came down significantly.


You need a voltage divider like this:



Those values give you 4 V on the Arduino pin if there is 12 V on the input.

Vout = (R2 / (R1 + R2) ) * Vin

So:

(1000 / 3000) * 12V = 4V