Serial Projector control with ESPHome

Hook your rs232 converter up to a serial port on a PC, a USB to serial adaptor is fine if your PC does not have a physical serial port.

Open a terminal on your PC (e.g. Putty), connect to the comm port, 9600 baud 8/N/1.

Turn your switch on and off.

Do you see the commands printed in the terminal?

To anyone who tries this and fails (like I just did). You must use double quotes when you want ESPHome’s uart component to interpret special charaters in the data field correctly. This is explained here. And yes, you find this out using the method that tom_l suggested.

I have tested the code below and it works with an Epson EMP-TW700 projector. It should work with any ESP/VP21 protocol projector (as e.g. listed here)

uart:
  tx_pin: 39  # Change these settings as needed.
  rx_pin: 37
  baud_rate: 9600
  id: projector_uart

switch:
  - platform: template
    name: "Projector Power"
    assumed_state: True
    optimistic: True
    turn_on_action:
      - uart.write:
          id: projector_uart
          data: "PWR ON\r\n"
    turn_off_action:
      - uart.write:
          id: projector_uart
          data: "PWR OFF\r\n"

Also, I suggest adding assumed_state: True to the switch. This is the correct way of handling switches that do not have a feedback. The switch icon becomes a lightning bolt, and you can turn the projector on or off multiple times without having to toggle the switch (e.g. when you forget to switch on the mains or you use the remote as well).

Cheers, AndBu

2 Likes

I have feedback.

You might too. It comes from the screen trigger output.

With the code below, the LED on the MAX3232 flashes when I turn the switch on/ off from HA. But the projector (Epson Home Cinema 3200) does not respond. So I guess the communication upto the projector is ok? Unable to think of what to do next.

uart:
  tx_pin: GPIO1  # Change these settings as needed.
  rx_pin: GPIO3
  baud_rate: 9600
  id: projector_uart

switch:
  - platform: template
    name: "Projector Power"
    optimistic: true
    turn_on_action:
      - uart.write:
          id: projector_uart
          data: "PWR ON\r\n"
    turn_off_action:
      - uart.write:
          id: projector_uart
          data: "PWR OFF\r\n"

I also tried hooking my PC with Putty on it to the projector. I connected a USB TTL device to my laptop. Tx to the MAX3232 Rx and vice versa. Selected my COM port and opened the putty window but the blank putty window that opened wouldnt let me type anything into it.

The terminal should work.

How should I troubleshoot? The putty window opens but there is no prompt, nothing. Nothing can be typed into the window either. Tried using another USB TTL device too. Same thing.

Do you need to enable the serial connection in your projector menu?

The terminal just worked for me.

Try using a straight serial to USB adapter to connect direct your PC to your projector. Something without TTL conversion as your PC and projector both work at RS232 voltages, something like this: https://www.jaycar.com.au/usb-to-db9m-rs-232-converter-1-5m/p/XC4834

From memory I had issues with Putty too. Can’t remember which terminal program I ended up using,

1 Like

I bought the cable (though not costing 40 bucks like the one in your link)

Seems to detect on the port just fine. But the result is the same, a cursor in the window which I cant type anything into. This time im using teraterm instead of putty.

What are your serial settings?

Should be 8,N,1 and none, 9600 baud.

Also check in windows Device Manager that the port driver is installed correctly.

I am trying something similar at the moment. I hooked up the UART of my ESP32 to an MAX3232 based TTL-RS232 Converter. Unfortunateley the projector is not reacting on any commands. I though can receive messages when turning on the projector with the remote.

I hooked up my oscilloscope to the Converter and can confirm that the RS232 Converter is working flawlessly. I think the problem is the MAX3232 with its +/-5.4V output levels as classical RS232 has +/-12-ish V Levels. So the projectos RS232 Controller may not correctly detect HIGH and LOW Levels. Maybe its also a bit luck regarding tolerances in the projectors RS232 controller and the MAX2323. This would explain why it’s working for some and for some dont. Also it would explain why I can receive but not transmit.

You have to send a carriage return after each command.