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());
}
}