Serial Data not processed by Arduino [SOLVED]

Hi,

I have a Arduino Mega 2560 and i am trying to interface a Sensor,which has the RS232 Serial port.When i connect the sensor directly to a computer via RS232-USB convertor cable @9600 baud rate.I am able to get the serial data from the Sensor on the computer.But when I connect the sensor via RS232 to TTL converter and try to read it via Arduino Serial port(Serial1).

The Tx pin of the sensor is connected to Rx pin of Arduino and Rx pin of the sensor to Tx of the Arduino is connected as expected.
I am not able to get the serial data.The voltage of the RS232(Tx-GND) is -5.59 and while data transmission it drop to -3.26.
Please provide directions on how to solve this problem.

 void setup()
 {
 	Serial.begin(9600);
        Serial1.begin(9600);
        delay(1000);
 }
 void loop()
 {
	while(Serial1.available()>0)
 	{
          Serial.write(Serial1.read());
 	}

	while(Serial.available()>0)
 	{
          Serial1.write(Serial.read());
 	}

 }

There should be NO negative voltages connected to Arduino pins. The Arduino I/O voltage range is 0-5v.

Why has your code the ability to send data to the Sensor? Because the Arduino is so much faster than serial comms the sending and receiving codes may be tripping each other up.

If it is necessary to send data to the sensor to tell it to perform please give us full details and a link to the Sensor datasheet.

If it is not necessary to send data to the sensor take that code out of your sketch.

...R

Thanks Robin..
The problem is with the TTL converter..It was not working and then the TX and RX of the sensor was interchanged..Fixed it and it worked..