RS485-RS232 converter with Arduino YUN

Hello, I need help to connect a fingerprint device which uses rs485. I am using SoftwareSerial in Arduino, and then I am using pins 8 and 9 for RX and TX respectively.

The connection is basically like this:

FINGERPRINT DEVICE ==> RS485/232 CONVERTER ==> ARDUINO YUN

I am pretty sure that i have connected the circuit in the right way, but I dont know if I have to do a configuration in Arduino or at least, how it works?? I set it up for 9600 baud, 8N1

I tested the FP device with a laptop, the RS485/232 converter and a Serial/USB converter and I get exactly what I sent, therefore the RS485/232 converter is working well, it can communicates with my laptop and sends the data. Then I connect it with Arduino YUN and i dont get anything, not even a rare symbol.

I know SoftwareSerial is working well because I have an HID card reader and it works perfectly when i change the DB9 connector to this HID device, i get the correct data.

I hope you can help me, I attached the code and some pictures of my connection.

#include <SoftwareSerial.h>

SoftwareSerial mySerial(8, 9); // RX, TX

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(57600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}

void loop() { // run over and over
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}

I dont know if Arduino YUN is already working 9600 baud, 8 data size, 1 stop bit, no parity. Well, i know it's working with 9600 because i set that in the code, but i dont know the rest.

carloshm:
FINGERPRINT DEVICE ==> RS485/232 CONVERTER ==> ARDUINO YUN

I don't think this will work - you cannot connect an RS-232 port directly to an Arduino's I/O pins. RS-232 uses different voltage levels and the opposite polarity than what is used on the I/O pins. This link gives a reasonable explanation: RS-232 vs. TTL Serial Communication - SparkFun Electronics

I tested the FP device with a laptop, the RS485/232 converter and a Serial/USB converter and I get exactly what I sent, therefore the RS485/232 converter is working well, it can communicates with my laptop and sends the data. Then I connect it with Arduino YUN and i dont get anything, not even a rare symbol.

Yes, that RS-232 adapter will work with your computer, as it is expecting RS-232 signaling levels. But as you have already found out, it won't work with the Arduino.

You need to convert the RS-485 levels to the TTL levels uses by the Arduino pins. That means you either need a converter that can go from RS-485 directly to TTL levels, or you need an additional converter to go from the RS-232 output to TTL.

I know SoftwareSerial is working well because I have an HID card reader and it works perfectly when i change the DB9 connector to this HID device, i get the correct data.

Yes, SoftwareSerial can work well, if it's getting the right signals. I assume that the HID card reader is outputting TTL level outputs instead of RS-232.

I hope you can help me, I attached the code and some pictures of my connection.

It's good that you identify all of the devices, but seeing the actual connections you have made would be very helpful. For example, if you are going from pins 2&3 of the RS-232 converter to pins 8&9 of the Yun, it will not work - you need a different type of conversion.