Using only tx with RS232 converter

Dear All,

I have a project where I need to make a serial (RS-232) communication between an M2M unit (it is a GPS tracker working with 12V) and Arduino.

From Arduino side only TX needed, but on RS-232 voltage level.

During the researching I have found out that, that I need a level shifter and GND most be common for both units.

I am trying to handle with this type of level shifter (also the connecting shame is the same):

https://www.google.hu/imgres?imgurl=https%3A%2F%2Fi.stack.imgur.com%2FZuoSe.png&imgrefurl=http%3A%2F%2Felectronics.stackexchange.com%2Fquestions%2F134724%2Farduino-rs232-level-shifter-or-rs2323-breakout-needed&docid=9CAo75Z6W6QQEM&tbnid=ly---h-VPlgJGM%3A&vet=1&w=1218&h=1242&bih=747&biw=1440&q=rs232%20%2B%20arduino&ved=0ahUKEwjgvK6kn_vRAhXEthQKHUOkB-IQMwhLKCcwJw&iact=mrc&uact=8#h=1242&imgrc=ly---h-VPlgJGM:&vet=1&w=1218

But no success :frowning:

Other params:
8N1, 19200

#include <SoftwareSerial.h>
byte m2mdat[] = {0xAA, 0xBB, 0x06, 0x00, 0x00, 0x00, 0x07, 0x01, 0x05};

void setup() {
  // initialize serial:
  Serial.begin(19200);
  
}

void loop() {
    // serial write
  Serial.write(m2mdat,9);
}

Perhaps the level shifter couldn’t work with only TX connection?
Or do you have any idea?

Thank you for your help!
Best regards,
V.

Perhaps the level shifter couldn't work with only TX connection?

Nonsense. The level shifter doesn't care that you are not receiving anything. Although, connecting a GPS in transmit only mode (transmit from the Arduino to the GPS) doesn't make sense.

PaulS: Nonsense. The level shifter doesn't care that you are not receiving anything. Although, connecting a GPS in transmit only mode (transmit from the Arduino to the GPS) doesn't make sense.

And the level shifter only needs to have power to the device. The transmit line will then have the proper voltage. Something equal or greater than +3 volts. My tests have +8.1 volts using a 5 volt supply. The TTL side does not even have to be connected.

Paul

Hello,

Yes, now I also tested the level shifter. It’s working fine, so I have checked the output voltage…

“Something equal or greater than +3 volts.”

Unfortunately I can get from Tx only 1,6V. Also I have tried to make myserial with different pins:

SoftwareSerial mySerial(10,11);

And I can see only 1,6V on Tx (pin11) again…
What am I doing wrong? Or is there a problem in this code:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11);

byte m2mdat[] = {0xAA, 0xBB, 0x06, 0x00, 0x00, 0x00, 0x07, 0x01, 0x05};

void setup() {
  // initialize serial:
 mySerial.begin(19200);
  
}

void loop() {
    // serial write
 mySerial.write(m2mdat,9);
}

Thx!

The problem is not in the code.

Hello,

Finally I have solved the problem. A delay needed after the serial.write.

So the code is working this way:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11);

byte m2mdat[] = {0xAA, 0xBB, 0x06, 0x00, 0x00, 0x00, 0x07, 0x01, 0x05};

void setup() {
  // initialize serial:
 mySerial.begin(19200);
  
}

void loop() {
    // serial write
 mySerial.write(m2mdat,9);
delay(100);
}

Anyway, thanks for the help!