DMX Controlled Light

The project is to create an LED moving light that is controlled using the DMX protocol. The light will be able to rotate and tilt to cover the entire stage using two servos and change the color of the wash to any color in the RGB spectrum.

Engineer

Matthew H

Area of Interest

Mechanical Engineering

School

University High School

Grade

Rising Junior

Reflection after the Program

For my second year at BlueStamp I wanted to make something more complicated than I did last year. I originally expected for my project to entail making a rather simple circuit using a breadboard and an Arduino with a DMX shield. But I ended up having to essentially create my own Arduino with a more accurate clock than the normal one and my own DMX connector as well as modify the Arduino hardware serial library. I also assumed that I would spend more time working on the frame as my interest still lies within mechanical engineering and not trying to decipher DMX signal, troubleshooting problems with the Arduino itself, or creating a power regulator circuit to power the ICs. This year I had to do more troubleshooting and learned how to program with Arduino as well as extended my knowledge of electrical engineering that I started last year.

Main Project

Final Milestone

Social hosted video URL is empty.

For my third and final milestone I built an enclosure for my light. I originally wanted to build one similar to the lights I use at school but that turned out to not work due to torque limitations of the motor. So I sized things down to attach things closer to the center of the motor. This also didn’t work but that was caused by the current limit on the motor drivers set to low for the motors. Because of this change I needed to increase the current output of the power supply. To prevent from burning out more motor drivers I added heatsinks to the H-bridges and voltage regulators as well as a fan blowing onto them. I mounted the four connectors to one side of the case and drilled a hole in the top for the wires to come out. I left two sides open to allow for the fan to have an exhaust and for ease of access. I covered all of the wood with black gaff tape to prevent it from splintering.

I had many problems getting things to work. The first few were caused by small shorts or cracks in the solder due to the tight space constraints. Another one was caused by the fact that I hadn’t had both power supplies on the same ground causing for the data to be garbled. At the end one of the motor drivers wouldn’t connect properly and kept losing power which caused for the other driver to lose information and not step properly. While doing some testing I accidentally plugged my 12 volt power supply to the LEDs, which are rated for only 5 volts and this fried all of them.

Original Frame Design

Final Light Design

Second Milestone

The second milestone of my main project is to get the electronics and control software of my light working. There are four main parts of the circuit: the ATMega, the motor control, the LEDs, and the DMX connector. The ATMega is connected to a 5 volt regulator and a 16 MHz crystal resonator, which is connected to ground using two decoupling capacitors. The two bipolar stepper motors are controlled by one EasyDriver each. The EasyDrivers are connected to five pins digital pins and one ground each. The four stepper motors wires are connected in pairs to the coil contacts on the EasyDrivers. The motor drivers take their power from a 12 volts external power supply, also connected to that line is a fan used to cool the motor drivers and LEDs. The LEDs, an 8×8 matrix of RGBW Neopixels with a warm white, are connected to another digital pin on the Arduino, as well as a ground pin. The LEDs are controlled using the Adafruit Neopixel library, which handles the PWM. The LEDs are powered by their own 5 volt 4 amp powersupply while the rest of the circuit is powered off of one 12 volt 1 amp powersupply with the motor drivers and fan using straight 12 volts and the ATMega and MAX 485 on their own regulated 5 volt rail from the 12 volt powersupply. To make the circuit more permanent I soldered all of the components to a solderboard. I decided to have the pan motor on channel 1, the tilt motor on channel 2, red on channel 3, green on channel 4, blue on channel 5, and white on channel 6. I did this because it is similar to the lights that I am familiar working with at my high school.

I had lots of timing problems due to the issues with the Arduino’s clock. To solve the problem created by the inaccurate ceramic oscillator that regulates the ATMega328, I moved the ATMega to a breadboard and added a 16 MHz crystal oscillator which improved the reliability a lot. To power the ATMega I needed use regulated 5 volts as to not damage the chip so I added a 5 volt regulator. Because of the way the Arduino deals with hardware serial I needed to use a modified version of the hardware serial library from Max Pierson. The modified library removes an interrupt included in the original library. Even with the improved oscillator and hardware serial library I needed to add a delay of 32 ms after the LEDs run to prevent them from flickering. When I originally connected my motor drivers, neither of them was working properly, they were moving very slowly and not at the right increments. This was caused by the drivers being stuck in the microstep states, the pan motor was in 1/2 step, and the tilt motor was in 1/16 step. To fix this I connected the microstep control pins to the ATMega’s digital pins and set them to output low, disabling the microstep modes.

DMX LED Moving Light Schematic

First Milestone

The first milestone of my main project, a DMX controller LED moving light for theater, is to get the Arduino to read the DMX signal from the DMX controller and change the color of an RGB LED based on the values of three DMX channels. DMX is sent over the RS 485 communication standard. RS 485 uses two wires that are opposite voltages of each other to improve signal integrity and transmission speed. The signal is read by the MAX485 microcontroller which is a transceiver of the RS 485 signal. The MAX485 is connected to the data plus and data minus pins on the male XLR 5 pin jack. Because most DMX devices can be used in a daisy chain I added a female XLR 5 pin jack which is connected directly to the male jack. To add signal isolation I added two 10 Ω resistors between the data plus and data minus pins on the XLR jacks and the data inputs on the MAX 485. DMX uses a long idle period to start a data packet which begins with a zero channel. Each channel begins with a low start bit followed by eight data bits and ends with two high stop bits. DMX operates at a bitrate of 250kbps, each bit taking 4 microseconds. To interpret the DMX signal I am using the DMX library from Toni Merino.

I had many problems with interpreting the DMX signal. The first being that the original DMX shield I used didn’t have any documentation and it was incredibly hard to find the library that went with it, which turned out to only be able to write DMX not read it. The second library that I used didn’t work and also didn’t have any documentation. The third library had a lot of documentation but ended up not working with the controller. To solve this issue I tried to modify the shield but that ended up breaking the SN75176BD, the Texas Instruments RS 485 interpreter. At this point I decided to make my own DMX connector using the jacks from the shield. This didn’t solve anything so I tested the jacks using the multimeter and it turned out that the data plus and data minus jacks were shorting, so I got two new XLR 5 pin jacks to make my own connector. While trying to diagnose the problems, I used the oscilloscope to read the DMX signal and found out that the DMX controller was zero indexed rather than one indexed meaning that there is a channel zero that I can’t edit that starts every DMX package. I also learned how to read the DMX signal and that the least significant value comes first which is why I thought that it was spitting out random values earlier because I was reading it most significant value first.

DMX Connector Schematic

Starter Project: DiceKit

The DiceKit starter project is an electric die that uses a piezo sensor to trigger a PIC microcontroller to display the face of a die. When force is applied to the piezo sensor, the voltage increases. The PIC takes the least significant digit of the voltage from the piezo sensor and turns that into a number from 1 to 6. This number is semi-random because it is a relation to the force applied to the piezo but since the values that the PIC uses are small enough to be signal noise, making them more random. The PIC outputs to one of 4 pins meaning that it is able to create the four dot patterns that can be combined to create all the possibilities of the dice roll (see figure 1). The PIC will light LEDs in 3 stages, and alternate between those stages about every 20 ms, this is because it can only display one of the four outputs at once (see figure 2). The project contains a diode to prevent the PIC from being overvolted by the piezo. Each of the seven LEDs is connected to a resistor to limit the current flow into them. To save power, the PIC goes into sleep mode after 15 seconds and turns off the LEDs.

When I put the battery in the Dicekit the first time, it worked great but while testing it I realized that the battery wasn’t getting good contact with the leads of the battery connector and it would disconnect every time I hit the dice which was a problem because it needed force to trigger the piezo. aTo fix this I bent the leads, yet that still didn’t work and the battery kept disconnecting so I desoldered the battery holder and attached a 3.3V power supply to use instead of using the 3V button cell. After fixing the battery holder, the very weak wires coming off of the the piezo sensor tore multiple times, so I replaced them with much stronger solid core wire.