Sending Serial data

I have a product which is controlled via RS232 serial commands. I would like to make an intermediate board between it and what will control it using arduino, the reason for this is that I only have a switched 5v output on the object that will control it.
I have made a code

#include <SoftwareSerial.h>

SoftwareSerial Serial22(10, 11); // RX, TX

int analogPin = 9;     

int val = 0;   
int on=0;
int state=0;
int sent=0;

int burst=0;
int burstExecute=0;
int burstCount=0;
long burstMillis=0;
long changeMillis=0;
int change=0;
int activate=0;

void setup()

  Serial22.println("Hello, world?");


void loop()

  unsigned long currentMillis = millis();
  val = digitalRead(analogPin); 
  if((currentMillis - burstMillis > 1000)&&(activate==1)){
    activate = 2;
    //Serial22.print("$L 1CR");
    //Serial.println("$L 1CR");
     // digitalWrite(13,LOW);
      //Serial22.print("$L 0CR");
     // Serial.println("$L 0CR");
      Serial22.print("$L 0CR");
      Serial.println("$L 0CR");
      Serial22.print("$L 1CR");
      Serial.println("$L 1CR");

As you can see if you read the code, this sends out the desired serial data each time a state is changed, that state is changed each time the switch which controls the 5v output is toggled,
the switch must go from off to on and back to off in order to toggle the “state”
If I leave the switch on then it will pulse the state at a certain defined speed.
The problem is that the LED on PIN13 is doing what I expect, ie lighting when the “$L 1CR” command is sent and turning off when “$L 0CR” is sent. These commands are being received both over the hardware serial and software serial through FTDI chips. ( I had fun rolling back the driver after the october 1st update that blocks fake chips)
but the end product, never reacts to the commands,
when i send these commands through hyper terminal it works fine, the baud should be 19200, and flow control off, other than that stop bits, parity and data bits are all standard.
Any ideas?

What is the electrical connection to the board? Is it RS232 which is really +/- 12 V not 0 to 5V.

You know I dont know that,
But, what I do know is that when I connect it to the hardware serial port on my panasonic toughtbook it works,
When I tried with the FTDI convertors it didnt,
maybe youre right and the voltage is 12v hence the FTDI not working to send it data,
I will try to get a datasheet.

The datasheet says control is RS232.
pffffff I guess that buggered the idea of sending data to it directly with softwareserial.
Is there a way to convert it relativly easily ?

Is there a way to convert it relativly easily ?

From RS232 to UART?
I like to use the MAX232 chip for 5V systems, but the MAX3232 can operate at 3.3V and 5V.

If you are handy, maybe one of these circuits:

If you are handy, maybe one of these circuits:

Link isn't working...

so would one of these be likely to sort the problem out?

Looks OK, but is you connector a DB09 male or female also do you need any combination of RTS/CTS/DSR/DTR?

I dont think I need any reset ability,
I would remove the connector and solder it straight to the arduino and other device,

this looks interesting

Would this be what im looking for?
its pricey, but available locally and I need to get it working quickly,

ok , it wasnt locally available,
im now looking at this

they will ups it to me, and they are nice people :slight_smile: