Read RS232 Barcode Scanner

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

Read RS232 Barcode Scanner

Postby dreamsteven » Fri Apr 12, 2019 12:18 am

From the tittle above i need some advice for my bar-code scanner .
I am using the RS232 barcode scanner
A RS232 to TTL converter
Arduino board using the Mega
Connect RS232 barcode scanner with Rs232 to TTL converter using a null RS232 modem

#include <SoftwareSerial.h>

SoftwareSerial mySerial(19, 18); // RX, TX

void setup() {

void loop() {
  if (mySerial.available()) {
    int val =;
  if (Serial.available()) {
    int val1 =;

RS232 to TTL converter's TxD and RxD are connected to arduino pin 18 and 19.
After the scanning TxD and Rxd not blinking at all.
Serial monitor also didnt have any outcome.
Posts: 1
Joined: Thu Apr 11, 2019 11:55 pm

Re: Read RS232 Barcode Scanner

Postby ober » Sat Apr 13, 2019 5:22 am

Not familiar with the devices as we do not carry it, but looking at what you like to do, you are using Arduino mega as a USB to Serial bridge right?

Why don you just connect the RX and TX of the RS232 to TTL Converter to D0 and D1 or Mega, and reset the mega while testing it? Just connect a jumper wire from Reset pin to Gnd on the female header (near to power jack). This will keep Atmega2560 in reset mode and will not interrupt the USB to Serial IC on Mega itself.

BTW, it seem you did not initialize the software serial in your code, you "begin" hardware serial, but did not do anything with the softserial.
Ober Choo
Cytron Technologies Sdn Bhd
User avatar
Posts: 1470
Joined: Wed Apr 15, 2009 1:03 pm

Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 4 guests