Controlling both a projector and a screen with a Raspberry Pi

Earlier this year the co-working space we are located in (DIGS) mounted a projector in the ceiling. At the same time they also got a motorized projection screen. This introduced some unforeseen challenges.

How do we turn the projector on/off? We don’t have any remote! And it’s mounted to high to reach… And is it possible to automate the projector screen?

 

Mounted projector
Mounted projector

This room was the same week fully booked with events every night. So there was no time to order any remote, and we needed a solution asap.  Since this is a “public” event room, it’s highly desired with something that is easy to use, and works every time. It’s also highly appreciated to minimize the number of remotes.

KISS – Keep It Simple, Stupid

From earlier experiences I know that many projectors have the option to be controlled over RS-232. But the drawback with RS-232 is that you need to make some kind of long RS-232 cable (not impossible, but…) and an interface in the other end. It could work, but it’s not as simple as I wanted.

The projector has among all the different connectors an Ethernet port, and a brief look in the manual confirmed that it is possible to control it over Ethernet.

As always, a Raspberry Pi were casually laying on one of my desks, and the following sketch where made:

Principal scheme

Since I’m not that familiar with Python, I saw a great opportunity to get some more experience with it. Before I started making the hardware, I wanted to make sure I could control the projector over Ethernet. To control the projector you can send it a properly formatted TCP or UDP packet. Google and a good friend of me helped out with the projector communication.

The following code is used to send and get commands:

def cmd_set(cmd):
     sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     sock.bind(('', port))
     getcmd = ":" + cmd + '\r'
     #print "OUT >> ",getcmd
     sock.sendto(getcmd, (address, port))
     indata, inaddr = sock.recvfrom(32)
     #print "IN << ",inaddr,":",indata
def cmd_get(cmd):
     sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     sock.bind(('', port))
     getcmd = ":" + cmd
     getcmd += '\r'
     #print "OUT >> ",getcmd
     sock.sendto(getcmd, (address, port))
     indata, inaddr = sock.recvfrom(32)
     #print "IN << ",inaddr,":",indata

Then I made the hardware with a couple buttons, led’s and some optocouplers. To interface these I used the GPIO pins on the Raspberry and the RPi.GPIO library for Python.

Unfortunately I don’t have any pictures of the process, but here is the finished result:

Raspberry Pi underneath, and the projector screen remote on top.
Raspberry Pi underneath, and the projector screen remote on top.

 

Side view
Side view

 

Front view
Front view

Now every user at DIGS can simply press “ON” and the screen will go down and the projector will turn on. And when you leave, just press “OFF”, and a pre programmed shut down sequence will start.

Related Posts