Hello,
I am having some confusion interfacing with a load cell with a URS232A, RS232 to UART converter, which has the MAX232 level converter included.
I was previously successful getting a readout from the load cell but got sidetracked and when returning to my project focused on implementing other sensors and then trying to implement the RS232 later (Assuming it would be working).
When I run the code below, I get the error saying that the load cell cannot be found.
I am providing 5V to the URS232A, ground is connected and URS232A RX is connected to TX3 and vice versa on the MEGA
The information from the load cell is formatted in 8 data bits, 1 stop bit, no handshaking, no parity and is set up for continuous transmission. Manual Attached, page 20
int BAUD_IDE = 9600;
int BAUD_LOAD_CELL = 9600;
char serialData = "";
int data[15];
// serial port from weight controller
byte x;
void setup() {
Serial.begin(BAUD_IDE);
Serial3.begin(BAUD_LOAD_CELL);
delay(250);
}
void loop()
{
if (Serial3.available()) {
int count = 0;
while (count < 15){
x = Serial3.read();
Serial.write(x);
Serial.print(" , ");
data[count] = x;
delay;
count++;
}
Serial.println();
for(count = 0;count<15;count++){
Serial.write(data[count]);
Serial.print(",");
}
delay(2000);
Serial.println();
}
else
{
Serial.println("Error: can not communicate with load cell");
delay(2000);
}
}
op-900-manual.pdf (409 KB)