Sunday, July 15, 2012

Bits and Baubles, or the components you'll use.

If you follow me on twitter, you probably have seen me ramble on about LEDs. I think they're great, and believe they're one of the singularly most useful components a theatrical artist can keep stocked. I get most of mine from Super Bright LEDs. They have a good selection of products suitable for use in props and practicals, and their store is easy to browse, providing good information about each part. (I am a big fan of these in particular).

If you're getting into electronics for the first time, I recommend picking up some kind of starter kits for basic components: resistorscapacitors and maybe some other sundry bits. These basic components are important when it comes time to build any circuits. Don't forget to pick up that new Arduino!

That kit at SparkFun includes a few linear regulators, which will be an important thing to have on hand if you build your LED related props the way I do.

Getting power to the project is something you can accomplish in a few different ways. If it's a hand prop, then batteries are the obvious choice. The Arduino board contains regulators, and can easily powered with anything from 6-20v. This can be batteries, or a simple wall-wart if you project doesn't need to be mobile.

For initial design phases, I really recommend a decent-sized breadboard, this will allow you to build circuits without soldering, to test ideas or just play around with electrical concepts. You'll also want a multimeter, either a basic one, which will serve you just fine as long as you remember to turn it off, or a slightly fancier one. Auto-ranging is a nice feature to have, and might save you from blowing a fuse.

A soldering iron is important, and I will never recommend something from radio shack. This seems like a decent option, for relatively little cash. I'll admit my own soldering station is fancier, but I'm particular about my tools.

Basic hand tools, diagonal cutters, needlenose pliers, maybe one of those fancy automatic wire strippers. Hookup wire. Maybe some switches and cheap, low-power LEDs for output purposes. If you stick with electronics you'll see yourself gathering a fair bit of stuff, but it's all useful.

I don't think I've missed anything that you'll want to get started playing, but if you've got any questions definitely let me know.

Saturday, July 14, 2012

The Arduino in theatre, or why you should be putting computers in your sets.

I've decided that this subject might need to be split into a couple parts, for my own sanity in the organization of information, if nothing else.

For my money, the Arduino is the greatest thing to be available to theatre props and electrics departments for a long time. This $30 board gives anyone with a computer easy access to low-level computing. Microcontrollers have a lot going for them: They're cheap, they're tiny, and you can power them just about however you'd like. Until the development of the Arduino, there was a significant technical barrier to entry. One had to purchase a programmer and deal with datasheets hundreds of pages long. To accomplish basic tasks, registers had to be massaged and timers coaxed.

An example of running an atmega328 on protoboard.
The only support components here are the crystal just
to the right of the chip, the two capacitors, and whatever
you decide to use to provide 5v power.
No more. The Arduino platform offers the user an inexpensive, all-in-one prototyping and development platform. Using the capable Atmega 328, the Arduino offers plenty of I/O, flash and RAM for any prop/practical related purposes. Taking your Arduino projects off the dev board is trivial, and with the ability to purchase mega328 chips with the Arduino bootloader pre-installed for $5.50 (with the required support components costing another few dollars) any number of places online means your projects can fit anywhere you can find space for a small protoboard, available at your local decently-stocked Radio Shack.

A microcontroller is a small computer, built into a single chip. These computers contain everything needed to run programs, and offer basic logic-level outputs and inputs. They can be used for something as simple as blinking some LEDs in a repeated pattern, or as complex as your imagination allows. In the world of theatre, they allow us to build small, low-power dynamic effects that can fit anywhere, be built very quickly, and updated 'in-system' for fine-tuning.

Arduino is programmed with easy-to-read, C++-like syntax called Wiring. Here's a sample, from my latest project:


void increment() {
    for(j = 0; j < 4; j++) 
      values[j] += directions[j]; 
      analogWrite(leds[j], values[j]); 
      delay(10);     
}   
    for(i = 0; i < 4; i++) { 
      if (values[i] < 25 or values[i] > 175) { 
      directions[i] *= -1; 
    }
  }
}

As you can see, if you've done any programming at all in the past, this is pretty straightforward. The really useful additions are commands like 'analogWrite()' which offer easy, one-line access to powerful features of the microcontroller. analogWrite() is used to set a PWM (pulse-width modulation) level to one of the output pins, allowing you to easily dim an LED or control the speed of a motor.

The biggest strength of this approach to dynamic effects, in my mind, is that they can be programmed and put into place, then powered from a dimmer. This means you can have complex effects anywhere you have a free dimmer, without the need to run a control signal. Alternatively, plenty of folks have implemented DMX on the Arduino and other microcontrollers (and this is actually on my list of projects to tackle), meaning you could easily assemble inexpensive automation controllers or anything else you'd like to control from your light console.
Stuff everything in a box and hide it.
In my next post, in the next day or two, I intend to delve into the basic electronics knowledge you'll need to start building the most interesting props and practicals you've ever used. Stay tuned.