Quote Originally Posted by malc-c View Post
I don't think that would work. The regulator will simply give you a 5v supply from the 12v battery, it will never fall below 5v because the car battery would never get this low. The simple way is to use a voltage divider made by connecting two resistors accross the 12v line and then connect the pic to the junction between the two.

If you used a 58K and 41K with a 12v supply you would get 5v, however the state of a car battery is such that it's voltage will vary under charge and drain, so you would need to make allowances for that. You might find that under charge the voltage could be around 13.8v, falling to 10v under load.
The OA didn't say use the regulator for the sensed voltage, but for the supply voltage. He also recommended a 3:1 voltage divider for the sense. Personally, I'd use a 4:1 because the car battery can get up into the mid-14 volt range with some charging systems.

I have no idea where you get 58k and 41k resistors; these aren't standard RETMA values. I'd use a 100k and a 22k-10k variable in series to set the voltage accurately, or do some other tricks in software for calibration.

Jim