Bruce's Blog Just another in the neverending world of blogs

21Jan/100

Controlling PC/Mac software from a DMX console

I seem to be working on more and more shows where video is used, usually controlled via something like a PowerPoint or Keynote presentation running on a Mac or PC.  Being able to control that remotely via a lighting console would be useful for a number of reasons.  Not only does it let you synchronize things more closely, but it makes it easier for a stage manager to call a show, and also easier for a running crew since they don't have to worry about whether the next cue means pressing something on the lighting console, something on a keyboard or laptop, or both.

You can find commercial products available that let you simulate pressing a key on a PC/Mac keyboard via DMX, such as Rosco's KEYSTROKE™, but unless you need to trigger lots of fancy key sequences then the approx. $400 US price tag may be a little much for you.  If all you want is an inexpensive way of pressing a button like the space bar via DMX then there are much more inexpensive ways if you don't mind a little tinkering.

You basically need two components.  First, you need a DMX decoder that lets you toggle a switch or relay.  The only other thing you need is a module that lets you simulate pressing a key on a USB keyboard.  There are numerous ways of doing both, and depending on how much you're willing to spend and how much you're willing to tinker you can spend as little as $0 on a solution.  $80 or so may be more likely, but even that is a much better price to pay than the commercial products!

The DMX interface

If you have an old DMX device lying around you may be able to cannibalize it for its DMX decoder circuit.  If not then you can buy a one channel DMX relay for as little as $40 from places like ApogeeKits or All Spectrum Electronics. For a bit more you can get 4 or 8 channel DMX relays from places like Northlight Systems or Blue Point Engineering. Depending on how fancy you want to get a single channel relay is likely enough for most needs.  Do you only ever plan to control something like PowerPoint or Keynote?  If so then you only need to remotely trigger a single keystroke.  If you need more then how many individual keystrokes do you need?  So 1 may be enough for most cases, but 2, 4, or even 8 may provide you with additional flexibility.

The Keyboard interface

If you have an old keyboard lying around then you already have all the remaining parts you need.  With very little effort you can find many websites that discuss keyboard hacking, or taking apart a keyboard to make use of the guts so that you can make other devices send keystrokes to a PC.

If you don't have an old keyboard lying around or don't feel like cracking one open to cannibalize it then you can always buy a USB keyboard encoder, which is basically a device that emulates a keyboard.  This is the approach I chose for a few different reasons.  After hunting around for a while I came across the U-HID Nano, which at $35 fit both my budget and my needs perfectly.  This tiny module (only about 1.5" long) is fully programmable via a Windows app and lets you specify up to 8 individual keys to emulate.

The U-HID Nano

Things to be Aware of

Depending on what components you scrounge/hack/buy there are various issues you should be aware of.  If you hack a keyboard to use as the PC interface then make sure you're fully aware of how the keyboard behaves.  By default, Windows, OS-X, linux, etc. all treat a prolonged key press as a signal to repeat that key over and over until you let go of the key.  So if your DMX console sends a prolonged signal to your DMX relay you may find that it results in the computer you're trying to control interpreting it as multiple key presses.  If you are trying to control an application like PowerPoint this way then you could find yourself cycling rapidly through slides when you don't mean to.  You might be able to deal with this by doing some rather precise timing work with your lighting console or going into your PC's settings to reduce the keyboard repeat rate, but neither of those are very "neat" solutions.  If you're fine with that approach then more power to you!

This is one of the reasons why I decided to go with the U-HID Nano device mentioned above.  One of its nice features is that it supports a "pulse" mode for emulating keystrokes.  When it receives a signal on one of it's control pins it sends a momentary key press rather than latching the keystroke down until the signal is removed.  In this way you can trigger a momentary key press by setting the DMX value of the appropriate channel to a non-zero value and you don't have to worry about quickly setting the DMX channel back to zero or about the PC interpreting the key press as a repeated one.

If you go with a device like the U-HID Nano or hack a keyboard and decide to support more than one keystroke then the next question to ask is whether you want to use one DMX channel or more.  Since a single DMX channel provides 8 bits of data you could apply one bit to each keystroke. (It sounds like the U-HID Nano is almost made for this!)  Using a single DMX channel can save an otherwise scarce resource if you have a limited number of free/available DMX channels.  The problem here is that you can easily find yourself in a situation where you send keystrokes that you don't want to, and you may find it very difficult to work with your DMX/keyboard module.   If you accidentally fade the DMX channel up/down in a lighting cue you'll find it generating all sorts of unwanted keystrokes.

By mapping a single DMX channel to a single keystroke you make management of keystrokes much easier.  If you trigger a keystroke by setting a channel to a non-zero value then you won't accidentally trigger more keystrokes if that channel then fades to another level.  An 8-channel DMX relay is more expensive, but if you only ever expect to need to send one or two keystrokes during a given show then a one or two channel relay should be plenty for your needs.  Again, since the U-HID Nano is fully programmable, you can change the keystrokes it sends in just a few seconds. If all you need to do is send a single keystroke so you can automatically cycle through PowerPoint slides then a single channel DMX relay and a U-HID Nano would make an excellent combination for less than $100.

My Setup

I actually had an 8-channel DMX relay from Blue Point Engineering sitting idle from a previous project I needed it for.  I simply wired all the common terminals of each relay together and then attached them to pin 1 of the U-HID Nano.  Each of the remaining pins then went to the normally open pin of one of the relays.

I also picked 8 keystrokes that I'm most likely to use and programmed one for each of the 8 pins on the U-HID Nano.  Using the configuration utility you can download from their website I set each pin to be a key switch with the down action set to "Pulse Primary" and the up action to "Clear".  The completed box works like a charm!

19Nov/090

DIY Portable Fake Fire Effect

Flame lights like the Le Maitre "Le Flame" and the Chavuet "Bob" are pretty decent flame effects, but there's one small problem with them, and that's that they have to be plugged into a power source.  A couple years ago I helped a theater put together a portable fire effect since their show called for an actor to carry around a metal trash can that he would eventually "burn" some paper in.  Unfortunately I didn't take any photos of what we put together, but I'll run down it here since it's relatively straightforward.

The key to a good portable fire effect is having a decent power source.  Most modern theaters likely have one readily available, and if the theater doesn't then you're bound to find that you or a friend already has one.  Here's a hint:

dewalt-12v-cordless-drill

The battery pack from most cordless tools should provide you with an excellent power source.  The reason you want to use a battery pack like this is because you need a compact power source that provides enough current to power both a fan and multiple halogen lights.  Since these batteries provide enough current to provide decent torque for drilling, sawing, etc. then it'll also power a fan & lights without any problems.  On top of the battery pack you'll want a few other things:

  • One or two 12 or 24 volt (depending on your power source) MR-16 halogen bulbs, either clear or red/orange.
  • A 12-volt fan.  You can cannibalize one from an old PC or buy one from a local computer supply store.
  • A piece of very light white fabric, preferably silk.  If you don't have any readily available you can buy replacement silk for commercial fire effects for about $10.  Google will provide you with plenty of sources.
  • Some wire, a small switch, and a couple alligator clips.
  • Whatever you want to mount the fire effect in (a small trash can, etc. or even just a small framework that can be easily moved).

Simply mount the fan in the trashcan about two inches below the lip. Make sure it's mounted so the airflow is upwards, out of the trash can.  You'll also want to mount a couple of fins on opposing corners of the fan in such a way that they partially disrupt the airflow of the fan.  If you don't do this then when you turn on the fan the silk will simply stand straight up in the column of air coming from the fan and won't look like a natural flame at all.

Once you have the fan mounted I suggest you hook it up to the battery and test the silk. If you bought a replacement silk for a commercial flame effect then it likely has magnets glued to its base that you're supposed to use to attach it to the flame effect.  If you used pieces of metal for your fan fins then you should be able to attach the silk directly to them.  You may need to cut the silk to fit your needs, and also spend some time adjusting the fins to ensure the silk flutters sufficiently to look like a realistic flame.

Mount the MR-16 lights on opposing sides, angled inward to a point towards the silk.  If you have white bulbs then you'll probably also want to attach some colored  gel to the lights.  Wire the bulbs and fan in parallel, routing them through a switch.  Mount the switch somewhere around the lip of the trashcan where it can be easily flipped by an actor without being seen.  Use alligator clips to connect the appropriate leads from the fan/lights and the switch to the battery and you should be all set.

One word of warning: The 12-volt MR-16 halogen bulbs can get hot very quickly.  Make sure they're properly insulated and also make sure anybody handling the flame when in use is aware that they'll heat up.

12Nov/090

DIY Fake Fireplace Effect

I recently was asked to put together a fake fire effect for a small community theater. They wanted a fireplace full of burning embers, not a full flame effect that can be done with flame lights.  To create this effect you basically need two things: a light source that flickers like a flame and something translucent that looks like burning embers that will flicker in the light.

I initially did some searching for fire glass to see if there were any readily available products to simulate burning embers, but didn't have any luck finding anything that looked realistic enough.  Eventually I came up with the idea of trying to make my own, and with a little more research I came across a handy tutorial that demonstrates how to make fake ice cubes out of plastic.  I ended up using that as a template for making my own fake burning embers, expanding on the concept by including colored plastic in my fake ice cubes.  Here's a quick tutorial:

Go to your local hobby shop and purchase some clear plastic beads.  Kyle, the guy behind the ice cube tutorial bought his at WalMart.  I found mine at AC Moore, a craft store chain with stores all along the East Coast.

Beads

Get some sheets of lighting gel, preferably a few different shades of orange/red.  If you don't have a ready supply of gel then you can order some on-line from places like Production Advantage.  Depending on how much you need to make you might not need entire sheets of gel so you might want to see if you can get one or more companies to send you a sample swatch book for free.

You'll want to shred the gel(s) into small pieces in order to mix it up with the plastic beads.  I ran a few small sheets of orange & red gels through my paper shredder:

DSC_0008

Make some forms out of aluminum foil in various shapes (you don't want all your embers to be 100% identical).  I used things like batteries, a flashlight, and small cardboard boxes as forms, wrapping aluminum foil around them.  Then fill the form up with a mix of plastic beads and strips of the shredded gel.  Don't overdo it with the gel, at least at first.  You probably want to experiment a bit to figure out the right mix:

DSC_0019

Fill up the form with more plastic beads, then place it in an oven at 400 degrees for approx. 20 minutes.  You should keep an eye on it to make sure the form doesn't leak and the beads are melting.  If the beads aren't fully melted after 20 minutes just leave them in the oven longer and consider turning up the heat slightly.  The gel strips have a much higher melting point (after all, they have to sit directly in front of 1000 watt stage lights for long periods of time) so don't be surprised if they don't melt like the beads to.  The color should still spread out throughout the mold as the beads melt.

Once the beads have melted take the mold out of the oven and give it plenty of time to cool.  Remove the foil and you should end up with a translucent block of plastic:

DSC_0023

If you're not happy with your first attempts then don't fret.  You can always break up the plastic blocks using a hammer and then melt them down again in new forms.  Add more beads and/or pieces of gel to get them to look more like what you want.

The next important aspect of making a good fake fire is making a good flickering light effect.  If you're doing this in a theater and you have a good quality DMX-based lighting system you might be able to program an effect to simulate this, but that's a lot of work and can be a hassle if it has to be added to multiple cues.  After hunting around a bit I found a product called FauxFlame which is an electrical device you wire to an incandescent light to make it flicker randomly.  I bought a couple of these to add to my inventory of lighting toys and wired them into a couple electrical boxes so I can plug any light into them that I want.

The theater had an existing hearth with a few lights mounted inside it.  I installed a couple regular household incandescent bulbs wrapped in orange/yellow gels in the hearth, then put a dozen or so plastic embers on top, along with some fake fireplace logs that were bought from a local hardware store.  The lights were plugged into a FauxFlame and the result is quite impressive.  Here are a few photos and a link to a video showing the effect in action.  The set isn't complete yet, so pardon the appearance of the fireplace.

IMG_0163

IMG_0158

IMG_0157

IMG_0156

And here's a video of the fireplace in action:

17Oct/090

DIY DMX Dowser

A few months ago I was working on a show where I needed the ability to dowse a video projector.  The problem with using video projectors in theater is that even when projecting a solid black image the projector is projecting light, so you can still see a big dark square when in a blackout.  To work around this you use a dowser, which is essentially just a piece of black plastic that drops in front of the projectors lens when not in use.  Companies like City Theatrical sell DMX dowsers that do precisely this.  They are just a box that you attach to your projector that drops a plastic shield in front of the lens upon the appropriate DMX command. The problem with these dowsers is that they are EXPENSIVE!  The City Theatrical dowser will set you back approx. $600, which is rather steep for what it does.  If you hunt around you can find other DMX projector dowsers for sale, but they're all over $200.

I had a servo from a radio controlled airplane lying around unused and with a little bit of hunting I came across a company that sells a DMX to servo controller.  This lets you control up to 8 servos via 8 DMX channels, so it gives you a lot more flexibility than the commercial solutions.  With a little bit of work, if you're into tinkering, you can build your own custom DMX dowser with more features than the $600 City Theatrical one.  I initially only needed a single dowser so I hacked together something quick using this DMX/servo controller and the spare servo, but at a recent show I needed to be able to dowse two projectors located 20 feet apart, so I decided to make more of a project out of my dowser.  Here's what I did:

First, you'll need the DMX/servo controller board and one or more servos (if you don't already have them).  The DMX/servo controller operates at 12 volts, but servos typically run at 4.8 volts, so you need a way to address this difference.  The answer is a relatively simple adjustable DC power supply.  These are the guts of what I used for my dowser, just three components:

Item Cost
DMX/servo controller board from Northlight Systems $49
Hi-Tec HS-422 servo from ServoCity $12.50
Positive Adjustable Power Supply available many places $20

So for three components that cost approximately $82 you can build your own dowser rather than spend $200-$600 for a commercial one.  Note that the power supply is a kit that you'll need to solder together yourself.  If you hunt around a little you can find for sale for around $5 less, but most websites I found are selling it for around $20.  I actually purchased mine at a local DIY/hobby shop in MA called "You-Do-It" Electronics.  Of course you'll probably also want to buy a case to put everything into and some other hardware components, but your total cost will likely still be in the neighborhood of $100.

When I built my dowser Northlight Systems only offered one DMX/servo controller with the DMX addressing switches mounted directly on the board.  I bit the bullet and used this, deciding to set it to the address 505 so that it would use the 8 channels 505-512.  I figured this was the safest range to use as it's less likely to be used except in really large venues or where lots of other DMX devices are used.  Of course I can always open it up and change the addresses if I need to.  But you now have the choice to buy a controller with the address switches mounted on the circuit board or on an external board that you can mount separately.  It's entirely up to you.

Depending on how fancy you want to get you'll likely want to purchase a few more things like a plastic case in which to mount everything, XLR connectors for the DMX connections, etc.  I'll leave all of that up to you to decide how you want to do it.  At the very least I would suggest you purchase a coupler to connect your servo to a shaft, a matching shaft, and a clamping collar.  The collar gives you an easy way to attach a dowser or other items to the shaft.

I decided to splurge when I redesigned my dowser.  I put everything in one case to make it easy to use, but I also built two remote servos that I could easily add to it if necessary.  To support the remote servos I added two XLR connectors to the dowser that let me plug in the other servos.  Each remote servo is just mounted in a smaller box with a long cable connecting to an XLR cable.  The controller has no problem controlling servos 10 feet away or more.

Here's what my device looks like:

dmx_servo

The 12 volt input feeds to both the variable power supply and directly to the 12v into the DMX/servo controller.  The variable power supply is tuned according to its instructions to provide the 4.8 volts needed for the servo power inputs on the DMX/servo controller.  Everything should be very straightforward.

Once you've put all the components together just take a piece of cardboard or heavy plastic and cut an appropriately sized dowser out of it.  I bought a black plastic report binder from a local office supply store which works quite well.  Mount the device where you need it and measure the distance from the servo shaft to the farthest edge of the projectors lens.  Add a couple inches to make sure it's not too small.  To mount the dowser to the servo shaft you can make use of the clamping collar and an ordinary paper clip.  Just unbend the paper clip into a U shape then pass the U through the tightening nut of the clamping collar.  Then bend the ends of the paperclip so that the entire thing is flush with the edge of the clamping collar.  Use some gaff tape to tape the paperclip to the dowser and you're all set.  Here's a photo showing how to do this:

servo_attachment

That's all there is to it. A fully functional DMX dowser for less than the cost of a commercially available one.  And you can easily make use of other servo devices, multiple servos, etc. with his home-brew version.  Before I built my dowser I worked on a show where I had to have rose petals flutter down onto the stage from overhead.  If I had my dowser for that effect I would have just taped a small piece of cardboard horizontally to the servo shaft and put the petals on top of it.  At the appropriate time just turn the servo and the petals would have dropped onto stage on cue.

A couple things to keep in mind if/when you're building one of these:

  • Use a 12 volt power supply since that's what the controller board requires.  If you use servos that require 4.8 volts or some other voltage then use the variable power supply to convert the 12 volts to whatever you need.  Make sure to measure the output of the power supply and adjust it as necessary before hooking it up to the controller board.
  • The servo shaft couplers are rather large.  If you mount your servo in a case like I did then make sure the servo can turn through its entire range of motion without the shaft coupler hitting anything.  You may need to turn the servo all the way in one direction to figure out the appropriate positioning of the coupler, then turn the servo all the way in the other direction to make sure the coupler swings freely.
  • Servo's don't have a ton of torque so make sure the hole that the servo shaft passes through is large enough so as to not introduce a lot of friction.  Also be sure the servo is lined up properly so the shaft passes through the hole without rubbing against the sides.

If you'd like any more details on this or have any specific questions feel free to post a comment or e-mail me directly (click on "About" at the top).

12Oct/090

Remotely controlling lights, etc. from a smartphone

I've been thinking for a while how nice it'd be to be able to remotely turn my front walk light on when it's dark out and nobody is home. I'd been considering buying a home automation kit that integrates with a Mac or PC but figured there must be an easier (and cheaper) way of doing it. Then it dawned on me that since I already have a linux server running at home, and have some X10 modules and a serial interface that I've got everything I need, so here's what I did. First, what you need:

  • A linux system running Apache or another web server that supports PHP.
  • The x10 Firecracker kit.  You'll need both the Firecracker module and the x10 transceiver.
  • One or more x10 modules to control remotely.
  • The Bottlerocket software (I used version 0.04c) that communicates with the Firecracker
  • My x10 PHP code.  Use it as-is or use it as a template for writing your own.  It's GPL'd, so have at it.

I'll leave it up to you to set up your web server & PHP support.  There are plenty of resources for it on the web.

Download and install the Bottlerocket software.  Plug the Firecracker module into your PC's serial port, plug the transceiver into a wall outlet and set it's house code to whatever you want.  Use the Bottlerocket software to ensure everything is working.  It's easiest to just try this as root:

# /usr/local/bin/br A7 ON
# /usr/local/bin/br A7 OFF

The above commands should toggle the device with address A7 on and off.  If you encounter any problems then make sure the Home code on both the transceiver and any other x10 modules are all set the same and make sure you're using the right unit number.  Also make sure the serial port is enabled and nothing else is currently using it.

Make sure the serial device can be written to by your web server.  For some reason on my CentOS system the serial console is set to be writable only by the root owner and uucp group.  Apache is running using the apache user, so all I did was add the apache user to the uucp group then restarted Apache.  If you want to test this then simply su to the apache user or use sudo to invoke /usr/local/bin/br as apache and make sure it can also control your x10 device(s).

Install the two files from x10php.tar.gz somewhere on your web server.  The x10.php file you shouldn't need to modify (unless you really want to).  Edit x10-config.php and make sure the $cmd variable points to the br binary, and also include any optional parameters you might want to include.  Modify the $x10_device and $x10_group arrays to suit your needs.  Their format should be very self-explanatory.

Test the PHP scripts by pointing a web browser to the appropriate URL.  You should see a screen that looks something like this:

x10menu

Click on the links to test the devices.  If you have PHP properly installed and set up the Bottlerocket, Firecracker, and permissions on your serial port properly then the devices should respond as expected.

Now for the really neat part...  If you have wifi and a wifi-enabled smart-phone or PDA that you carry with you regularly then you can bookmark URL's that let you quickly & easily turn devices on and off.  For example, using the default settings in the x10-config.php file you would turn on the Front Walk lights via the following URL:

http://(your_linux_box)/x10.php?cmd=ON&id=D16

Just add that as a bookmarked link and call it something like "Turn on Front Walk lights" and if you're outside and need the lights just pull out your smartphone and click on the link.   As long as you're close enough to your wifi it should work without any problems.

Of course if you have a cable modem, FiOS, etc. you should be able to set things up to do this from anywhere, so you can turn on your lights as you're heading home from the store or work or whatever.  If you're going to do this then I'd suggest a few things:

  • Set up basic authentication in your web browser to require a userid & password to access x10.php, otherwise anybody who figures out the URL could turn your devices on/off.
  • Use SSL in conjunction with the above to ensure the userid & password is encrypted when it's sent.
  • Make sure your linux box is firewalled (but open port 80 or 443 or whatever you decide to use) and properly patched.

If you decide to do the above then here's another simple but effective trick.  First, use a service like DynDNS to set up an easy to remember DNS name for your server.  Once you've done that, then modify the URL's in your smartphone to include your userid & password so you don't have to always remember them.  (Many browsers in smartphones don't remember passwords for you).  To do this just update the URL on your smartphone to be in this format:

https://userid:password@DynDNS_hostname/x10.php?cmd=ON&id=D16

Simple, cheap, and effective remote control of your lights & other devices from your smartphone.