Read serial output with stereo jack (RS232) from weighting scale

Hello, I want to receive the continuous data from serial output from Intercomp sw650 weighting scale with Arduino mega 2560. In the manual said that Total only continuous output will transmit a line with the total weight about four times per second:
" 5002"
" 5003"
" 5004"
I tried to apply the code below and set the baud rate both in arduino IDE and also in the weighting scale screen but it does not work.

#define SCALE_SERIAL_TX 18  

void setup() {
  Serial.begin(9600);  
  Serial1.begin(9600); 
}

void loop() {
  if (Serial1.available()) {  
    //String receivedData = Serial1.readStringUntil('\n'); 
    
    // Convert the received string to an integer and float
    int receivedInt = receivedData.toInt();  
    float receivedFloat = receivedData.toFloat();  
    
    
    Serial.println(receivedInt);  
    Serial.println(receivedFloat); 
    
    
    // delay(100); 
  }
}

the result show like below picture

Please help me figure this out, Thank you

Welcome to the forum

If the scale has an RS232 output then it is not compatible with a direct connection to the Mega TTL serial input

Have you got an RS232 to TTL converter between the two ?

Begin by simply sending each character read from the scale to serial monitor. Let's see what it's actually sending out.

Thank you. The serial output connector from display is a 3.5mm stereo audio jack with 3 rings (3 connections). Do I still need to use TTL converter?

The result show only 0.00

The converter does not convert the physical connection, rather it converts the voltage levels from one standard to the other so, yes, you need the converter

The user manual for the scales does not mention what voltage levels are used. Officially, RS232 uses some high voltages, both positive and negative, which would damage an Arduino input.

But it's possible that that the user manual omitted to mention is that it could be "TTL level" RS232 which would be 5V and ideal for an Arduino input.

So my advice would be to connect an oscilloscope and see what voltage level is actually output. Then you will know if you need an RS232 to TTL adapter.

Yes, there is no need to repeat yourself.

What about my suggestion from post #3?

But do not connect your Mega again until you have established whether an RS232 to TTL level converter is needed. You might already have damaged the Mega.

Also, please do not post images of serial monitor. Copy the text from serial monitor and paste that into your post between code tags.

Surely it cannot be both TTL and RS232 ?

Thank you. I have tried with arduino UNO by using 5V yesterday, it showed the correct result. so, i think the operate voltage is 5V. and today, I changed to Mega and use the old code (already change define port) but doesn't work. then I write the new one as above.

void loop() {
  if (Serial1.available()) {  
    //String receivedData = Serial1.readStringUntil('\n'); 
    
    // Convert the received string to an integer and float
    int receivedInt = receivedData.toInt();  
    float receivedFloat = receivedData.toFloat();  
    
    
    Serial.println(receivedInt);  
    Serial.println(receivedFloat); 
    
    
    // delay(100); 
  }
}

Where do you read the data that is available() ?

Tried what with Uno? The scales? That could damage the Uno also.

Or you tried the Uno with the Mega? That would not prove anything.

It's not correct to call it RS232 if it is only 5V, but I've seen the phrase used. I guess many people conflate "RS232" and "UART".

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.