PNP Sensor Hookup

If you are stilll having trouble, post a link to the “pnp sensor” and the “relay board” you mentioned in the first post. Also measure the voltage between ground on the sensor and ground on the Arduino. It should be zero. Maybe include a hand drawn sketch of exactly how it is all wired up.