Using Arduino UNO to control Dell™ C5518QT Monitor through Serial RS232

Hey Guys,

I have recently hit a road dump on a little Arduino Project and would appreciate any assistance or suggestions.

I have hooked up a Arduino UNO R3 to a TTL RS232 Shifter and hope to control the Dell™ C5518QT Monitor by sending a command through the Arduino serial port. The Arduino receives inputs from 5 external buttons each with their own LED and then sends out the corresponding command to the monitor. These commands are found in the Dell data sheet attached.

At this point in the project everything has been soldered and testing has begun with the monitor. Using the serial monitor built in to the Arduino IDE I can check that the Tx port is outputting the correct bytes. However, the monitor shows no response to the command.

I am unsure if Serial.write(); is sending the command as I have imagined it to, or if the Dell Monitor is receiving the signal properly.

Right now the Tx LED lights up on the TTL - RS232 shifter when a button is pressed.

I have included the code below for reference and I'm currently looking for a way to isolate the problem.

Please let me know what further information may be required to help troubleshoot.

// Define Button pins
 const int button_OFF = 2; //button_OFF is connected to port #2
 const int button_Computer = 3;
 const int button_Laptop = 4;
 const int button_Vol_Up = 5;
 const int button_Vol_Down = 6; 

 // Define LED pins
 const int led_OFF =  8;      
 const int led_Computer =  9;
 const int led_Laptop =  10;
 const int led_Vol_Up =  11;
 const int led_Vol_Down =  12;
 bool SYSTEM = 0; //System On/Off flag. 0=off, 1 =on.

 byte Monitor_ON[] = {0x37, 0x51, 0x03, 0xEA, 0x20, 0x00, 0xAF};
 byte Monitor_OFF[] = {0x37, 0x51, 0x03, 0xEA, 0x20, 0x01, 0xAE};
 byte Volume_UP[] = {0x37, 0x51, 0x06, 0xEA, 0x62, 0x01, 0x00, 0x00, 0x00, 0xE9};
 byte Volume_DOWN[] = {0x37, 0x51, 0x06, 0xEA, 0x62, 0x02, 0x00, 0x00, 0x00, 0xEA};
 byte Input_HMDI1[] = {0x37, 0x51, 0x03, 0xEA, 0xB3, 0x01, 0x3D};
 byte Input_HMDI2[] = {0x37, 0x51, 0x03, 0xEA, 0xB3, 0x00, 0x3C};


 
void setup() {
   Serial.begin(9600);  //set baude rate
   
   // initialize the buttons as input
   pinMode(button_OFF, INPUT);
   pinMode(button_Computer, INPUT);
   pinMode(button_Laptop, INPUT);
   pinMode(button_Vol_Up, INPUT);
   pinMode(button_Vol_Down, INPUT);
   
   // initialize the LED pins as an output
   pinMode(led_OFF, OUTPUT);
   pinMode(led_Computer, OUTPUT);
   pinMode(led_Laptop, OUTPUT);
   pinMode(led_Vol_Up, OUTPUT);
   pinMode(led_Vol_Down, OUTPUT);

  //Defualt state = OFF
   digitalWrite(led_OFF, HIGH); 

}



void LED_Reset(){ //Turns all input LED's off
  digitalWrite(led_OFF, LOW);
  digitalWrite(led_Computer, LOW);
  digitalWrite(led_Laptop, LOW);
}

void loop() {
        
   if (digitalRead(button_OFF) == HIGH) {
     while(digitalRead(button_OFF) == HIGH){} //wait for button release before action
     LED_Reset();
     digitalWrite(led_OFF, HIGH); 
     SYSTEM = 0; //system flag off

     Serial.write(Monitor_OFF, sizeof(Monitor_OFF)); //Write to TX pin
     Serial.println(); 
    
     
   }
  if (digitalRead(button_Computer) == HIGH){
    while(digitalRead(button_Computer) == HIGH){} //wait for button release before action
    LED_Reset();
    digitalWrite(led_Computer, HIGH);
    SYSTEM = 1; //system flag on

    Serial.write(Monitor_ON, sizeof(Monitor_ON)); //Write to TX pin
    Serial.println(); 
    Serial.write(Input_HMDI1, sizeof(Input_HMDI1)); //Write to TX pin
    Serial.println(); 
  }
  if (digitalRead(button_Laptop) == HIGH){
    while(digitalRead(button_Laptop) == HIGH){} //wait for button release before action
    LED_Reset();
    digitalWrite(led_Laptop, HIGH); 
    SYSTEM = 1; //system flag on

    Serial.write(Monitor_ON, sizeof(Monitor_ON)); //Write to TX pin
    Serial.println(); 
    Serial.write(Input_HMDI2, sizeof(Input_HMDI2)); //Write to TX pin
    Serial.println(); 
  }
  if(digitalRead(button_Vol_Up) == HIGH && SYSTEM == 1){
    digitalWrite(led_Vol_Up, HIGH);
    while(digitalRead(button_Vol_Up) == HIGH){} //wait for button release before action
    digitalWrite(led_Vol_Up, LOW);

    Serial.write(Volume_UP, sizeof(Volume_UP)); //Write to TX pin
    Serial.println(); 
  }
    if(digitalRead(button_Vol_Down ) == HIGH && SYSTEM == 1){
    digitalWrite(led_Vol_Down, HIGH);
    while(digitalRead(button_Vol_Down) == HIGH){} //wait for button release before action
    digitalWrite(led_Vol_Down, LOW);

    Serial.write(Volume_DOWN, sizeof(Volume_DOWN)); //Write to TX pin
    Serial.println(); 
    }
}

REAL_RS232-Protocol-Document.pdf (175 KB)

Double check that RX and TX are correctly connected at the monitor. On most devices, you can safely swap the two connections without causing damage. Use your DMM to check the TX line voltage -- it should be -5 to -12V to ground in the idle state.

I would start with just the simplest example from the data sheet, and get that working first:

Example: Get Monitor Name
[From PC to Monitor] = 37, 51, 02, EB, 01, 8E
[From Monitor to PC] = 6F, 37, 0F, 02, 00, 01, 44, 65, 6C, 6C, 20, 43, 35, 35, 31, 38, 51, 54, 1A

jremington:
Double check that RX and TX are correctly connected at the monitor. On most devices, you can safely swap the two connections without causing damage.

I would start with just the simplest example from the data sheet, and get that working first:

I am using an RS232 cable to connect from the TTL-RS232 shifter to the RS232 port on the back of the monitor so I assume the connections are in the right positions.

On the note of reading a reply from the monitor, I am uncertain if that can be done while plugged into the PC itself. If I am not plugged in, I cannot actually read an input without the serial monitor. It looks like the PC uses the Rx and Tx ports when communicating with the PC via USB so I have to unplug the Rx and Tx ports every time to upload code to the controller.

I assume the connections are in the right positions

If all else fails, consider reevaluating that assumption.

jremington:
If all else fails, consider reevaluating that assumption.

The Tx and Rx ports are working as expected. The shifter has successfully converted the idle(0V) to a -10V and the high (5V) to a +10V. Wondering if I am missing something important with how the monitor receives commands.

You code looks basically OK to me. I'd remove the Serial.println() statements - the manual doesn't mention needing newlines.

The shifter has successfully converted the idle(0V) to a -10V and the high (5V) to a +10V.

"Idle" at TTL levels is +5V, which should be -10V on the output of your shifter. (but that sounds like a misunderstanding, rather than something that is wrong in your circuit. -10V is correct idle state.)
Rule of thumb for old-style serial connections: the cable is wrong, somehow.

westfw:
You code looks basically OK to me. I'd remove the Serial.println() statements - the manual doesn't mention needing newlines.

"Idle" at TTL levels is +5V, which should be -10V on the output of your shifter. (but that sounds like a misunderstanding, rather than something that is wrong in your circuit. -10V is correct idle state.)
Rule of thumb for old-style serial connections: the cable is wrong, somehow.

Does the code output the right signals at how you are describing the voltage levels? Since it looks like the highs and lows are inverted after the shifter.

You have been told twice that you need to check whether RX and TX are connected correctly.

Good luck with your project.