wvmarle:
If the only voltages you get are negative, you could connect the GND (0V) to connector pin 1, and the negative signal to pin 2. After all -50V between conductor 1 and 2 is the same as +50V between conductor 2 and 1.OP is a bit ambiguous but does state:This what I based my circuit on: converting a 0/12-50V digital signal into a 0/5V digital signal for use by an Arduino. It would work the same for a 3.3V Arduino, by the way.
If you have a signal that goes from -50V all the way to +50V indeed you need a different circuit. A second optocoupler (which goes in place of the diode) could give you two digital outs (one for a negative signal, the other for a positive one), or if you want to be able to measure any voltage in that range you need a voltage divider + offset type circuit to go to a 0-5V analog signal.
This solution sounds good.
Would this work whether or not the Arduino had a common ground? (IE, if it's powered by battery, or via transformer)
After some testing, I understand what the previous posts mean about common grounds now- my basic resistor circuit will only work if the Arduino, or the -ve input, is powered by an isolated ground- IE an isolated battery.