wildbill: Can't get much cheaper than a voltage divider; just make sure that your 12V input really is 12. In case it can be a little high, you may want to choose resistors to drop it a little lower than 5V - it'll still register as high.
A good point.. The 12V is not constant all the time.. It sometimes rises to 16V too..
So I guess, there is a problem with the voltage divider..:(