Please read
"If it was a PNP sensor, the sensor would be sending whatever voltage it was operating at TO the microcontroller, so you'd have the possibility of sending more than 5V to the microcontroller, likely frying the pin if not more in the process. With a PNP sensor, you must use a voltage divider to lower the voltage if the sensor operates at greater than 12V"
so you need that voltage divider cct
And yes, you put 12v onto a 5v pin, this would kill that pin if not the entire processor.
.
"If it was a PNP sensor, the sensor would be sending whatever voltage it was operating at TO the microcontroller, so you'd have the possibility of sending more than 5V to the microcontroller, likely frying the pin if not more in the process. With a PNP sensor, you must use a voltage divider to lower the voltage if the sensor operates at greater than 12V"
so you need that voltage divider cct
And yes, you put 12v onto a 5v pin, this would kill that pin if not the entire processor.
.