4

I have recently purchased a projector, and on the back, there is a Round RS232 port. After a quick google, I found this document which seems to describe a protocol that MIGHT (I'll need to do more research) be used to control the projectors functions, such as (what i'm interested in manipulating):

  • Power On/Off
  • Select Source (VGA/HDMI in my case)
  • Volume +/-/mute
  • Keystone +/-

But, I don't have any experience of Serial Programming, so I was wondering, what sort of circuitry would be appropriate to connect a Raspberry Pi's GPIO pins to the projectors RS232 Port?

Also, any information on libraries for reading from and writing to the serial port would be good?

I have tried Googling around, and have found a few resources, but I am not too sure on what I am looking at. Are there any nice, concise tutorials that should:

  1. How to wire a Raspi to a Serial Device safely
  2. How to write a program that can interact with the Serial device

ADDITIONAL

I have done a bit more searching, and I have discovered that the input labelled RS232 on the back of the projector is a 3 Pin Mini Din Port. On this, I am also unsure which is the Tx, Rx, and Gnd, so if anyone has any help on that front, that would be brilliant

MANY YEARS LATER

(I have opted not to list this as an answer, as its slightly out of scope for the original question, and I didn't want to irk others looking for an RS232 solution)

Almost 4 years have gone by since I asked this, and I thought I would share my simpler solution.

I simply attached a 38 khz Infrared Transmitter (and Receiver for configuration), and then used LIRC to send the commands, which could be invoked as a script from wherever (PHP, Python, Java). This was so much easier to migrate than having to re-wire/re-code the Pi when I broke the first projector.

3

Unless you want to mess about with the GPIO UART port, your best bet would be to use a USB→Serial adapter. I'd strongly recommend trying to find one with a chipset by FTDI; you pay a little more for these, but they just work. Plug it in, and a serial port called something like /dev/ttyUSB0 will appear.

For talking to the serial port, you have lots of options. pySerial might be a good one. Install it with:

sudo apt-get install python-serial

Here's some (untested) code that might make it work:

import serial
ser = serial.Serial('/dev/ttyUSB0', baudrate=9600, bytesize=EIGHTBITS, 
                    parity=PARITY_NONE, stopbits=STOPBITS_ONE)
ser.write("~AI" + chr(0x0d))    # select Auto Image mode
ser.close

This may send an unwanted newline to the projector. But I hope you get the idea about how to send the other commands.

4

RS232 isn't a protocol. It's about how the protocol is transmitted/received.

Importantly the voltage levels are not compatible with the 0-3.3V of the RPi UART.

The good news is that there are chips to make this conversion easier MAX3232

  • Ah, thank you. Since this is not something that a Pi does naturally, I shall take this question over to the electronics site (unless someone would like to move it) – topherg Dec 15 '13 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.