use arduino to control projector via RS232?

Hi folks!

I already made some experiments with my Arduino Diecimila, mainly connecting various sensors to my computer and also controlling servo motors from the PC through the Arduino board.

Now I’m wondering whether I can use the serial communication capability of the board to send some serial commands to a projectors RS232 input. It’s a Dell MP5100 projector and I do have a PDF containing the pin assignment, the communication settings and the possible command sets, please find some lines of it included below.

So bascially my question is whether I can send those commands using the RX and TX pin of my Arduino…

Connection Settings:
Baud Rate 19200 bps
Data Bits 8 bits
Parity None
Stop Bits 1 bit
Flow control None

Control Command Syntax (From PC to Projector):
[AC][SoP][CRC][ID][SoM][COMMAND]
[AC][SoP][CRC][ID][SoM][COMMAND][Value]
Example: Power On Command (Send Low Byte Firstly)
Enter the following code:
0xbe, 0xef, 0x10, 0x05, 0x00, 0xc6, 0xff, 0x11, 0x11, 0x01, 0x00, 0x01
Header ==> Fixed, “be (Low Byte), ef (High Byte)”
Address Code [AC] ==> Fixed, “10”
Size of Payload [SoP] ==> Byte size from MsgID to Command Code, “05 (Low
Byte), 00 (High Byte)” or Byte size from MsgID to Value, “06 (Low Byte), 00
(High Byte)”.
CRC16 [CRC] ==> CRC value, “c6 (Low Byte), ff (High Byte)”
MsgID [ID] ==> Fixed, “11 11”
MsgSize [SoM] ==> Byte size of Command Code, “01 (Low Byte), 00 (High
Byte)” or Byte size of Command Code and Value, “02 (Low Byte), 00 (High Byte)”
Command Code [COMMAND] ==> “Power On” Command, “01”

Yes you can, either with the hardware uart pins 0 & 1 (if you disconnect the Arduino from the USB and then hook up to the projector) or any pair of pins using one of the software serial library routines. However for either case you will need a little extra hardware assistance in the form of voltage translators to convert the +5vdc logic level to the bipolarity voltage levels required for RS-232 connections. A MAX232 type chip and a few caps would do it, or you can purchase converter modules like these:

http://www.sparkfun.com/commerce/product_info.php?products_id=133

http://www.sparkfun.com/commerce/product_info.php?products_id=8780

Should work just fine.

if this is a permanent installation, you may want to get a MAX232 model arduino clone, which has the MAX232 and a DB9 serial connector, and in kit form is half the price of a USB arduino.

-j

Thats a great suggestion, and also the first Arduino clone board I purchased. Works great, build time is short.

Lefty

Hey, thanks for the quick replies, you're great!

So if I understand you right, when I want to use the serial communication capability to connect to my projector, I can not connect to a PC at the same time? Or is this possible if I would leave the standard RX and TX pins for the USB connection and use two other pins as software serial pins? Because I think I need to tell the Arduino board from a PC when the projector is supposed to turn on/ off...

Thanks also for the links to these converter modules. Could you post me some links for the »MAX232 type chip and a few caps« in any online electronic shop as well? As always the problem is that I have limited time left, so I'm not sure whether there is enough time to order the parts online but the more precise I know what I need the easier I can get it here in a local electronics store (I'm located in Germany at the moment). Are those parts rather special parts or rather common, so likely to be found in an electronic store?

This Arduino clone sounds good as well, but they say it may take 1-2 weeks to ship them to Europe, so that's too long for this time...

Ok, I did some research on TTL to RS232 converters, here's what I found:

http://www1.conrad.de/scripts/wgate/zcop_b2c/?~template=pcat_product_details_document&zhmmh_area_kz=&product_show_id=190200&gvlon=&p_back_template=deeplink&p_load_area=$ROOT&p_artikelbilder_mode=&p_sortopt=&page=&p_catalog_max_results=20&cachedetail=# looks strange in this cable form, but the description sounds good link to the english data sheet: http://www.produktinfo.conrad.com/datenblaetter/175000-199999/190200-an-01-en-Funk_Daten_Modems_RS232_TTL.pdf

http://www.watterott.com/MAX3232IDR-RS232-Transceiver only the max232 chip - what else would I need additionally?

http://www.pollin.de/shop/shop.php?cf=detail.php&pg=Nw==&a=MzY5OTgxOTk= only German description, it says »small and compact module to convert the 5V TTL level of a serial interface (e.g. microcontroller) to the bi-polar level (-15V/+15V) of a serial PC interface«

here's the link to the data sheet: http://www.pollin.de/shop/downloads/D810036B.PDF (also german, but with drawings/ diagrams)

maybe you guys can tell me whether that's somehow what I need or whether I'm totally wrong...

This link: http://www.produktinfo.conrad.com/datenblaetter/175000-199999/190200-an-01-en-Funk_Daten_Modems_RS232_TTL.pdf

is for a wireless product - did you want/need to go wireless?

If you go the MAX 232 route, I suggest you buy the DIL version, because it is easier to solder. You'll also need some 1uF 16V electrolytic caps (about four or five IIRC), and about 1 square inch of stripboad.

http://datasheets.maxim-ic.com/en/ds/MAX220-MAX249.pdf

However, for minimum hassle and for just 4 euros, I'd go with pre-built module http://www.pollin.de/shop/shop.php?cf=detail.php&pg=Nw==&a=MzY5OTgxOTk=

You can't use t RX adn TX pins on the arduino for rs232 or USB communications. The RX/tX is for TTl Serial. For USb you need an FTDI chip, and for serial you need the max232 serial. the USB arduino board has a usb conenctor and a FTDi chip on it to allow for USB communiaction, but ti will only work if you go through the usb connector, you can't strip the cable and connect it directly to the RX/TX slots.

If you can't wait the two weeks, I'd buy a MAX232 from whichever vendor you have nearby. If you still want to mantain communcation to your PC via USB, you can use software serial with the MAX232 as long as you don't use the desgnated RX/TX pins..

So I can have two pins working as software serial pins and connect the MAX232 chip to them and the chip to the projector, right?

Do I need something else with the MAX232 or is it really just the chip where I have to connect my cables to?

You'll need five or six capacitors to connect to the MAX232 chip. I think it needs 0.1 uF.

No, the MAX232 needs a handful of external capacitors to work. It isn't difficult, but unless you're confident in soldering and reading circuit diagrams, you're better off buying a pre-built module.

I see, thank you!

If you look at the diagram at the top of page 17 here: http://datasheets.maxim-ic.com/en/ds/MAX220-MAX249.pdf

For a MAX232, you'll need 5 x 1uF, or for a MAX232A 0.1uF. I suggest all rated at least 16V.

You need to reproduce this and connect it to a D-type connector, or directly to your cable, as well as 5V and ground.

Thank you for your great efforts! As long as the module from Pollin.de definitely works for my purpose, that's the perfect solution for me at the moment...

If I didn't already have MAX232s in my spares box, I'd go for the module. About the worst that could happen would be that Rx/Tx were the wrong way around for your RS232 cable >:(

No, you can't use the USB port and something attached to pins 0 and 1 at the same time.

You can use software serial on other pins, though. If you only talk to the projector and don't need to receive from it, this is an easy option.

-j

Yeah - but is there any way to figure out whether the Arduino serial capabilities go together with the requirements of my RS232 projector interface?

Connection Settings: Baud Rate 19200 bps Data Bits 8 bits Parity None Stop Bits 1 bit Flow control None

So, simple three wire, no xon/xoff or RTS/CTS to worry about. All the rest is pretty standard, so long as the library can handle the bit-rate.

You guys are simply awesome. THX for the great support here!