Invalid output from serial communication

Good day everyone.

I have a barcode scanner which i have interfaced to Arduino UNO using the SoftwareSerial function.

The barcode gives the output via RS232.

I have wired the barcode scanner to arduino as follows:


TX D10(configured as RX by SoftwareSerial)
RX D11(configured as TX by SoftwareSerial)

In addition to this, the barcode has 3 extra wires at its output connected as CTS,RTS and Shield.

I have connected the Shield to GND.

My code is as follows:


SoftwareSerial mySerial(10,11); //(RX,TX)

void setup()

Serial.println(“START COMMUNICATION”);

void loop()
char bytes[20] = {’\0’};
int i = 0;


while(mySerial.available() > 0)

  • //Serial.println(;*
    _ Serial.println(bytes*);_
    Once i start the Serial Monitor and scan a barcode, I get the output as follows:
    > BEGIN*_
    > c
    > d
    > L
    > L
    > ¦
    > æ
    > f
    > &
    > ¦
    > æ
    > ¦
    > æ
    > ¦
    > Ö
    My expectation is ‘9789350235010*’ which is the barcode i see. Instead ‘cdLL¦æf&¦æ¦æ¦Ö’ is displayed.
    What might be the mistake?
    As of now i have not connected the CTS and RTS to any pin on Arduino.
    Should i connect CTS and RTS of scanner to UNO? If yes, to which pin and what configuration?
    Please help me out.

The barcode gives the output via RS232.

Has the Arduino got an RS232 input or is is TTL ? They use different voltage levels and it is common to use an interface circuit between the two.

Has the Arduino got an RS232 input or is is TTL ?

I think that would be clearer if it was like this

Does the Barcode reader output RS232 or TTL? The Arduino needs a TTL signal. RS232 uses higher voltages that may damage an Arduino.

You can use the MAX232 chip to interface between RS232 and TTL.


I tried the interface using MAX232 and i am able to communicate according to my requirement.

But there is a SP232een chip on the scanner which does the same job. But this gives the output as stated above.

What is happening here?

Good day everyone.

Sometimes in a hurry we forget the basics. This is what happened here.

The barcode engine gives a TTL output and Arduino can read TTL signals. In a hurry i skipped reading the datasheet of the scanner.

Sorry for my mistake.

An easy thing to do.

Glad you have it figured out.