The main challenge: PNP sensor is 24Voltages supply and Arduino works properly between 7 to 12Voltages. To overcome : Voltage Divider with Two resistors (R1 10kiloOhm , R2 7kiloOhm) is made to reduce ...