I'd like to read the digital inputs of my alarm sensor into a microcontroller (mainly PIR and Reed switches). The alarm system and the sensors operate at 12V (actually a tad higher) and the MCU uses 3.3V. I also noticed that the PIRs provide an idle signal of ~7V (no motion) and an alarm signal of ~13V.
My question is, how would I go about safely reading the sensor values into the microcontroller. I found a few voltage divider examples, but they don't take into account the idle voltage (i.e. they scale 12V/0V to 3.3V/0V). The idle signal can also vary between PIRs, so I might need an adjustable (potentiometer?) solution. Any help would be appreciated.