Over the past week, I got to the point with the mini moving light that I needed some way to consistently pump DMX into my prototypes to test their functionality. Thankfully, the first set of PCBs I built for this project function as both DMX receivers and transmitters, so whipping together a basic DMX controller only took about 20 minutes.
So here it is: my tiny DMX controlled “light board”:
Not much to look at, really. It’s just the DMX Control Shield I build earlier, with its Arduino Pro Mini, and 3 potentiometers from the junk box. The ends of each pot are tied to +5V and ground, and the wipers are tied to three analog pins.
Originally, I had the Arduino just reading the straight value from the analog pins, mapping those 10-bit (0 to 1023) values from the ADC to 8 bit (0 to 255) values suitable for DMX, and shoving those out as DMX addresses 1,2, and 3 as fast as possible. But I found that some inconsistency in the analog readings caused the servos and LED to twitch and flicker noticeably. So I modified the code to read the values from the pots every 20 milliseconds and average the last 10 readings when outputting. The output values calmed right down.
The result is a reasonably stable controller, and plenty to test the mini moving-light with:
I also made some specific improvements to the physical design of the light, including:
Lengthening the body to accommodate the Carclo optic and heatsink
Adding vents to the body for heat-removal
Including some new wire-routing holes in the base and widening others for improved cable routing.
I also designed and printed some (really adorable) 1″ triangle truss and some hanging brackets to mount this thing on. Here’s the moment from my Sunday night livestream where I hung the light on its truss for the first time:
Just today, I got in another couple orders from DigiKey, and my latest batch of PCBs from JLCPCB should arrive tomorrow. The notable improvements to the PCB and parts include:
Separating the Pan and Tilt servo pads (doh!)
Switching to a stout-er 5V regulator
I also ordered a few VX7805-1000’s to play with. They’re a self-contained, fixed-output buck converter that’s meant to be a drop-in replacement for a 7805 linear regulator. Neat part if it works, and not horribly expensive.
Switching to an inductor spec’d for 1A forward current instead of 500mA.
Switching to a schottky diode rated for 30V instead of 20V.
Assuming this assembly goes well, I hope to build two or three of this version (which I’m calling version 0.4) and set them up for a little DMX-controlled dance party. Here’s hoping!
As I hinted to in my original post about the Arduino Pro Mini DMX Shield, and then talked some about in my PCB Assembly Livestream, the latest version of my DMX shield is geared toward driving in miniature moving light. This means that, in addition to being able to receive DMX, the Arduino driving the device will need to be able to drive a couple of servos and dim a relatively high power LED. There are many way of skinning both of those cats, so let’s look at the solutions that are present in V0.3 of the DMX shield.
Of LED dimming and Servo control, the latter is the easier problem to solve. While there are dedicated servo-driving IC’s, and modules, almost any microcontroller, including the ATMEGA238/Arduino can control a hobby servo in a straightforward way using minimal additional hardware.
A typical hobby servo needs only three wires running to it – +5 for power, Ground, and a control line. The control line carries the position data for the servo in the form of pulse width modulation. The servo expects to see a pulse every 20 milliseconds. A pulse of 1.5 ms corresponds to the center (90°) position of the servo. A 1 ms pulse rotates all the way in one direction (0°) and a 2 ms pulse rotates fully the other direction (180°). There is a standard Arduino Servo Library that translates degrees inputted into the appropriate duration Servo pulses.
The only additional hardware present on the V0.3 board for Servo control is, therefore, a bulkier 5V regulator. The 5V regulator on an Arduino Pro Mini isn’t particularly stout to begin with, and I’ve had issues on previous projects with “off brand” Pro Minis having even less 5V oomph than that. So there’s a pair of DC input pads and a TO-220 packaged 7805 to provide a healthy amount of current for the servos.
The LED dimming half of this project has a wider solution space than servo control. The typical solution is MOSFET dimming. A FET is switched on and off rapidly, with a variable duty cycle to control brightness. This is the solution that commercial DMX LED decoders use, with a bank of 3A-5A fets, one per driven channel. It’s simple and inexpensive.
The problem is heat. MOSFETS with super-low on-DC resistances are expensive, and those with higher DC resistances create more heat. There’s always a balance being struck between cost and current carrying capacity. Which is why most commercial DMX led dimmers sit in a sweet spot between 3A and 5A. And all of them come in metal cases, sometimes mounted to large heatsinks, to help with heat dissipation. Less than ideal for what is ultimately meant to be a 3D-printed moving light made of thermoplastic.
The other problem is overcurrent regulation. For typical, inexpensive 3A per channel DMX LED driver, there’s nothing to protect the FETs if you load up a channel with, say, 5A of load, there’s nothing in the drivers to prevent the FETs heating up to their failure point. Or worse. See, for example, this example from a local theater:
After some investigation, it turned out that there was a wiring error causing a dead-short across one of the channels. Which subsequently burst into flames. No kidding. The Stage Manager reported seeing a cloud of smoke roll out of the vom, which it turned out was discharge from the fire extinguisher the crew was using. Yikes!
With a controlled environment and a defined load, an overcurrent load is slightly less of a concern, but it seemed like there must be a more elegant solution to both the heat and overcurrent issues.
The solution I’m currently trying is the the AL8860 Buck LED Driver. It is essentially a DC-DC step-down converter which derives the average current through its load from a SET resistor between a couple of its pins. It has an input voltage from 4.5V to 40V, and in TSOT-25 form factor a maximum current of 1A. A TTL PWM signal applied to its CTRL pin brings the average current down from the maximum SET current to between 0 and 100% of maximum, depending on duty cycle.
While the IC itself ultimately uses an NDMOS FET to do its switching with a relatively high on-state resistance (200 mOhm), its incorporation of current management and a step-down converter directly into the IC makes it an attractive option. And for the form factors I’m looking at, I’m not likely to be pushing more than 1A through an LED star anyway.
The AL8860 requires a few external components as a buck converter would – an inductor and a schottky diode – as well as a bypass cap and the SET resistor(s). These altogether take up about as much PCB space as a decently sized FET switch would, let a long the voltage conversation IC’s that would allow this to run on a variable voltage.
I made the bold choice of testing this IC and hardware on a livestream recently. But not before an unscucessful attempt test attempt.
In an attempt to validate this IC idea before committing to it, I purchased a handful of AL8860s, schottky diodes, 0.1 Ohm resistors, and inductors, and tried to piece together this idea on a piece of copper-clad. That did not, in short, go well. Without proper pads, I couldn’t get the IC to stay in place well enough to solder magnet-wire to it. Even after I super-glued it down, the heat from my soldering iron weakened the super glue and caused it to come unstuck. And release superglue fumes. Fun!
So I pulled the trigger on ordering a batch of the V0.3 PCB’s, this time from JLCPCB. But in my rush, I didn’t run a final Design Rule Check, and the pads for my Pan and Tilt servos overlap. Ah well, this was mostly to validate the LED dimming circuit.
And validate it did! Check out this gif from my testing session:
Now that’s some light! The arduino was just running a simple ramp-up/ramp-down for validation.
The LEDs are from LEDSupply, a vendor on the east coast that I haven’t used before, but stumbled upon while looking for LED options. They happen to be having a closeout sale on some Luxeon R 3-LED stars, which seemed like a good option for something I might smoke or blow up. The LEDs themselves are Luxeon LXA7-PW40s. And with the appropriate Carclo optic, the beam width is fairly narrow. The heatsink is just something from the junk bin.
At 1000mA forward current (which LEDSupply recommends as the maximum allowed current), they emit around 975 lumens total, around what a 75W PAR16 lamp emits. Even testing at 500mA as I was, it’s a punchy little package!
There’s some CAD time in my future. I’ll need to whip up a case to hold the PCB and accommodate a pan servo. I think the arm and body components I will be able to mostly re-use from my previous design, possibly with a little extra room in the head for a proper heatsink.
At some point, I’ll have to re-order PCB’s with the errors corrected, especially the overlapping servo-control pads. I may also want to rethink the mounting hole locations, and possibly bring the DC and DMX inputs out onto their own little tabs to solder connectors onto. But first, I think it will be satisfying to bring this version of the LED to life.
Last night, as I started to assemble V0.3 of my DMX Mini-Mover Shield, I thought it might be fun to switch on my webcam and stream the assembly live to the World Wide Web. What follows is about 80 minutes of unstructured benchwork, chatting about DMX, sACN, and circuitry, and a first test of the new LED dimming circuit. Will it light up, or will it go boom? Watch the video to find out:
In my dayjob as the lighting supervisor of a midsize regional theater, we get to play with all kinds of fancy (and expensive) lighting equipment – moving lights, high-power color changing LED units, ultra-compact wireless dimmers, and so on. But it’s also fun to build inexpensive, maker-size versions of of this equipment, and it can be done on a shoestring budget.
About a year ago, I built a couple versions of tiny moving lights – one directly from a design from Thingiverse, the other of my own making. The end result was super cute!
The thing with this tiny light compared to real moving lights was… I cheated a bit. The light itself only contains the servos and LED chip itself, while the controller, LED driver and ballast were all external. The full setup took up almost 3 times the volume of the individual light:
Not only did I cheat on size, I cheated on control a bit too. The unit has a number of ‘test’ modes that run simple movement and color patterns, but there was no means of controlling the light externally. While there are It was basically a fancy keychain toy. And there are DMX Shields in the Arduino Uno form factor, they themselves would have outsized the lights by another 200%. It was all getting too bulky to be reasonable.
But after many months away from this project, I’ve been devoting some time to scaling down both the dimming and DMX control sides of the circuitry. The result is a shield for an Arduino Pro Mini.
As described in my previous write-up of contemporary lighting control protocols, the core standard for modern stage and event lighting is DMX, or properly, ANSI E1.11 DMX 512-A Digital Multiplex. In short, DMX is a serial protocol and physical spec that caries up to 512 one-byte values over each individual cable, usually with 5-pin DMX connectors. One set of 512 values is termed a “universe,” and to carry additional values, additional cables carrying different universes of information may be added.
More formally, DMX is a 250 kbps serial protocol transmitted over a 2-wire bus following RS-485 standards. The ESTA standard standards also dictate standardized connectors (XLR5 for temporary installations, RJ45 for permanent infrastructure), network topologies, impedances, terminations, and so on. The standard is pretty readable, if you enjoy that sort of thing.
DMX was developed in the late 80’s/early 90’s as a replacement for systems in which lighting equipment was controlled via analog control voltages, meaning each parameter (each individual dimmer, say) required one wire. A rack of 96 dimmers would have 100+ pin wiring harness attached to it, each with an analog voltage specifying level. With the introduction and adoption of DMX, all that was replaced with a single 3-conductor cable. All modern stage lighting controllers speak DMX, although most rely on transporting universes of DMX over Ethernet and using ‘DMX Nodes’ to turn that digital data back into ‘hard’ DMX close to the fixtures being controlled.
There is really only on piece of hardware required to add to an Arduino-compatible design to allow it to send/receive DMX: an RS485 transceiver chip. There are many of these on the market, the common ones being the MAX485 and the SN75176.
These take a single-ended input and turn it into a balanced output or, conversely, receive a differential RS485-compatible input and convert it to a single ended signal to a microcontroller. There are two control pins which determine whether the chip is a receiver or a driver. The control circuitry is essentially the same at both the transmitting and receiving end:
The circuit is ultimately very simple – a couple headers, some resistors, a MAX485 IC, and some pads to connect the DMX connectors to. And a switch – the DMX library I’m using abuses the Arduino’s built-in Serial library for some of its functionality, which means it has to use pins D0 and D1. Which means you can’t reprogram the Arduino with DMX coming in. The DPDT switch just removes the connection between the DMX connectors and pins D0 and D1 of the Arduino to allow for programming.
Mostly for my own reference, the connections between a standard XLR3 or XLR5 connector and the Max485 pin are:
XLR Connector Pin
Here’s what draft one of version 0.1 looked like when it came back from OSHPark and following assembly
All the passives are 0603 and the max485 is an SOIC, both of which are pretty easy to solder by hand. The SMD switches are adorable! They’re these little guys from C&K.
The major flaw with version 0.1 is: one you’ve attached headers, where do you attach anything else?? So version 0.2 added an additional row of thru-hole pads, cleaned up some labeling, and added some mounting holes for M2 screws:
And once its all assembled, it looks something like this:
I’ve been making use of the Conceptinetics DMX library, which I’ve found to be both functional and stable. I haven’t yet experimented with the RDM capabilities of that library.
The library is very easy to use, and its usage is described well on the Conceptinetics Documentation page. Essentially, one defines a DMX_Slave object, which has enable(), setStartAddress(), and getChannelValue() methods.
For example, once the object is set up and addressed, a loop() with the single command analogWrite(LED_PIN, getChannelValue(1)); will dim an LED attached to pin 9 dim in response to incoming DMX. Easy as pi.
So, what can one do with an Arduino Pro Mini that can receive DMX? Well…
You can make a DMX level monitor, a DMX controlled LED source. And really, anything else you can think of to do with an Arduino – drive servos, WS2812s, solenoids, relays…
The shield can also transmit DMX, though I haven’t thoroughly tested this yet. But it’s possible to make a miniature DMX controller, itty bitty light board, or testing tool. Or wire up some interesting input devices and make an interesting lighting controller.
The shield has been a useful proving ground for the Conceptinetics DMX library (though we’ve used it onstage before), as well as for OSHPark’s manufacturing tolerances. I wasn’t sure that having holes as close to the edge of the PCB as both V0.1 and V0.2 have would be manufacturable, but they came back no problem.
This all started for me with a miniature moving light project, and while that’s not quite ready for a write-up, I’ll just leave V0.3 of the DMX shield here. Not without errors/improvements to be made, but I’m excited to try out some new LED dimming tech: