Arduino UNO -> Projector via RS232, general questions

Hi. Working on a project here to control a projector (a Panasonic PT DZ6700U) via RS232 from my Arduino Uno. The ultimate goal is to have the arduino turn off one of the lamps at a certain time, then back on at another time. Right now however, I have some general questions about RS232 Communication from the Arduino. My first question: Do I really need a voltage shifter ( A MAX232 chip like : RS232 Shield V2 - DEV-13029 - SparkFun Electronics) if I am just sending commands from the Arduino? How can I tell if the RS232 chip in the projector is 5V compliant ? There seems to be limited information on the web about this stuff but I have found helpful links here: http://www.churchmedia.net/forums/general-projection-systems/46769-rs232-control-panasonic-projector.html

That last link there helped me understand the format of the commands to send, like the STX and ETX values, and I am fairly certain I have my wires connected in the right place. Where I am now is connecting the DB9 wire to the projector, then connecting, from the male end of the wire, pin 5 to Arduino ground and Pin 2 to the Arduino's TX Pin. I am sending the messages "02!P!O!F!03" or "02!50!4F!46!03" (POF command to turn off projector) via Serial and SWSerial (in which case I have tried pin 10 for TX) with no results. Can anyone give me guidance on this project? I am very willing to buy the MAX 232 if I have to, but I think the arduino's signal should be enough? I really don't know. Also if anyone knows about the necessity of handshaking or connecting the receive pin to wait for a completed bit from the projector? Thank you guys in advance !

My first question: Do I really need a voltage shifter ( A MAX232 chip like : RS232 Shield V2 - DEV-13029 - SparkFun Electronics) if I am just sending commands from the Arduino?

Only if you want the projector to understand them. The chip works in both directions, converting TTL to RS232 AND converting RS232 to TTL.

How can I tell if the RS232 chip in the projector is 5V compliant ?

Read the datasheet.

Input supply voltage range, VCC (see Note 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . −0.3 V to 6 V

I am sending the messages "02!P!O!F!03" or "02!50!4F!46!03" (POF command to turn off projector) via Serial and SWSerial (in which case I have tried pin 10 for TX) with no results.

As text? Where is your code?

Hi Paul S thank you for the amazingly fast reply. So your answer to the shifter sounds like a definite "Yes you need this", because of course I want the projector to understand my messages :slight_smile: . Which datasheet are you looking at when you post the info about VCC and what does that really mean? And to send the messages my simple code is this:

  Serial.print("02");
  Serial.print('!');
  Serial.print('P', HEX);
  Serial.print('!');
  Serial.print('O', HEX);
  Serial.print('!');
  Serial.print('F', HEX);
  Serial.print('!');
  Serial.print("03");

but I think the arduino's signal should be enough?

The you would be wrong, not only is the voltage wrong but the signal is upside down.

Do I really need a voltage shifter ( A MAX232 chip like : https://www.sparkfun.com/products/13029) if I am just sending commands from the Arduino?

Yes you do if it is RS232 you are communicating with.

There seems to be limited information on the web about this stuff

Oh come on!

Where I am now is connecting the DB9 wire to the projector, then connecting, from the male end of the wire, pin 5 to Arduino ground and Pin 2 to the Arduino's TX Pin.

So to recap where you are now is feeding +/- 5 to 12 V signals into a TTL device, that is a great way to damage your Arduino.

Can anyone give me guidance on this project?

Yes buy a MAX 232 converter.

Also if anyone knows about the necessity of handshaking or connecting the receive pin to wait for a completed bit from the projector?

Read the data sheet of your device to see if it needs handshaking signals, not many systems that only transfer a few bytes need that.

Serial.print('P', HEX)

NO!!!!!!!!!

Serial.print('P')

Which datasheet are you looking at when you post the info about VCC and what does that really mean?

Your link (when done properly) was https://www.sparkfun.com/products/13029.
Under Documents, on that page, there is a Datasheet link.

It means that 5V will drive the TTL side of the chip, as will 3.3V.

And to send the messages my simple code is this:

I find it difficult to believe that anyone would write code for a projector that expected that mess as input. I suspect that it expects binary data as input, not text data.

Ok so we've got two grumpy and snide, albeit somewhat helpful, contributors to this thread. Mike, your name suits you. I really don't love being attacked for asking questions, but.... I need help so I will ask more. I was rather referring to the projector's RS232 chip being able to accept s 5V signal, you two have clarified that this is not possible, thank you..... I will buy the RS232 shifter.... now as for the code (AKA "that mess"):

I was attempting to send HEX data to the projector, as I have been led to believe that this is in fact what the projector expects. So Mike, why not use the HEX parameter in the print function? "NO!!!!" tells me little. I didn't think that I had my code right but now I know I have it wrong. Are you two willing to help me?

I really don't love being attacked for asking questions,

You were not attacked for asking questions, if any attacking was going on (which I would dispute), it was because you were refusing to accept the answers.

why not use the HEX parameter in the print function

When in doubt read the "manual"

An extract from that says:-
Serial.print(78, HEX) gives "4E"
So that is two byte it is sending, the ASCII for 4, which is 0x34, and the ASCII for E which is 0x45.
So the HEX parameter is not what you want.

If you want to send the ASCII for the capital letter P ( which is the hex number 50 ) then you can use either
Serial.print('P')
or
Serial.write(0x50)

Put "ASCII table" into google images for a full list.

Aha ! Thank you Mike, I suppose I was misunderstanding the way the print function worked, or perhaps how HEX and ASCII differ. Ordered my RS232 shifters, will report back tomorrow. Thanks for the help, you two. ~~~ Yall may b grumpy but u sure r smart ~~~

gruel:
Aha ! Thank you Mike, I suppose I was misunderstanding the way the print function worked, or perhaps how HEX and ASCII differ. Ordered my RS232 shifters, will report back tomorrow. Thanks for the help, you two. ~~~ Yall may b grumpy but u sure r smart ~~~

I hope you have been able to find a description of the protocol used to allow a computer to talk to the projector. I have looked a bit, but have found nothing.

Paul

Hello all, an update. I have got this working, it was fairly simple once I got the RS232 shield for the Uno. Paul_KD: See page 46 of this PDF, this is what helped me the most in the end with what messages it expects and what commands are available. Here is my code with a couple commands in there. Everything works swell in HEX.

#include <SoftwareSerial.h>

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

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);

}

void loop() {

  delay(1000);

  /* //POWER ON
  mySerial.write(0x02);
  mySerial.write(0x41);
  mySerial.write(0x44);
  mySerial.write(0x5a);
  mySerial.write(0x5a);
  mySerial.write(0x3b);
  mySerial.write(0x50);
  mySerial.write(0x4f);
  mySerial.write(0x4e);
  mySerial.write(0x03);
  */

   //POWER OFF
  mySerial.write(0x02);
  mySerial.write(0x41);
  mySerial.write(0x44);
  mySerial.write(0x5a);
  mySerial.write(0x5a);
  mySerial.write(0x3b);
  mySerial.write(0x50);
  mySerial.write(0x4f);
  mySerial.write(0x46);
  mySerial.write(0x03);
  

  /*//Switch to DVI
  mySerial.write(0x02);
  mySerial.write(0x41);
  mySerial.write(0x44);
  mySerial.write(0x5a);
  mySerial.write(0x5a);
  mySerial.write(0x3b);
  mySerial.write(0x49); //I
  mySerial.write(0x49); //I
  mySerial.write(0x53); //S
  mySerial.write(0x3a); //:
  mySerial.write(0x44); //D
  mySerial.write(0x56); //V
  mySerial.write(0x49); //I
  mySerial.write(0x03);
*/

  delay(1000);
  
  if (mySerial.peek() == -1) {
    Serial.println("no response");
  }
  while (mySerial.peek() != -1) {
    Serial.println(mySerial.read());
  }
}

One more question for the forum though.... The responses I am getting from the projector are HEX as well, but when I put them in a HEX to ASCII converter, they are gibberish. For example "80 79 70" (translates to: "€yp" and the 80 has no equivalent) or "73 73 83 58 68 86 73" (translates to: "ssƒXh†s") .. It's not a big deal but I'm just wondering why, anyone seen this before? Thanks Mike and PaulS for the help!

1 Like

That link will not work for me so I can't check the manual but:-

"73 73 83 58 68 86 73" (translates to: "ssXhs")

But if those numbers were decimal numbers you get:-

73 I
73 I
83 S
58 :
68 D
86 V
73 I

and IIS:DVI sounds like a format a projector would be in.

Thanks again Grumpy Mike, awesome. So awesome. Curious that the projector is sending responses in this format, no where in any manual does it say it will send decimal numbers back....

And you're right about the link, I think the forum doesn't like the format of the FTP link, for anyone looking at this forum in the future if you add a colon in there after "ftp" and before the "//" it should work.

ftp://ftp.panasonic.com/projector/guide/pt-dz6710u_6700u_dw6300u_d6000u_series_instruction_guide.pdf

Like so.

no where in any manual does it say it will send decimal numbers back.

It is not. It is sending back ASCII.

All data in a computer is just a bit pattern. When YOU come to interpreter that bit pattern you can look at it as ASCII or HEX or DECIMAL, or indeed many other things, the bit pattern is still the same. It only acquires meaning when you impose that meaning on the bit pattern. All data is just bit patterns that is what makes computers so universal.

How were you displaying those bit patterns?

It is only when you come to display them that conversion from a bit pattern to what you see takes place. So a simple print will display those bit patterns to you as a decimal number because decimal is the default setting of print.