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?
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.
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:
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:
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.