
I'm building an adapter for rotary encoder that reads input of encoder and sends pulses by RS485. I'm using two RJ-45 connectors to provide power both for adapter and encoder. Both connectors have the same pinout. The right side connector receives 12V, theres linear regulator on board that powers RS485 transmitter/receiver chips and encoder.
I want to make some protection mechanism that would prevent failure when user connects 12V cable to output (left side) connector. Indication LED about wrong connection would be bonus.
All I was able to come up is a mosfet Q1 that has it's gate tied to +12V and 5V zener diode in series with resistor and "wrong connection" led.
Could someone advice me on more elegant/better way to do it?

