RS232 Serial communication from 3 pin sensor to arduino UART

Thread Starter

KKAMIN

Joined Sep 23, 2017
13
Hi guys,

I've got an old brookfield viscometer & temperature sensor that has a 3 pin sensor output for RS232. (RX, TX, and GND.) I'm trying to get data from this sensor and read it with an arduino as my company has lost the controller for this device many moons ago. I'm currently wired to the box with a DFRobot RS232 Shield. On this shield you can see there are 4 pins, RX R232, TX RS232, VCC, and GND. I currently have the TX line from the sensor wired to the RX line on the sheild, the RX line from the sensor wired to the TX line on the sheild, and the GND from the box wired to the GND on the sheild. (I'm unsure of what the role of the VCC pin is in this scenario).

I'm using the following code:

Code:
int temp = 0;

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

void loop() {

if (Serial.available() ) {
 
       temp = Serial.read();
       Serial.println(temp);
    }
}
The baud rate from the sensor box is set at 9600 as well, per the old manual I have that I've discovered. There are no parity bits or handshakes. I am able to get some bursts of numbers in the serial monitor but I'm not sure what they mean or how I can correctly read the sensor.

The numbers will repeat with minimal change with something like the following:

57
65
46
15
32
100
78
45
13
Repeat....

Is there something I can improve on that would make sense for this to work?
 

Thread Starter

KKAMIN

Joined Sep 23, 2017
13
You may be close, but does the manual not have the RS232 data out format?? What is the model # of the unit?
I've converted the data to ASCII per Eric's suggestion and I'm able to get the data out, just a matter of cutting up the data into arrays and strings to port it out to an excel sheet. So far so good. Thanks for the input.
 

ericgibbs

Joined Jan 29, 2010
18,864
hi KK<
The 13 number is CR [carriage return code] I would use that as the value delimiter code.
E
BTW: You could swap the 13 [CR] into a Comma code and port into the spread sheet as a 'csv' text file.
 
Top