The SETUP

In my spare time, I perform improv with a team called, Direct To Video. We met taking a class at the UCB Theater in Hollywood, and do a form called, "The Improvised Movie". The form is probably pretty much what you're imagining right now: we get a suggestion from the audience, and then improvise a 20-minute condensed movie, relying heavily on genre conventions and tropes. It's fun to perform and (on most nights) pretty funny to watch, but there's always been something that bothered me about doing shows, and I wanted to figure out a way to fix it.

The PROBLEM

Twice a month, our team hosts a show at The Moving Arts Theater in Los Feliz, and I man the lightbooth to play house music before the show begins, introduce the show, and cut the lights in between teams, blacking them out at a point when both their time is up, and hopefully, they are at a high point in their set. This works great most nights, but requires me to spend most of our show in a stuffy light booth, instead of in the air conditioned audience. As well, when our team comes up to perform, there is nobody in the light booth to black us out, so we have to "call our own show". This basically means that, in the middle of what is hopefully a big laugh, someone from the team has to walk to the front of the stage and awkwardly proclaim something along the lines of, "And that's our show!". Neither of these things are that bad, but they could be better, and I had some spare time on my hands, so I thought I'd try and fix them - WITH TECHNOLOGY!

The SOLUTION

My idea was simple: I would create an iPhone app that I could use to control the music and lights for our show remotely.

I already had a Bluetooth Audio Receiver, so I figured I could use that for the remote music control, but the lights seemed a little more complicated. I decided that I would start by building the app before I delved into the trickier lighting controls.

I wanted the design of the app to be as simple as possible, leaving little room for human error when running a show. I broke the show up into 3 parts: Opening, Other Team's Sets, and Our Set, and created a flow that only had the necessary buttons for each section on the screen at any given time. At the top of the screen, I always displayed both the current time, as well as a counter that showed the amount of time that had elapsed since a given part of the show had started, in order for me to keep track of how long each team had gone. I also had a hidden debug button that allowed me to reset the app to each of the various phases. 

Once I had completed the flow of the app, I added a "House Music" button to the initial screen which essentially shuffled through an array of different songs to play before the show began, making sure to never play the same song twice. I had to add the music to the array before I built the app, rather than just pulling from my phone's music library, but I figured it would suffice for the time being.

With the core app functionality in place, it was time to figure out how to control the lights.

PHASE 1: The only buttons available are to start the show and play House Music.

PHASE 2: These buttons allow me to start and stop another team's show, and start our team's.

PHASE 3: The only thing I can do is stop our team's show. (I leave my phone at the side of the stage so anyone can do this)

DEBUG MENU: Accessed by tapping on the Time, this allows me to reset to a specific phase, or change the servo rotation (if the light switch is on the opposite side of the hardware)

The IMPLEMENTATION

I figured that I could use an Arduino to control the lights, but as I didn't own the theater, and the lighting setup was somewhat haphazardly wired I didn't feel confident adding any components to the booth's electrical system. I decided instead on using a servo manually flip the master light switch (since I really only needed to black out or turn on all of the lights at any given time), meaning that not only would I not have to deal with any wiring, but also that I could easily take my device home after each show. 

Writing the Arduino code to power the servo was actually quite simple. I basically wrote two functions that moved the servo's position to a specific angle (flipping the light switch off), moved the servo back to it's center position, waited a moment, and then moved the servo to a different angle (flipping the light switch back on), before finally returning the servo's angle back to it's starting position again. With that completed, all I needed to do was find a way to have my app tell the Arduino to fire the function.

I knew I was going to have to talk to my Arduino via Bluetooth, but after a little research I found that while it was pretty easy to add Bluetooth functionality to an Android app, on iOS, they were far more restrictive without going through official submission channels. Fortunately, Apple allowed the use of Bluetooth Low Energy on its devices, and didn't require the same process to enable that in an app. I quickly found an asset on the Unity Asset Store that allowed a Unity app to communicate via BLE, and added it to my app.

On the Arduino side, I purchased an HM-10 BLE module for 6 bucks, and connected it to the Arduino's RX and TX pins. I then setup the Software Serial library, so that the serial communication could be handled by my BLE module. With the BLE Module in place, I setup my Arduino code so that it would listen to the Serial Port, and when I passed a number through (via my app), it would call function based on the number!

Finally, on the Unity side, I wrote a script that would pass through a number to the Arduino's Software Serial Port when a button was pressed. When the Arduino heard that number, it would call the function in its code, and move the servo accordingly! After a little fine tuning to get the devices to connect via Bluetooth, it worked!

 

 

The HM-10, the six dollar answer to my dreams!

 

It’s Alive!

The HARDWARE

Ahh, the Internet; the cause of, and solution to, all of life's problems! (Paraphrasing Homer Simpson on alcohol)

There was one last problem. While the app functionally worked great, there was nothing attached to the servo. This meant that while the servo moved, it wasn't able to actually flip on or off a light switch. 

I had a variety of weird ideas on how to remedy this, including, but not limited to, supergluing a pencil with a rubber finger to the servo, but after a surprisingly small amount of googling, I hit the jackpot: a 3D model, ready to print, for a light switch plate mounted servo! It turns out that my idea of using an Arduino to flip a light switch on and off wasn't as novel as I had thought! (Though using them in combination with an iPhone app in order to remotely control the lights at a small theater was still the height of originality!) I downloaded these plans from Thingiverse, and was able to email them to a local 3D printer, who had my pieces the next day!

After putting together the mounting hardware, I purchased a small case that I could use to store the Arduino and the BLE Module, as well as a 9-volt battery to power the device. With everything in place, I was ready to try it out!

IN PRACTICE

After a few live adjustments during shows, I managed to get the app to work pretty flawlessly, minus the occasional "fat finger" user error. I've been using the app at our shows for the past couple months, and it's worked like a charm! I've added a few modifications to the app, in an effort to stop accidental button presses and the like, but all in all, it's been both a help during the shows, and a conversation piece after them! Technology and comedy make for wonderful bedfellows!