I have an 3 wire Eaton iProx sensor that detects metal. Since it needs 6-48v to operate I am using a 9v battery to power it. Whenever it detects metal it outputs the input voltage through the signal wire. I am using a 7805 voltage regulator to bring it down to 5v so I can plug that into my Arduino. Would it be better to use a transistor instead since the Arduino and the sensor are both using different power sources? I have a schematic for it below I don't know if I drew it properly though.