I can't read from RS232

Hello,

I've a load cell conected to http://us.ohaus.com/en/home/products/product-families/T3P-US.aspx which has an RS232 interface. The interface work perfectly connected with the PC (9600 8N1). I've configure it to write the weigth every second, and it's displayed in hyperterminal.

In the other hand, I've an arduino mega board with this module http://www.lightinthebox.com/es/rs232-puerto-serie-para-modulo-convertidor-ttl-para-arduino-con-transmitir-y-recibir-indicador_p1141433.html Again, it works correctly connected to PC with this code:

void setup() {
  // initialize serial:
  Serial1.begin(9600);

  Serial.begin(9600);
  Serial.println("Hello Computer");
}

void loop() {
  while (Serial1.available()) {
    Serial.println(Serial1.read());
    delay(200);
  }
  while (Serial.available()) {
    Serial1.println(Serial.read());
    delay(200);
  }
  delay(1000);
}

Then I use a male to male convertor to connect both, because both has female connections and using the same code. And it doesn't work at all.
Serial1.available() never becomes bigger than 0.
The TX from the RS232 module is connected to RX1 (19), the RX to TX1 (18), the vcc to 5V and gnd to arduino's gnd.

You may need a null modem cable or adapter instead of a male-male. There are two flavours of RS232 port, DTE and DCE. They connect to each other, but the signal directions are different. A null modem adapter allows you to connect a DTE to a DTE or a DCE to a DCE.

Then I use a male to male convertor to connect both, because both has female connections and using the same code. And it doesn't work at all.

No surprise here, the Arduino's use serial data in the TTL format, this is not the same as the RS232 standard.
The voltage is different and the logic sense is inverted. You can make an RS232 to TTL adaptor with a lot of chips the MAX232 is one of them.

The TX from the RS232 module is connected to RX1 (19), the RX to TX1 (18), the vcc to 5V and gnd to arduino's gnd.

If your voltage levels are right then swap over the TX and RX on one of the connectors.

From what I can see, neither the instrument nor the converter module are using the RS232 handshake signal connections (DTR, DSR, CTS, RTS), so that's not the problem.

I think the instrument and the converter module are both transmitting on RS232 connector pin 3 and are both receiving on pin 2. So for the male-to-male connector I believe pin 2 of each connector should be connected to pin 3 of the other connector as shown here (but with male connectors).

Apples and Oranges. It is pointless to discuss why it is not working if the OP connected an RS232 device to an arduino. (which, as Mike pointed out is NOT RS232 but SERIAL TTL)

raschemmel:
Apples and Oranges. It is pointless to discuss why it is not working if the OP connected an RS232 device to an arduino. (which, as Mike pointed out is NOT RS232 but SERIAL TTL)

In the original post it was stated that the Arduino is connected via this module. I assume that converts serial TTL to/from RS232.

Yes, I have one
It didn't work if I had my USB cable connected to the PC. (meaning I had to unplug it after loading the sketch)

raschemmel:
It didn't work if I had my USB cable connected to the PC. (meaning I had to unplug it after loading the sketch)

That happens with the Uno but not with the Mega AFAIK.

I'm sorry, I use a null cable modem

aarg:
You may need a null modem cable or adapter instead of a male-male. There are two flavours of RS232 port, DTE and DCE. They connect to each other, but the signal directions are different. A null modem adapter allows you to connect a DTE to a DTE or a DCE to a DCE.

I'm sorry, I've already use a null cable modem (the male-male adaptar is because the cable ends with female connector)

Archibald:
From what I can see, neither the instrument nor the converter module are using the RS232 handshake signal connections (DTR, DSR, CTS, RTS), so that's not the problem.

I think the instrument and the converter module are both transmitting on RS232 connector pin 3 and are both receiving on pin 2. So for the male-to-male connector I believe pin 2 of each connector should be connected to pin 3 of the other connector as shown here (but with male connectors).

I can't easyly change these pins, there is any way to know if it's the problem?

linsms:
I can't easyly change these pins, there is any way to know if it's the problem?

Use your male-to-male connector but swap the Tx and Rx connections on your Arduino board while you are using it with the instrument.

Archibald:
Use your male-to-male connector but swap the Tx and Rx connections on your Arduino board while you are using it with the instrument.

I've tried it, but no signal is detected. I've also noticed that the max3232 (the chip in the RS232-TTL module) gets very hot quickly.

linsms:
I've tried it, but no signal is detected. I've also noticed that the max3232 (the chip in the RS232-TTL module) gets very hot quickly.

It sounds like your male-to-male connector incorporates interchange of the transmit and receive pins.

From the photos of the convertor module, it looks as if only the transmit, receive and ground pins of the 9-pin connector are connected, so I don't think the problem is due to the handshake signals.