2

I recently saw this video where the creator controlled a DMX light via the Arduino. There he used the pins 3 and 4 for the data on the Arduino Duemilanove. As DMX library he used DmxSimple.

Based on my research DMX is RS-485 and for this there's a driver chip required.

So I have three questions about this:

  1. Why do all sources I found say that there's a driver chip required when it seems to work without?

  2. I got a Arduino Leonardo compatible device (Devduino). Is it possible to control DMX like stated above on this platform?

1

The physical layer of a DMX interface is based on differential signaling over an RS485 link. This is exactly what is said here on the DMX Arduino.cc page.

A differential signal (like RS485 or USB) can travel greater distances than signals which reference ground (like RS232, I2C or SPI). This is because noise, which affect both sides of a differential signal, can be canceled out at the far end when one of the signals is inverted then added to the other by the differential receiver.

Connecting one side of a differential receiver to ground and driving the other side with logic level voltage is not recommended. Even if it worked and did not cause harm to the transmitting processor nor the differential receiver the signal will likely be susceptible to undesirable noise.

RS485 is a ubiquitous standard and likely several easily sourced designs exist for the Arduino.

0

It might be possible, actually. A differential signal CAN be produced via a standard Arduino, though there's still the 5V logic level to be concerned about. I am guessing that his lamp was capable of a 5V-swing signal (10V, all told), but this is not a guarantee, especially if the standard does not normally support this. In that sort of case, you trust that the manufacturer made the device sufficiently hardened/overengineered so that the higher voltages do not cause damage.

From watching the linked video, the signal wires are both attached to GPIO pins of the Arduino board. If one is pulled HIGH (5v) and the other LOW (Gnd), you produce a signal. The other differential signal is provided by swapping which pins are LOW and HIGH.

EDIT: That's a Duemilanove, NOT an Uno, so the outputs might be different. (Still, one of the newer 3v3 boards would probably be safer, if you are testing this). Further, if the wires are long enough, there might even be something of a voltage drop that makes it safe(er).

The end result then uses bit-banging to emulate a transceiver using this jury-rigged differential transmitter.

0

RS485 or RS422 and consequently DMX use differential drivers at 5 volts. This means that both lines are 0 to 5V nominally, with a (usually, depending on the cable used) 120 ohm resistor as a terminator on both ends. A 3.3V signal might work, but barely.

perhaps sending the signal on one line and just 0V on the other might work sort-of, but I've never tried or even heard of that.

My guess would be that in this case they are using a bit-banged serial port modified to also control the other pin, but inverted. Perhaps something could be done with a standard serial port on one pin, setting up an interrupt on that pin changing level, and using the ISR to check the level on the 'serial pin and invert it and set the other pin. I think that would probably incur too much of a delay between the two pins, but perhaps not. Strictly speaking, the delay between the two pins changing if it was bit-banged is probably out of spec for RS422/485, but might work anyway unless the baud rate was higher.

If you are going to use DMX, spend the $0.30 and buy a driver chip or a bit more and get a DMX shield. I've seen DMX get screwed up by a whole lot less than the differential line being a bit out of sync.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.