RS232 to TTL converter for weighing scale not working [SOLVED]

@OP

1. Make the following connections between the RS323-TTL Module and the Arduino UNO.
(a) TXD-pin of the Module with DPin-2 (Digital Pin Connector) of UNO.
(b) GND Pin of the Module with GND pin of UNO.
(c) Vccpin of the Module with 5V-pin of UNO.

(2) Put different weigh on the pan of the Weighing Scale. If the display unit of the Weighing Scale shows changing weight, then go to the next step; else, you have bad Weighing Scale.

(3) Upload the following Sketch.

#include<SoftwareSerial.h>
SoftwareSerial mySUART(2, 3);  //SRX, STX

void setup() 
{
  Serial.begin(9600);
  mySUART.begin(9600);

}

void loop() 
{
  if(mySUART.available()>0)
  {
    byte x = mySUART.read();
    Serial.println(x, DEC); 
  }

  delay(1000);

}

(4) Change the weights on the pan of the Weighing Scale. Check that the Serial Monitor shows changing digits (this is an un-calibrated signal). To see the exact meaningful weight, you need to calibrate the received signal.

GolamMostafa:
@OP

1. Make the following connections between the RS323-TTL Module and the Arduino UNO.
(a) TXD-pin of the Module with DPin-2 (Digital Pin Connector) of UNO.
(b) GND Pin of the Module with GND pin of UNO.
(c) Vccpin of the Module with 5V-pin of UNO.

(2) Put different weigh on the pan of the Weighing Scale. If the display unit of the Weighing Scale shows changing weight, then go to the next step; else, you have bad Weighing Scale.

(3) Upload the following Sketch.

#include<SoftwareSerial.h>

SoftwareSerial mySUART(2, 3);  //SRX, STX

void setup()
{
  Serial.begin(9600);
  mySUART.begin(9600);

}

void loop()
{
  if(mySUART.available()>0)
  {
    byte x = mySUART.read();
    Serial.println(x, DEC);
  }

delay(1000);

}




**(4)** Change the weights on the pan of the Weighing Scale. Check that the Serial Monitor shows changing digits (this is an un-calibrated signal). To see the exact meaningful weight, you need to calibrate the received signal.

@GolamMostafa In previous attempts also, I have tried similar codes and connections but there was no success and I was receiving random values.

I followed your steps exactly but then again I am getting same random values

My weighing scale is displaying weight perfectly and with the help of RS232 to USB cable I am also able to view weight on serial monitor which is in format "+000.000 Kg", for example- If I place 390gm weight it shows "+000.390 Kg" on serial monitor

Random values on serial monitor with RS232 to TTL converter with steps followed as directed by you:

192
0
3
0
0
0
0
0
0
0
0
0
192
0
0
3
0
0
130
0
0
0
0
192
0
0
0
0
0
0
0
0
0

Please help me out further, If I can use any other way to receive data on Arduino because I am on last step of project and if this doesnot work my project will fail!

Thanks in advance!

PS- I have ordered a new RS232 to TTL converter with MAX3232 chip not the SMD chip, lets see

AnshumanFauzdar:
My weighing scale is displaying weight perfectly and with the help of RS232 to USB cable I am also able to view weight on serial monitor which is in format "+000.000 Kg", for example- If I place 390gm weight it shows "+000.390 Kg" on serial monitor.

1. Which Serial Monitor you are talking about. In Arduino Platform, we have a Serial Monitor being driven by the UART/USB Port of the UNO. We call it Arduino Serial Monitor.

2. Before, you were getting weird characters/digits; now, you are getting clean digits though they are random. Do they change when you change weight? It should change. You are getting random values as we are receiving only one UART Frame and displaying it. If we could receive one complete 'Transmission Frame', it could be processed/calibrated and stable reading/weight could be displayed.

3. To me, it looks like that the setup Weighing Scale + ......... + Serial Monitor is functional. Now, you have to calibrate the received signals in order to see the exact weight on the Arduino Serial Monitor.

Calibration Procedures:
1. Ask the (or consult the Technical Manual of the Weighing Scale) Manufacturer of the Scale to supply you the 'Data Format' which the Scales's Processor uses to transmit data over the UART Port.

2. The above 'Data Format' contains information as to: Beginning mark, number of UART Frames, and Ending Mark (one transmission frame).

BTW: Let us know your setup where you are getting the correct display of the weight. Is it --
Weighing Scale + RS232-USB Converter Cable + PC + Hyper Terminal?

GolamMostafa:
1. Which Serial Monitor you are talking about. In Arduino Platform, we have a Serial Monitor being driven by the UART/USB Port of the UNO. We call it Arduino Serial Monitor.

2. Before, you were getting weird characters/digits; now, you are getting clean digits though they are random. Do they change when you change weight? It should change. You are getting random values as we are receiving only one UART Frame and displaying it. If we could receive one complete 'Transmission Frame', it could be processed/calibrated and stable reading/weight could be displayed.

3. To me, it looks like that the setup Weighing Scale + ......... + Serial Monitor is functional. Now, you have to calibrate the received signals in order to see the exact weight on the Arduino Serial Monitor.

Calibration Procedures:
1. Ask the (or consult the Technical Manual of the Weighing Scale) Manufacturer of the Scale to supply you the 'Data Format' which the Scales's Processor uses to transmit data over the UART Port.

2. The above 'Data Format' contains information as to: Beginning mark, number of UART Frames, and Ending Mark (one transmission frame).

BTW: Let us know your setup where you are getting the correct display of the weight. Is it --
Weighing Scale + RS232-USB Converter Cable + PC + Hyper Terminal?

  1. Yes arduino serial monitor
  2. Yes they change, but as I said they are again random!
    3.Yes maybe because it is in format "+000.000 Kg"

Calibration

  1. Yes, I have asked for technical manual for weighing scale, will talk to manufacturer tomorrow.
  2. Yes we have to convert the signals to standard form which is "+000.000 Kg"

Yes correct display is showing by this setup :
Weighing Scale + RS232-USB Converter Cable + PC + Hyper Terminal/Putty/Arduino Serial Monitor

and also weighing scale have a display

Thanks @GolamMostafa for helping me out.

Your prompt replies will solve my problem quickly, Thanks.

  1. If Hyper Terminal is showing the correct data, tell us what you have setup in Hyper Terminal for: Baud rate, start bit, data bits, parity and stop bits?

  2. What is the voltage on the weigh scale cable: pin #2 to pin #5? pin #3 to pin #5?

  1. With only 5v powered connected to the converter, what is the voltage on DB09 connector: pin#2 to pin #5? pin #3 to pin #5?

Make sure you identify the pin numbers correctly.

  1. On the converter, what is the voltage on TXD to GND? on RXD to GND?

  2. The cable connector that plugs into the converter is male or female?

  1. If you want to display ASCII text on the Arduino serial monitor like +000.000 Kg then:
    If you use: Serial.write(mySerial.read());
    With the above code, when you receive +000.000 Kg you will see +000.000 Kg on the Arduino serial monitor.

If you use: Serial.println(mySerial.read());
With the above code, when you receive +000.000 Kg you will see:
43
48
48
48
46
48
48
48
32
75
103
10

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX   <------<<<< use the pins you want

void setup()
{
  Serial.begin(9600);
  mySerial.begin(9600);

}


void loop()
{
    while (mySerial.available())
    {
      Serial.write(mySerial.read());   // You can also use:     Serial.print((char)mySerial.read());
      //delayMicroseconds(200);
    }

}

@OP

If you are unable to collect information on the nature of 'Transmission Frame' of the weighing Scale, there is another (very cryptic, technical, and risky) way of reading out the data from the Weighing Scale by the Arduino UNO.

1. Carefully, open the Weighing Scale.
2. Locate the ADC on the PCB Board. Check that it is of type: HX711.
3. Consult the data sheet of HX711 and then locate the Data Pin, CLK Pin and the GND Pin.
4. (If you don't know soldering, please do not do this step). Solder three long wires (so that they arrive up to UN0) with the above three pins and connect them with the UNO this way: data line to A1-pin of UNO, clk line to A0-pin of UNO, and GND to GND.
5. Assemble back the Weighing Scale.

6. Now, you may follow this link to acquire weight signal, calibrate it, and display it on the Serial Monitor of UNO.

loadcellCalib.png

loadcellHx711.png

AnshumanFauzdar:
Yes correct display is showing by this setup :
Weighing Scale + RS232-USB Converter Cable + PC + Hyper Terminal/Putty/Arduino Serial Monitor

1. According to you, the following setup is working using Arduino Serial Monitor.
keyxc.png

How have you operated it?
(a) You have opened a sketch. You have launched the IDE which has brought in a (Blank) sketch.

(b) And then you have brought in the Serial Monitor at 9600 Bd.
(c) You have engaged the RS232-USB Cable and have chosen the correct COM Port from the IDE.
(d) The Serial Monitor shows correct weight that corresponds to the weight you have placed on the pan of the Weighing Scale.

OK! Fine!

2. Now, you want to make the following setup operational -- correct?

I am curious to know why you have been so interested to make the above setup working. What do you want to achieve/what is the purpose?

keyxc.png

May be some confusion with the OP.
He said he has an UNO.
Says he got the Arduino serial monitor to work with the scale but not with this sketch.

Sounds like there maybe a bit of communications confusion.

Now this looks like there was communications to the serial monitor:

OP says:
“Weighing scale delivers 8 bits data at 9600 baud rate with "NO" parity and "1" stop bit”
Go figure.

Edit:
OP sent the scale data to PC with RS232 to USB converter.
Then went to Tools in IDE then selected that comport and then opened the Arduino serial monitor. ? ? ?

To bring in an Arduino Serial Monitor, one must launch the Arduino IDE which (in turn) brings a (Blank) Sketch.

larryd:

  1. If Hyper Terminal is showing the correct data, tell us what you have setup in Hyper Terminal for: Baud rate, start bit, data bits, parity and stop bits?

  2. What is the voltage on the weigh scale cable: pin #2 to pin #5? pin #3 to pin #5?

  1. With only 5v powered connected to the converter, what is the voltage on DB09 connector: pin#2 to pin #5? pin #3 to pin #5?

Make sure you identify the pin numbers correctly.

  1. On the converter, what is the voltage on TXD to GND? on RXD to GND?

  2. The cable connector that plugs into the converter is male or female?

  1. If you want to display ASCII text on the Arduino serial monitor like +000.000 Kg then:
    If you use: Serial.write(mySerial.read());
    With the above code, when you receive +000.000 Kg you will see +000.000 Kg on the Arduino serial monitor.

If you use: Serial.println(mySerial.read());
With the above code, when you receive +000.000 Kg you will see:
43
48
48
48
46
48
48
48
32
75
103
10

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX  <------<<<< use the pins you want

void setup()
{
  Serial.begin(9600);
  mySerial.begin(9600);

}

void loop()
{
    while (mySerial.available())
    {
      Serial.write(mySerial.read());  // You can also use:    Serial.print((char)mySerial.read());
      //delayMicroseconds(200);
    }

}

Today I have gone to college, will be back in evening, then only I will be able to check this one.
Thanks @larryd for this one

GolamMostafa:
@OP

If you are unable to collect information on the nature of 'Transmission Frame' of the weighing Scale, there is another (very cryptic, technical, and risky) way of reading out the data from the Weighing Scale by the Arduino UNO.

1. Carefully, open the Weighing Scale.
2. Locate the ADC on the PCB Board. Check that it is of type: HX711.
3. Consult the data sheet of HX711 and then locate the Data Pin, CLK Pin and the GND Pin.
4. (If you don't know soldering, please do not do this step). Solder three long wires (so that they arrive up to UN0) with the above three pins and connect them with the UNO this way: data line to A1-pin of UNO, clk line to A0-pin of UNO, and GND to GND.
5. Assemble back the Weighing Scale.

6. Now, you may follow this link to acquire weight signal, calibrate it, and display it on the Serial Monitor of UNO.

loadcellCalib.png

This is my plan C, will try this one in worst situation

GolamMostafa:
1. According to you, the following setup is working using Arduino Serial Monitor.
keyxc.png

How have you operated it?
(a) You have opened a sketch. You have launched the IDE which has brought in a (Blank) sketch.

(b) And then you have brought in the Serial Monitor at 9600 Bd.
(c) You have engaged the RS232-USB Cable and have chosen the correct COM Port from the IDE.
(d) The Serial Monitor shows correct weight that corresponds to the weight you have placed on the pan of the Weighing Scale.

OK! Fine!

2. Now, you want to make the following setup operational -- correct?

I am curious to know why you have been so interested to make the above setup working. What do you want to achieve/what is the purpose?

  1. Yes I followed these steps, and also with putty and hyperterminal
  2. Yes, but let me tell you why I need this type of communication:
    I am making an oil filling project for a edible mustard oil manufacturing plant, so I am using a solenoid valve to control flow of oil, and with the help of weighing scale, I will be able to fill oil in bottles according to the requirement, so I need this type of communication

I hope you understand my requirement

AnshumanFauzdar:
I hope you understand my requirement

I have well understood the purpose of your project and the Arduino setup. We hope that your project will become a reality very soon.

Thank you with K+ for the efforts and communications you are maintaining.

AnshumanFauzdar:
My weighing scale is displaying weight perfectly and with the help of RS232 to USB cable I am also able to view weight on serial monitor which is in format "+000.000 Kg", for example- If I place 390gm weight it shows "+000.390 Kg" on serial monitor

1. You have worked with the following setup and you have seen the above reading on the Serial Monitor. Let us begin from here to understand the nature of the 'Transmission Frame' being sent by the Weighing Scale processor over the UART Port. Once the frame structure is known, we can easily develop our sketch for the UNO setup to catch the numerical value of the weight and save it into a variable.
keyxc.png

2. Serial Monitor shows: +000.390 Kg; it means that the Serial Monitor (it is an ASCII device) has received the following ASCII data bytes from the Weighing Scale.

2B ASCII Code of +
30 ASCII Code of 0
30 ASCII Code of 0
30 ASCII Code of 0
2E ASCII Code of .
33 ASCII Code of 3
39 ASCII Code of 9
30 ASCII Code of 0
20 ASCII Code of Space
4B ASCII Code of K
67 ASCII Code of g
0D ASCII Code of CR (carriage Return)
0A ASCII Code of LF (line feed)
(CR and LF are the two components of new line ln)

3. From Step-2, it appears that there are 13 UART/ASCII Frames in one 'Transmission Frame' being sent by the Weighing Scale. Now, we have been able to make this information available without having the Technical Manual of the Weighing Scale.

4. Please upload the following sketch (tested by simulating the Weighing Scale by another UNO) in the UNO of the setup that follows the sketch. Place 390 gm weight on the pan of the weighing Scale. Check that the Serial Monitor shows: +000.390 Kg. Check with any other known weight.

#include<SoftwareSerial.h>
SoftwareSerial mySUART(2, 3); //SRX, STX

char myWeight[20] = "";

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

void loop()
{
  if (mySUART.available() == 13)
  {
    for (int i = 0; i < 13; i++)
    {
      myWeight[i] = mySUART.read();
    }
    Serial.print(myWeight);
    myWeight[20] = "";
  }
}

BTW: Remember that Pin-2 of the 9-pin connector of the Weighing Scale will be connected with Pin-3 of the 9-pin connector of the RS232-TTL Converter Module.

5. Let us reconstruct the numerical value (000.390) of the weight from the received bytes which are now in the array named myWeight[].

//-----------------
    intPart[0] = myWeight[1];
    intPart[1] = myWeight[2];
    intPart[2] = myWeight[3];
    //----------------------
    fracPart[0] = myWeight[5];
    fracPart[1] = myWeight[6];
    fracPart[2] = myWeight[7];
    //----------------------
    unsigned long intWt = atol(intPart);
    unsigned long fracWt = atol(fracPart);
    float fintWt = (float)intWt;
    float ffracWt = (float)fracWt / 1000000.0;
    float wt = fintWt + ffracWt;

    /*
      Serial.print(intWt);  //0
      Serial.print("   ");
      Serial.println(fracWt);  //390000

      Serial.print(fintWt);  //0
      Serial.print("   ");
      Serial.println(ffracWt);  //390000
    */
    Serial.println(wt, 3);   //0.390  Kg

larryd:

  1. If Hyper Terminal is showing the correct data, tell us what you have setup in Hyper Terminal for: Baud rate, start bit, data bits, parity and stop bits?

  2. What is the voltage on the weigh scale cable: pin #2 to pin #5? pin #3 to pin #5?

  1. With only 5v powered connected to the converter, what is the voltage on DB09 connector: pin#2 to pin #5? pin #3 to pin #5?

Make sure you identify the pin numbers correctly.

  1. On the converter, what is the voltage on TXD to GND? on RXD to GND?

  2. The cable connector that plugs into the converter is male or female?

  1. If you want to display ASCII text on the Arduino serial monitor like +000.000 Kg then:
    If you use: Serial.write(mySerial.read());
    With the above code, when you receive +000.000 Kg you will see +000.000 Kg on the Arduino serial monitor.

If you use: Serial.println(mySerial.read());
With the above code, when you receive +000.000 Kg you will see:
43
48
48
48
46
48
48
48
32
75
103
10

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX <------<<<< use the pins you want

void setup()
{
Serial.begin(9600);
mySerial.begin(9600);

}

void loop()
{
while (mySerial.available())
{
Serial.write(mySerial.read()); // You can also use: Serial.print((char)mySerial.read());
//delayMicroseconds(200);
}

}

  1. Hyperterminal setup:

  2. On weighing scale connector:

![|375x500](https://i.imgur.com/IDLYSmA.jpg[\img]

  1. On DB09 connector side:

  1. On TTL side of converter:

  1. Female:

  1. I tried this code, first I want to declare one thing, when I connect GND to GND and VCC to 5v from Converter to Arduino and then connect RX pin or TX pin - Nothing happens, but if I remove +5v from arduino then serial monitor starts getting values.

I have tried all combinations!

I tried your code and I am getting output like this:

0000

Same result I am getting with @GolamMostafa codes, I also tried by "Pin-2 of the 9-pin connector of the Weighing Scale will be connected with Pin-3 of the 9-pin connector of the RS232-TTL Converter Module", then I got result like:

????????????????????????????????

I think my converter is faulty and I have ordered a new one!

Thank you so much for your support, and do guide me what should I do next!
)

AnshumanFauzdar:
I think my converter is faulty and I have ordered a new one!

In that case, you should try the circuit of Post#37 and the sketch of Post#51 before ordering a new RS232-TTL Module?

OR

You can try by using the other gate (scheduled for receiver, but it is not used) of the present RS232-TTL Module?

GolamMostafa:
1. You have worked with the following setup and you have seen the above reading on the Serial Monitor. Let us begin from here to understand the nature of the 'Transmission Frame' being sent by the Weighing Scale processor over the UART Port. Once the frame structure is known, we can easily develop our sketch for the UNO setup to catch the numerical value of the weight and save it into a variable.
keyxc.png

2. Serial Monitor shows: +000.390 Kg; it means that the Serial Monitor (it is an ASCII device) has received the following ASCII data bytes from the Weighing Scale.

2B ASCII Code of +
30 ASCII Code of 0
30 ASCII Code of 0
30 ASCII Code of 0
2E ASCII Code of .
33 ASCII Code of 3
39 ASCII Code of 9
30 ASCII Code of 0
20 ASCII Code of Space
4B ASCII Code of K
67 ASCII Code of g
0D ASCII Code of CR (carriage Return)
0A ASCII Code of LF (line feed)
(CR and LF are the two components of new line ln)

3. From Step-2, it appears that there are 13 UART/ASCII Frames in one 'Transmission Frame' being sent by the Weighing Scale. Now, we have been able to make this information available without having the Technical Manual of the Weighing Scale.

4. Please upload the following sketch (tested by simulating the Weighing Scale by another UNO) in the UNO of the setup that follows the sketch. Place 390 gm weight on the pan of the weighing Scale. Check that the Serial Monitor shows: +000.390 Kg. Check with any other known weight.

#include<SoftwareSerial.h>

SoftwareSerial mySUART(2, 3); //SRX, STX

char myWeight[20] = "";

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

void loop()
{
  if (mySUART.available() == 13)
  {
    for (int i = 0; i < 13; i++)
    {
      myWeight[i] = mySUART.read();
    }
    Serial.print(myWeight);
    myWeight[20] = "";
  }
}




![keyxv.png|693x171](upload://uPAEzHIUmGjFp8bXRoZaoSWE17d.png)

**BTW:** Remember that Pin-2 of the 9-pin connector of the Weighing Scale will be connected with Pin-3 of the 9-pin connector of the RS232-TTL Converter Module.

**5.** Let us reconstruct the numerical value (000.390) of the weight from the received bytes which are now in the array named myWeight[].


//-----------------
    intPart[0] = myWeight[1];
    intPart[1] = myWeight[2];
    intPart[2] = myWeight[3];
    //----------------------
    fracPart[0] = myWeight[5];
    fracPart[1] = myWeight[6];
    fracPart[2] = myWeight[7];
    //----------------------
    unsigned long intWt = atol(intPart);
    unsigned long fracWt = atol(fracPart);
    float fintWt = (float)intWt;
    float ffracWt = (float)fracWt / 1000000.0;
    float wt = fintWt + ffracWt;

/*
      Serial.print(intWt);  //0
      Serial.print("  ");
      Serial.println(fracWt);  //390000

Serial.print(fintWt);  //0
      Serial.print("  ");
      Serial.println(ffracWt);  //390000
    */
    Serial.println(wt, 3);  //0.390  Kg

I have tried every steps as given by you and @larryd but no success including this reply also

I didnot understood this one:

//-----------------
    intPart[0] = myWeight[1];
    intPart[1] = myWeight[2];
    intPart[2] = myWeight[3];
    //----------------------
    fracPart[0] = myWeight[5];
    fracPart[1] = myWeight[6];
    fracPart[2] = myWeight[7];
    //----------------------
    unsigned long intWt = atol(intPart);
    unsigned long fracWt = atol(fracPart);
    float fintWt = (float)intWt;
    float ffracWt = (float)fracWt / 1000000.0;
    float wt = fintWt + ffracWt;

    /*
      Serial.print(intWt);  //0
      Serial.print("   ");
      Serial.println(fracWt);  //390000

      Serial.print(fintWt);  //0
      Serial.print("   ");
      Serial.println(ffracWt);  //390000
    */
    Serial.println(wt, 3);   //0.390  Kg

Like how I have to add this in main code? I am new in C and in learning stage.

Thanks for your support! Do guide me further!

You have said that the Weighing Scale works fine with RS232-USB Cable + Arduino Serial Monitor at 9600 Bd; if this is really true, the circuit of Post#37 and the Sketch of Post#51 is guaranteed to work in this setup: Weighing Scale + Circuit of Post#37/RS232-TTL Module + Arduino UNO + Arduino Serial Monitor.

GolamMostafa:
You have said that the Weighing Scale works fine with RS232-USB Cable + Arduino Serial Monitor at 9600 Bd; if this is really true, the circuit of Post#37 and the Sketch of Post#51 is guaranteed to work in this setup: Weighing Scale + Circuit of Post#37/RS232-TTL Module + Arduino UNO + Arduino Serial Monitor.

Yes with RS232 to USB + arduino serial monitor/Putty/HyperTerminal at 9600 Baud rate output is perfect!
Like this (changing weights):

+000.385 Kg
+000.385 Kg
+000.100 Kg
+000.000 Kg
+000.020 KG

I just tried circuit of post #37 and sketch of post #51, serial monitor shows:
ZLy=4ZLy= and so on....

Please tell me, do I have to include this one in code?

//-----------------
    intPart[0] = myWeight[1];
    intPart[1] = myWeight[2];
    intPart[2] = myWeight[3];
    //----------------------
    fracPart[0] = myWeight[5];
    fracPart[1] = myWeight[6];
    fracPart[2] = myWeight[7];
    //----------------------
    unsigned long intWt = atol(intPart);
    unsigned long fracWt = atol(fracPart);
    float fintWt = (float)intWt;
    float ffracWt = (float)fracWt / 1000000.0;
    float wt = fintWt + ffracWt;

    /*
      Serial.print(intWt);  //0
      Serial.print("   ");
      Serial.println(fracWt);  //390000

      Serial.print(fintWt);  //0
      Serial.print("   ");
      Serial.println(ffracWt);  //390000
    */
    Serial.println(wt, 3);   //0.390  Kg

Thanks, will wait for your reply.

Looks like the Converter is NFG (not functioning good).

Your scale transmits on pin 2 therefore it is DCE, it is sitting at -V on pin 2.

DTE transmits on pin 3 on a DB09 connector, pin 2 on a DB25 connector.

The Scale has a female plug and the converter has a female plug.

It would have been nice if you told us you were using a gender changer.

You might have a wiring problem with it.

Good pictures.

larryd:
Looks like the Converter is NFG (not functioning good).

Your scale transmits on pin 2 therefore it is DCE, it is sitting at -V on pin 2.

DTE transmits on pin 3 on a DB09 connector, pin 2 on a DB25 connector.

The Scale has a female plug and the converter has a female plug.

It would have been nice if you told us you were using a gender changer.

You might have a wiring problem with it.

Good pictures.

I have ordered a new converter maybe it will arrive today.

Cable I am using to connect weighing scale connector and RS232 to TTL converter is null cable and I have checked continuity of every pin of cable and working fine.

Thanks, if new converter also doesnot work then I will try HX711 to get weight.

Yes, I should have told this thing, sorry!

Today, I will try your circuits with a fresh start, and if converter arrives today, then also it would be awesome.

Wiring problems in what way? Please ellobrate, and what is "DCE", "DTE"?

Thanks @larryd and do suggest me what should I do further.

AnshumanFauzdar:
Yes with RS232 to USB + arduino serial monitor/Putty/HyperTerminal at 9600 Baud rate output is perfect!
Like this (changing weights):

+000.385 Kg

+000.385 Kg
+000.100 Kg
+000.000 Kg
+000.020 KG




I just tried circuit of post #37 and sketch of post #51, serial monitor shows:


ZLy=4ZLy=



and so on....

Please tell me, do I have to include this one in code?


//-----------------
   intPart[0] = myWeight[1];
   intPart[1] = myWeight[2];
   intPart[2] = myWeight[3];
   //----------------------
   fracPart[0] = myWeight[5];
   fracPart[1] = myWeight[6];
   fracPart[2] = myWeight[7];
   //----------------------
   unsigned long intWt = atol(intPart);
   unsigned long fracWt = atol(fracPart);
   float fintWt = (float)intWt;
   float ffracWt = (float)fracWt / 1000000.0;
   float wt = fintWt + ffracWt;

/*
     Serial.print(intWt);  //0
     Serial.print("   ");
     Serial.println(fracWt);  //390000

Serial.print(fintWt);  //0
     Serial.print("   ");
     Serial.println(ffracWt);  //390000
   */
   Serial.println(wt, 3);   //0.390  Kg




Thanks, will wait for your reply.
  1. Please, post the screenshot of the Arduino Serial Monitor of this setup: Weighing Scale + RS232-USB + Arduino Monitor. (Press Print Scrn Button, paste in the MSWORD and enlarge, Press Print Scrn button, paste in the paint, select the image and save and then make a post.)

  2. You don't need to include those codes with the sketch of Post#51.

Coming soon with the next advice.

BTW: Why are there Kg and KG in the following (no hand edit; you should post the original.):

+000.385 Kg
+000.385 Kg
+000.100 Kg
+000.000 Kg
+000.020 KG