I'm trying to read some commands from a device that uses non-standard voltage levels for serial communication. It uses 0V for 0 and 12V for 1. For all I know, TTL levels are 0-5V, so if I want to communicate with it using my Arduino, I need to level down the 12V to match the 5V. The Arduino Mega provides a pin with an output of 5V, so I figured I could use it, add a diode and get about 5V which I can connect to RX. For now I only need to read the data. TX pin stays untouched.
I made a schematic, presented below:
I figured that the drop on the diode (about 1.8V) will allow me to have (~)5V on the RX pin when the signal from the device is at 12V, and 0, when its 0V. 12V - 5V - 1.8V = 5.2V. The R1 is 3kOhm. Could somebody explain to me why doesn't it work? Is this solution even proper? What do I need to change for it to work?
EDIT: I managed to get it to work - I modified the circuit:
The diode is a simple red diode, which has a drop of 1.8V. The three resistors are all 1kOhm. From my calculations, if the maximum signal voltage is 12V, I can now get 5V after reconnecting the diode to the GND.
What I don't understand is - when the pictured red line is disconnected, I get nothing - my Arduino doesn't respond. BUT when I connect the device's RX with TX I read the exact data I wanted! Now that's not very obvious to me, I got it accidentally by playing with the board. Is there an obvious reason why the device starts transmitting after I connect the red wire?
EDIT2: Below is the device's schematic. CONTROL SYSTEM is the only connector I am able to get to. 12V comes from a simple 12V adapter, ground is also connected to adapter. Rx is connected to arduino, the rest is exactly like on the picture with the red wire. Bigger version on Imgur