Weird device to Uno

Hi i dont know if im in the rigth topic but anyway, I got som old components from a lab and im trying to get data from a measuring device.
the device have a weird connector but Luckely they are labled
BAT, GND, syson, TXO, RXO

My guess is the following
BAT v soucs 3.3v
GND obvious
Syson to power on the device for measuring (same as one of the buttons)
TXO Serial com
RXO Serial com

the thing also had a battery connected(not thru the connector).
I usally only use ardoinos for servos and stuff so this is totally new for me.

so what i need help with is 1 figure out what to connect where and 2 how to read the data from the serial com.
I have tried to solder on som cables to the connector (sens its an weird connector) and use some code i found for a range finder (sens that is what i think it is) just to try to get some data.

This is the code:

 #include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3); 
unsigned char data[8]={0};
void setup()
{
Serial.begin(9600);
mySerial.begin(115200);
}

void loop()
{
//mySerial.print(buff);
while(1)
{
if(mySerial.available()>0)
{
delay(50);
for(int i=0;i<7;i++)
{
data[i]=mySerial.read(); 
Serial.print(data[i]);
}

  float distance=0;
      distance=data[6]*256+data[7]*0.001 ; 
      Serial.print("Distance = ");
      Serial.print(distance);
      Serial.println(" M");
      
delay(20);
}
}
}

And this is what i got from the serial monitor : 0255255255255255255Distance = -256.00 M

What makes you think it's 3.3V ?

Depending how old this "old" gear is, it might be before the days of 3V electronics...?

Serial connections on old devices are often +/-12V RS232 (or, at least positive and negative). If so, you need an RS232 adapter to connect it to Arduino.

If you can power up the device, do not connect TXO and RXO to anything else, and use your multimeter to measure the voltages from those connectors to ground.

1 Like

Some pretty wild guesses there!

Even if it is also a rangefinder, there's little likelihood it will use the same (or, even, anything like) protocol ...

The battery was a 3v battery

Please post photos of the connectors, labels and insides of the box.

2 Likes

Software Serial is limited to 38400 baud, and can be unreliable at that rate.
You are better to use 9600. If the device you are trying to connect is known to be 115220, then a different processor with multiple hardware serial ports is required.

2 Likes

What sort of battery?

1 Like

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