Turn your Raspberry Pi into a DMX light controller
This instructable shows you how to display a color wheel editor window on the screen of a Raspberry Pi computer, which you can manipulate with your mouse. As you change the color on the screen, the color on the DMX light fixture changes in realtime to match. This can serve as a starting point for a variety of simple lighting projects using the Raspberry Pi ( i.e. haunted houses, onscreen light control panel, TV backlights, living room DJ setup, etc. ).
Step 1: Nuts and bolts
A standard $35 Raspberry Pi computer runs a program that generates theonscreen interface, and sends commands via USB to a DMX controller continuously. The DMX controller then sends DMX commands to the light fixture to change the color. The hardware was chosen for cost and durability, and the software was developed on the platform and is available for free in source and binary format so you can begin hacking right away. Here is what you’ll need ( as pictured ):
1. Raspberry Pi
The Raspberry Pi is an amazing $35 credit card sized computer that contains all the basic features of a “real” computer, including a free pre-built Linux operating system ( via SD card ), USB for keyboard and mouse, and most impressively a full HDMI video output. If you are new to the Raspberry Pi ( or raspi ) we strongly suggest you get your mitts on one as soon as possible – its a great platform for anyone interested in knowing more about how computers work, and you can actually write programs on it!
2. USB | DMX Controller
The raspi has a built-in I/O connector for doing all sorts of cool things, but for this project we chose to use one of the USB ports as our output interface because its simpler and more rugged than using breadboards and ribbon cables. To get things into DMX (digital light control) format, we will be using a Velleman USB to DMX interface. This can be bought in either kit or pre-built form, and is a really a great introduction to controlling DMX devices from a computer. Once you have this controller you’ll find it a great tool for any lighting control project you may cook up in the future.
3. DMX light fixture
Pretty much any DMX controlled light fixture that has red, green, or blue channels will work, and in fact you can chain together several if you want t control a whole bank of lights from your raspi. In this example we are using a Chauvet LEDSplash 200B spotlight because we found one cheap online for about $60 and its very bright and runs cool. If you have a DMX dimmer and standard PAR cans that’s fine too, its only important that you have a device that can receive red, green, and blue intensity channels.
4. HDMI ( or NTSC monitor )
Perhaps the best feature of the raspi is its HDM interface ( compare with Arduino video output ), which provides a full 1920×1080 graphics resolution to any TV screen that has an HDMI input. In this example we used a cheap Vizio monitor that we had in our kitchen, and functions nicely for a video monitor. It might be interesting to to use this kind of system as a starting point for a TV back light project or similar living room light effects when you move it into your living room since you have the video interface right there.
Step 2: The raspi
1. raspi-tize yourself
The bulk of the work on this project is to get your raspi ready for business. You can purchase the raspi from several sources, but our preference is from the great folks at Adafruit industries – they have been and continue to be a strong supporter of makers everywhere. You can purchase a raspi from this link:http://www.adafruit.com/products/998
2. get jacked
The raspi by itself is just a card, so to make it into a fully functioning computer you’ll need a few components that you most likely already have lying around. It is well worth the effort to build your raspi into a fully functioning computer because it really is great machine for building any “smart” project you have in mind down the road. The Raspberri Pi foundation website is a great resource for getting or raspi up and running. Please read this page for information on what you need to get your raspi computing:http://www.raspberrypi.org/quick-start-guide
3. get loaded
This project is using the stock Raspian “wheezy” operating system, which you can download for free from the Raspberry Pi Foundation website. This page has complete details on how to get the OS to your SD card – its very straightforward procedure, and in less than 20 minutes you should be able to plug the SD card into your raspi and have it booted and ready for business.http://www.raspberrypi.org/downloads
4. hello raspi!
Once you’ve got the SD card prepared and cabling connected, simply insert it into the SD card slot, and hit the juice to the raspi. To your amazement a computer will appear on the screen. The stock wheezy distribution contains a window manager ( LXDE ) that you will use to log in ( Username: pi , Password: raspberry ) and begin your raspi adventure. As per the boot instructions, you can type “startx” to get the LXDE window manager running. Take a few minutes to explore the system. BTW, if you want to have your raspi boot into the windows environment every time you plug it in, you can follow these instructions:
5. get wheelin’
The software that creates the color wheel interface and talks to the DMX converter can be downloaded for free in both binary and source format directly to your raspi. To get started, download the free DMXWheel application code from here, using the native web browser on the raspi ( Midori ):http://www.dmxwheel.com
Launch Midori ( from your desktop icon ), and enter the URL. Click on the “download software” link, and save the file to your desktop when prompted; this will create an icon labeled DMXWheel.tar.gz” on your desktop. Next, open up a terminal window to get a command line interface by selecting the icon on the lower left of the tool bar -> Accessories -> LXTerminal. In the terminal window, type these two commands:
tar xvzf DMXWheel.tar.gz
This will unpack the DMXWheel application code on your desktop to a folder named “DMXWheel”. You can open this folder to find the code that is referred to in the rest of this instructable.
6. get the extra bits
Although not needed to run the programs, to make changes and build the source code two additional software packages should be installed. These two packages contain Linux-native code to communicate with USB (libusb-dev), and develop user interface windows (gtk+3.0) respectively. These packages are installed using the linux application management program called “apt-get”. In the terminal, type these commands and follow the proceeding prompts:
sudo apt-get install libusb-dev
sudo apt-get install gtk+3.0
At this point you should have the raspi ready to go for the rest of the project. The software you will be using will be found in the DMXWheel folder on your desktop. Take a minute to look through this folder and read the README file – it provides valuable information on what the code is, what is does, and how to run it. We will go through some of the basics, but this README file can serve as your local reference documentation. There is a huge amount of coolness to explore on the raspi, so when you have some time explore the Raspberry Pi foundation forum to get some great ideas as well as support from the raspi community.