Tuesday 1 November 2016

DMX on Arduino with RS485


I'm implementing DMX on Arduino. DMX uses the RS485 standard to communicate.


In the specifications of RS485 it notes that there is a positive line, a negative line and a ground line. If the positive line is at higher potential than the negative line, a 1 is given. Vice versa for a 0. Now apparently the protocol doesn't measure the difference between each line and the ground, but only the difference in potential between the positive and negative line ( which has to be at least 200 mV).


This makes me assume it would be possible to easily drive DMX directly from Arduino, putting one line high (5V) and one low. However looking at the Arduino website with some information about DMX implementations, all information I can find is using some shield over the Arduino.


Is it necessary to use a shield, or will a direct connection work as well? I currently don't have any DMX components yet so I can't test it right away.



Answer




Driver Chips and DMX bus termination


When searching the internet you can see several chips being used to drive a DMX communication. They all are made to convert logic-level signals (LOW & HIGH) to the EIA-485 differential signal levels on the twisted pair cable.


Very common are the chips from MAXIM that I also use for my implementation. The one I prefer is the MAX485 or MAX481 which are identical with the exception of a low power shut down mode in MAX481 that we don’t need in the DMX scenario. MAX481 and MAX485 from MAXIM


Other chips often used are the 75176b differential bus transceivers from Texas Instruments.


A typical schema using MAX481 for a DMX controller is:


A typical schema using MAX481 for a DMX controller


Isolation


For a simple setup it is possible to connect the Driver chip directly to the Arduino pins but if you need a robust system, especially on a stage environment, you will have to add some more electronics to avoid electrical damage by defect equipment or accidental circumstances.


The electric potential of the DMX side of the implementation have to be isolated from the processor. There are 2 sort of chips that implement all you need:


A 5 volt to 5 volt DC/DC converter with galvanic decoupling. There are complete solutions in a single component available like NME0505SC or AM1S-0505SZ that can be used to generate a 5V power supply that is galvanic isolated up to 1000V. So even if there is a high voltage attached to the DMX bus there is a chance of no or low damage. High speed TTL compatible Optocouplers These chips use a LED and light sensitive transistor to isolate the DMX bus from the Arduino data pins. There are standard TTL compatible Optocouplers available like the 6N137 from MOTOROLA.



There are 3 data signals from the arduino that have to be brought from the arduinos side to the DMX side: transmit, receive and the data direction:


MAX481 with three 6N137 optocouplers and isolated 5V DC


Source


So you need at least one driver chip and to be safe you better make an isolation with some optocouplers. A minimal solution with only:




  • 1x SN 75176




  • 1x 100 Ohm 1%





but there is no isolation!


SN75176 Arduino DMX circuit


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...