Mega - RS232 Confusion

Hi,

I have been using Parallax's BasicStamp for my projects all this year.
I just started playing with Arduino for couple of days. Complete beginner in Arduino.
Most of my projects are connecting RS232 devices (such as Electronic Scale, serial printer, serial display) to microcontroller.

I encounter weird things when I connect my Electronic scale to Arduino Mega.
Here is my pin connection:
Scale-TX > Mega-RX1
Scale-GND > Mega-GND

I don't connect the scale-RX pin as the scale only needs to send weigh data (streaming mode).
When I ran my code, Arduino received garbage characters.

But if I swap my connection to:
Scale-TX > Mega-GND
Scale-GND > Mega-RX1

It works perfectly!

Serial1, Serial2, and Serial3 all behave similarly.

Pls help. Is this normal? What seems to be the problem?

FYI, if I use SoftwareSerial, I have to use "TRUE" parameter: SoftwareSerial scale(10, 11,true)

Regards,
Bronson

The Serial pins use TTL voltage levels, which are inverted compared to RS-232 levels. See this page: https://www.sparkfun.com/tutorials/215

That's probably why it works when you switch the wires, but it's not a good idea. For one thing, RS-232 devices can put out +/- 13V, which is more than the Arduino can handle. And it's probably bad to connect a voltage source to the Arduino ground!

Use a level-shifter chip or board to interface between RS-232 and TTL devices.

Thx alot for the quick reply!

I will do more research on the level-shifter chip

Bronson

Hi,

I have tried it with RS232-TTL converter. It works.

What if I use SoftwareSerial (since it comes with "TRUE" parameter to invert signal)? Is it safe cause with softwareSerial, I don't have to connect Scale-RX to Mega-GND?

Regards,
Bronson

The RS232-TTL converter does not only invert the signal. It also translates +3V .. +12V (RS232) to 0V (TTL) and -3V .. -12V (RS232) to +5V (TTL).

You need to take precautions because the pins on your Mega don't like voltages outside the range of 0 .. 5V (+/- 0.5V) and your device might not react on the TTL levels (OK, you don't connect it anyway, but for another setup it's good to know).

sterretje:
The RS232-TTL converter does not only invert the signal. It also translates +3V .. +12V (RS232) to 0V (TTL) and -3V .. -12V (RS232) to +5V (TTL).

You need to take precautions because the pins on your Mega don't like voltages outside the range of 0 .. 5V (+/- 0.5V) and your device might not react on the TTL levels (OK, you don't connect it anyway, but for another setup it's good to know).

Thanks for the explanation, buddy.