Arduino Forum

Using Arduino => Project Guidance => Topic started by: lorenjz on Dec 10, 2012, 03:42 am

Title: DMX Hardware issues
Post by: lorenjz on Dec 10, 2012, 03:42 am
I've put together a DMX Shield with a protoboard and have been trying out the SerialtoDmx sketch.  My issue is that when I start to send any sort of commands to the arduino I get really erratic behavior from the light I'm trying to control.  My initial thought is that I'm picking up noise somewhere.  Could all of the jumpers be acting as antennas and creating the erratic behavior?

Thanks,

Loren
Title: Re: DMX Hardware issues
Post by: lunchboxav on Dec 10, 2012, 03:45 am
I'm thinking this maybe more of a timing issue. I guess. What Arduino do you use? I made an Open DMX board using Arduino, first I use the old Diecimila board with ATMEGA 168 and it has some troubles, blinking erraticly to be exact. Then I switch to Duemilanove with ATMEGA 328 and the problem disappeared. From what I read, the ATMEGA 328-based Arduino board seems like the best option for DMX, not sure about the newer Arduinos
Title: Re: DMX Hardware issues
Post by: lorenjz on Dec 10, 2012, 03:52 am
Thanks for the quick reply.  I'm using a arduino uno with an atmega 328.
Title: Re: DMX Hardware issues
Post by: lunchboxav on Dec 10, 2012, 04:01 am
is that SerialtoDMX sketch the one that you got from TinkerIt?  The website didn;t say anything about supporting UNO, but nevertheless UNO uses ATMEGA 328 so i think it should be OK.

I still think that the timing is the issue here, you may wanna use this DMXSerial library instead http://www.mathertel.de/Arduino/DMXSerial.aspx it worked for me using the 1.0 Arduino IDE too.
Title: Re: DMX Hardware issues
Post by: lorenjz on Dec 10, 2012, 04:14 am
I appreciate the link.  Is there a way to send DMX Values out of this library?  The lights I'm trying to use are theatrical and I need the signal to go down a DMX line.
Title: Re: DMX Hardware issues
Post by: lunchboxav on Dec 10, 2012, 04:15 am
yes, it can send and receive DMX, the site also has some instructions on how to build his version of DMX shield, may come in handy :)
Title: Re: DMX Hardware issues
Post by: lorenjz on Dec 10, 2012, 12:20 pm
I did look into that library.  The problem with that is that I have spent some time getting some software ready based on the DMX Simple library.  I know that my process is probably backwards...  Lesson learned.  Is there anyway for me to track down the timing problems?  If so where should I start?

Thanks,

Loren
Title: Re: DMX Hardware issues
Post by: MarkT on Dec 10, 2012, 05:06 pm
You might need an Arduino with a crystal, not a resonator - I think the DMX baud rate specification of 250kbaud is pretty tight.

The whole point of the RS485 drivers in DMX is to avoid noise issues, so it won't be that.  Much more likely to be a lack of decoupling
or some such, or as I fear timing issues.
Title: Re: DMX Hardware issues
Post by: lorenjz on Dec 10, 2012, 06:22 pm
I briefly skimmed over this:  http://arduino.cc/forum/index.php/topic,9573.0.html (http://arduino.cc/forum/index.php/topic,9573.0.html)  Would it be worthwhile to check?
Title: Re: DMX Hardware issues
Post by: ld3300 on Dec 12, 2012, 05:56 am
I had some problems with a DMX circuit I made.  I was using a sn75176 as the RS485 driver and couldn't get it to work reliably without a 0.1uf capacitor tying it's vcc and gnd pins.  Have you tried testing the circuit in a breadboard?  When I first built the circuit on a breadboard I didn't have a problem because of it's inherent capacitance.
Title: Re: DMX Hardware issues
Post by: lorenjz on Dec 12, 2012, 12:30 pm

Have you tried testing the circuit in a breadboard?  When I first built the circuit on a breadboard I didn't have a problem because of it's inherent capacitance.


People mean different things when they say "breadboard".  So here is a picture of my current setup:


(https://lh6.googleusercontent.com/-9LjfJTTdpAI/UMhqROHFzGI/AAAAAAAAALs/qPr5J7mmcNc/s640/IMG_20121212_060839.jpg) 

I'm not using the red boards just the arduino and the white area.

Let me know what you think.
Title: Re: DMX Hardware issues
Post by: MarkT on Dec 12, 2012, 04:52 pm
Its hard to say from that photo but I can't make out any decoupling on the RS485 driver, nor any twisted pair connected to it...
Title: Re: DMX Hardware issues
Post by: ld3300 on Dec 12, 2012, 07:35 pm
What rs485 chip are you using?
Title: Re: DMX Hardware issues
Post by: lorenjz on Dec 14, 2012, 03:22 am

Its hard to say from that photo but I can't make out any decoupling on the RS485 driver, nor any twisted pair connected to it...


@MarkT there is no cap should I add one?


What rs485 chip are you using?



@ld3300 I'm using the MAX485CPA
Title: Re: DMX Hardware issues
Post by: MarkT on Dec 14, 2012, 05:17 am
Decoupling is not an optional thing, it is required for all digital logic.  If you look at the datasheet for the MAX485CPA you'll find it mentions nothing about decoupling requirements despite the chip
switching highish currents at high speed - shame on Maxim!   I'd suggest a 0.1uF ceramic cap
close to the supply/ground pins as a reasonable first step.  Close to the supply/ground pins is
important.

I'd expect almost any capacitor of 10nF or higher to make a difference if that is the cause
of the erratic behaviour if you want to check quickly, but you should always have decoupling on all chips
if you want circuits that are reliable.
Title: Re: DMX Hardware issues
Post by: ld3300 on Dec 14, 2012, 06:58 pm
Try pulling pin 2 on your MAX485 Chip high instead of Low.  Right now your chip is enable to receive and drive, which is probably confusing it.