My vehicle ignition switch voltage is 9V when the vehicle is not running. It is 6V when button is pressed. I need a way to convert this to TTL Arduino digital logic levels. I thought I could use a voltage divider, but I can't compute resistor values that satisfy both conditions. I.E. 9V can be 5V, but the 6V would still be high enough to be considered a logic High. Maybe I missing something?
I thought about optoisolators, but it presents the same challenge as the voltage divider, the 3V Delta linearly scales on both sides. Again, maybe I'm missing something with calculating the left hand resistor to find the right hand resistor.
Then there is the ADC of the Arduino, which I can scale in the software with a voltage divider. My concern with this is the power consumption will increase more versus using a digital IO. And I'm trying to be mindful of my car battery and not draining it.
EDIT: I didn't explain well what I'm trying to do. I have a raspberry pi that I'd like to be gracefully shutdown by an Arduino monitoring the ignition of my vehicle. So if I push my ignition button, I'd like my arduino to detect that I'm either entering a vehicle turn on or turn off state and make the appropriate decision for the Pi's power. This gets tricky because the arduino needs a way to know the ignition state. And as someone suggested, maybe I'm not looking at the right signal?
I found the ON/OFF switch voltages from here: https://www.autocats.ws/manual/chevrolet/tis0911/en/documents_2012/Volt/SM-R/92535312.en.html
I've also found this description as well:
"The vehicle ON/OFF switch contains two individual switches that provides redundant switch inputs to both the body control module (BCM) and the keyless entry control module. The BCM supplies the vehicle ON/OFF switch a constant B+ signal. The BCM monitors this signal to determine if the switch is released or pressed. When the vehicle ON/OFF switch is not pressed, voltage on the signal circuit is pulled down through two resistors in the switch. When the vehicle ON/OFF switch is pressed, voltage on the signal circuit is pulled down through only one resistor, changing the voltage seen at the BCM and indicating that the vehicle ON/OFF switch is pressed."