I am using Mega 2560 to receive serial data from another device but the data appears on the serial terminal are strange characters. then i connected my USB to serial cable (HL-340) to the device and tried in serial terminal(Termite), data is landing fine. Replaced Arduino with another one since I believed there could be a problem, but the problem persisted. for further investigation i have connected my Arduino (Mega-2560) to my serial(USB->Serial) cable directly to receive data on the terminal but strangely even this is showing the wrong data (Arduino terminal is displaying the wright data but the data appears on the other terminal is wrong) sendind "c" receiving "N"... what could be the reason for this..its a simple code to print character on the screen. Thx
1 Answer
You need to be careful. Normal devices that have a "Serial" interface actually have an RS232 interface. While the data transmission scheme is similar with the "Serial" interface on the Uno/Mega (UART on TTL logic), RS232 has totally different voltage levels (up to -15 to +15V), which can kill your Arduino.
To connect an RS232 device to an Arduino you need a level converter (to convert between the RS232 levels and the TTL (Transistor Transistor Logic) level of the Arduino. The chip MAX232 is typically used for this. There are many resources about that on the web and even ready to use modules, which are equipped with a MAX232 and a RS232/Serial plug.


