I have a microcontroller that I want to install in my car. One wire coming from the car supplies +12V from the battery independent of whether the car is on or off. This works fine to power the microcontroller when the car is on, but I would like to cut the power when the car turns off. Another pin in the same harness reads about +0.25V when the car is on and +12V when the car is off. How can I use this signal to switch on/off my microcontroller? There are some ideas that come to mind, but I am not sure what type of solution will use the least amount of power when the car is off.
You could make a high side switch with a p-channel MOSFET. Attach your load to the drain, and your car's 12V power to the source. The MOSFET basically becomes a short when the voltage on the base goes lower than the source voltage, 12V in your case, minus the Vgs(th). If the data sheet for your MOSFET indicates that the Max Vgs is greater than 12, then you can attach the signal to the gate through 100 Ohm resistor and be done.
If you are interested in a schematic, and more details, search "MOSFET high side switch"