Sign up ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I get the data from a sensor which is in RS485. I am using RS485-RS232 Converter. Then its given to uart usb converter and I get the data in TTL. I am able to receive the data in uart (hyperterminal). I have connected the TX, RX, GND pins to 10, 11, GND pins of Arduino UNO. I want to communicate it with Arduino UNO through SoftSerial and here is the code

#include <SoftwareSerial.h>
#define rxPin 10
#define txPin 11

SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

void setup() {   
    pinMode(rxPin, INPUT);
    pinMode(txPin, OUTPUT);
    mySerial.begin(9600);
    Serial.begin(9600);  
}

void loop()
{  
    while (mySerial.available() > 0) {
        Serial.println("Data is available");
        Serial.println(mySerial.read());
    }
} 

But I'm not able to see the data on serial monitor.

share|improve this question
    
After converting it to RS232, its given to uart converter where i get data in TTL - please edit your post to show your wiring. – Nick Gammon Aug 7 at 9:42
    
Also please show what these mysterious converters are that you have used. Model numbers, connector types, etc. – Majenko Aug 7 at 11:22
    
The phrase "given to uart usb converter" immediately rings alarm bells to me - is this something that you plug into a USB port, and you are now trying to connect it to a TTL UART input? – Majenko Aug 7 at 11:33
    
Did you reverse tx and rx pins? – Visual Micro Aug 7 at 13:15
    
Majenko...Its an nT RS422 to RS232 converter.After that its connected to UART USB converter which has max3233. I'm getting data properly at hyper terminal. Then i have connected RX TX pins of it to TX RX of microcontroller. But not able get the output. – Mikku Aug 7 at 15:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.