Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: DMX resources

  1. #1
    Join Date
    May 2007
    Location
    1 hr from everything in SoCal
    Posts
    2,753

    Default DMX resources

    Hey all,

    As much as I like building discreet circuitry, it seems everyone is doing tons of stuff via Arduino. Does anyone have a good resource for using Arduino as a DMX device. I want to build a DMX controlled fan speed controller for 4 wire fans using the blue PWM control wire. I would need the Arduino to output 25kHz (+5V) and the DMX will control the dutycycle <10% ~ >75%. Pretty simple. There is so much information out there, I was hoping for a place to start. Has anyone here built a DMX controlled arduino device? If this can be done more simply with discreet circuitry, I would prefer that but again, I have never built a DMX device before and don't know where to begin.

    Thank you!
    If you're the smartest person in the room, then you're in the wrong room.

  2. #2
    Join Date
    Oct 2012
    Location
    Carver, MA.
    Posts
    197

    Default

    Hello,


    Check your PMs.


    ED

  3. #3
    Join Date
    Dec 2007
    Location
    Nottingham, UK
    Posts
    2,845

    Default

    Here is a good site: http://www.mathertel.de/Arduino/DMXShield.aspx
    I've made a few of those circuits over the years.
    There are two kinds: isolated, and non-isolated.

    I tend to build exlusively the former, (and to hell with the extra cost of the transformer! ) but if you're on a tighter budget or need to save space, unioslated will work.
    - There is no such word as "can't" -
    - 60% of the time it works every time -

  4. #4
    Join Date
    May 2007
    Location
    1 hr from everything in SoCal
    Posts
    2,753

    Default

    Quote Originally Posted by danielbriggs View Post
    Here is a good site: http://www.mathertel.de/Arduino/DMXShield.aspx
    I've made a few of those circuits over the years.
    There are two kinds: isolated, and non-isolated.

    I tend to build exlusively the former, (and to hell with the extra cost of the transformer! ) but if you're on a tighter budget or need to save space, unioslated will work.
    Thank you, gentlemen for your responses!
    If you're the smartest person in the room, then you're in the wrong room.

  5. #5
    Join Date
    Aug 2013
    Posts
    73

    Default

    The good news is that DMX is dead simple at a protocol level, so it's hard to find n easier place to start, at least for a simple receiver. RDM responders are more complicated, but you probably don't much care about that for such a simple device, especially as a one-off.

    A couple of random tips off the top of my head, from having built quite a number of DMX devices:
    - Use a protected, failsafe RS485 transceiver. Failsafe in this context means that the receiver will give you an idle output when the line is in an invalid state (like it's undriven or shorted).
    - Don't terminate the receiver, unless it's switchable termination.
    - Isolation is nice, but not really required on small, limited installations, I've done a number of projects with no isolation, as long as the system is otherwise in good condition you'll be fine.
    - If you do isolate your receiver, don't use optocouplers, use a digital isolator IC. You can get a single IC that has three isolated channels in one direction and one in the other direction which is perfect for driving the DE, RE, and DI lines and receiving the RO line from the transceiver.
    - ALWAYS CHECK THE START CODE in your receiver! If it ain't null, it ain't channel data and you should probably ignore it. People who don't check the start code make RDM unworkable and that makes me really sad.
    - If you are going to the trouble of isolating, protect the data lines as well.

    From a programming perspective, as I said the protocol is pretty simple.


    1. Wait for the USART framing error flag to be set, when it is you're in the DMX break period
    2. The next byte that you receive will be the start code. check to make sure it's null.
    3. If the start code is non-null, then you are receiving something other than channel data and should ignore everything until the next break.
    4. If the start code is null, then the next byte will be the first byte of channel data. If your start address is N, then wait for N-1 bytes to go by before you start capturing data
    5. Once you start getting bytes you care about, start copying them to wherever
    6. Once you've received as many bytes as you need, ignore the rest until the next break.


    One complication to watch out for is that if you are using multiple bytes together, like as a 16-bit channel, you may need to double buffer or otherwise control when the received data is transferred to the consuming code so that you don't wind up mashing data from more than one DMX packet together.

  6. #6
    Join Date
    Mar 2010
    Location
    Raleigh, NC
    Posts
    2,292

    Default

    Quote Originally Posted by aberry View Post
    The good news is that DMX is dead simple at a protocol level, so it's hard to find n easier place to start, at least for a simple receiver. RDM responders are more complicated, but you probably don't much care about that for such a simple device, especially as a one-off.

    A couple of random tips off the top of my head, from having built quite a number of DMX devices:
    - Use a protected, failsafe RS485 transceiver. Failsafe in this context means that the receiver will give you an idle output when the line is in an invalid state (like it's undriven or shorted).
    - Don't terminate the receiver, unless it's switchable termination.
    - Isolation is nice, but not really required on small, limited installations, I've done a number of projects with no isolation, as long as the system is otherwise in good condition you'll be fine.
    - If you do isolate your receiver, don't use optocouplers, use a digital isolator IC. You can get a single IC that has three isolated channels in one direction and one in the other direction which is perfect for driving the DE, RE, and DI lines and receiving the RO line from the transceiver.
    - ALWAYS CHECK THE START CODE in your receiver! If it ain't null, it ain't channel data and you should probably ignore it. People who don't check the start code make RDM unworkable and that makes me really sad.
    - If you are going to the trouble of isolating, protect the data lines as well.

    From a programming perspective, as I said the protocol is pretty simple.


    1. Wait for the USART framing error flag to be set, when it is you're in the DMX break period
    2. The next byte that you receive will be the start code. check to make sure it's null.
    3. If the start code is non-null, then you are receiving something other than channel data and should ignore everything until the next break.
    4. If the start code is null, then the next byte will be the first byte of channel data. If your start address is N, then wait for N-1 bytes to go by before you start capturing data
    5. Once you start getting bytes you care about, start copying them to wherever
    6. Once you've received as many bytes as you need, ignore the rest until the next break.


    One complication to watch out for is that if you are using multiple bytes together, like as a 16-bit channel, you may need to double buffer or otherwise control when the received data is transferred to the consuming code so that you don't wind up mashing data from more than one DMX packet together.
    Could you elaborate on the following? I am setting up DMX lights in my shed and am kind of a noob.
    Don't terminate the receiver, unless it's switchable termination.


  7. #7
    Join Date
    Aug 2013
    Posts
    73

    Default

    Quote Originally Posted by JohnYayas View Post
    Could you elaborate on the following? I am setting up DMX lights in my shed and am kind of a noob.
    Don't terminate the receiver, unless it's switchable termination.

    Sure!

    Only the ends of the line should be terminated, so a device on the middle of the line should NOT include termination, otherwise the line will be loaded excessively and may not function correctly. Some devices may have a switch to enable termination, but that's unusual. Under no circumstances should a receiver have permanent termination if it's meant to be daisychained with other devices. The vast majority of stage lighting fixtures (virtually all of them, in fact) don't bother including any sort of termination. Most people just use plug-in terminators for DMX systems, essentially just an XLR5 with a 120R resistor soldered in. In industrial situations where wiring is done with terminal blocks it's not unusual to just stick a 120R resistor into the terminals and crank it down.

    Interstingly, the FB4 is actually one of very very few DMX devices on the market that has auto-termination, the female XLR5 they use has a mechanical switch built in that connects the terminating resistor when there's no connector plugged into it.

    Controllers are a special termination case, usually they're located at one end of the line, so it should have termination, although if the controller is always driving the line then termination becomes less necessary. If the controller is NOT always driving the line, (like if it supports RDM), then it should have termination+biasing to hold the line in the correct idle state (which is not zero volts, as it would be if it were left undriven). Devices that can be receivers or controllers, like network<->DMX nodes, would ideally have switchable termination+biasing, but I'm not sure how many do, as even when they're functioning as receivers they're at the end of the line and want to be terminated anyway.

    In practice, small DMX systems can often get away without termination just fine, as the data rate is relatively low compared to the length of the cable. It's only when you get into the ~hundreds of meters of length that reflections start to become likely to disrupt receivers.

  8. #8
    Join Date
    Mar 2010
    Location
    Raleigh, NC
    Posts
    2,292

    Default

    Quote Originally Posted by aberry View Post
    Sure!

    Only the ends of the line should be terminated, so a device on the middle of the line should NOT include termination, otherwise the line will be loaded excessively and may not function correctly. Some devices may have a switch to enable termination, but that's unusual. Under no circumstances should a receiver have permanent termination if it's meant to be daisychained with other devices. The vast majority of stage lighting fixtures (virtually all of them, in fact) don't bother including any sort of termination. Most people just use plug-in terminators for DMX systems, essentially just an XLR5 with a 120R resistor soldered in. In industrial situations where wiring is done with terminal blocks it's not unusual to just stick a 120R resistor into the terminals and crank it down.

    Interstingly, the FB4 is actually one of very very few DMX devices on the market that has auto-termination, the female XLR5 they use has a mechanical switch built in that connects the terminating resistor when there's no connector plugged into it.

    Controllers are a special termination case, usually they're located at one end of the line, so it should have termination, although if the controller is always driving the line then termination becomes less necessary. If the controller is NOT always driving the line, (like if it supports RDM), then it should have termination+biasing to hold the line in the correct idle state (which is not zero volts, as it would be if it were left undriven). Devices that can be receivers or controllers, like network<->DMX nodes, would ideally have switchable termination+biasing, but I'm not sure how many do, as even when they're functioning as receivers they're at the end of the line and want to be terminated anyway.

    In practice, small DMX systems can often get away without termination just fine, as the data rate is relatively low compared to the length of the cable. It's only when you get into the ~hundreds of meters of length that reflections start to become likely to disrupt receivers.
    Thank you for the detailed reply. I knew to terminate the last device on the chain but wasn't sure if that was what you were saying. The rest of what you said went a bit over my head so I'll have to read that a few times. Good stuff!

  9. #9
    Join Date
    May 2007
    Location
    1 hr from everything in SoCal
    Posts
    2,753

    Default

    Quote Originally Posted by JohnYayas View Post
    The rest of what you said went a bit over my head so I'll have to read that a few times. Good stuff!
    A bit here, too! I will be reading over it again and looking over a couple of git repos I found for correlation.

    Quote Originally Posted by aberry View Post
    The good news is that DMX is dead simple at a protocol level, so it's hard to find n easier place to start, at least for a simple receiver. RDM responders are more complicated, but you probably don't much care about that for such a simple device, especially as a one-off.
    Thank you for your very detailed response. I will go over this a few times and see what I can come up with.

    Curious about why optocouplers are discouraged. Are they not fast enough?
    If you're the smartest person in the room, then you're in the wrong room.

  10. #10
    Join Date
    May 2007
    Location
    1 hr from everything in SoCal
    Posts
    2,753

    Default

    I found a pretty good resource here:

    https://www.element14.com/community/...g-applications
    If you're the smartest person in the room, then you're in the wrong room.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •