bits n' bytes n' wire length

Hi-

I have a project I am starting the programming on - controlling 6 AC controller boards (from futurelec.com). The AC boards work great and my initial tests are fine - no issues communicating with the boards but it's in the fine details...

This piece is going to be installed overhead (14') in a gallery and I had originally thought to just have the microcontroller (arduino or wiring) attached to the overhead rig near the AC control boards- but have been thinking that if I need to do any adjustments to the programming once it is installed I will be in a tough spot. So I am thinking about changing the design so that I can bring the microcontroller down to floor level- and instead of dedicating 4 pins (if I used Wiring) to each AC board (they each control 4 AC outs) and having to deal with 24 wires, I would go with shift registers- and just have the 3 lines plus 5v/gnd.

This complicates the programming somewhat- haven't used SRs much and don't have any real bit shifting chops (I understand the gist of it but it makes my head hurt)

If you have read this far and I haven't bored you to tears, I'd be interested any input on any of the following questions:

--does the wire length from the microcontroller (<= 20') factor when working with SRs (or multiplexors)?

--could I use a 20' USB cable to Arduino/Decimilla and keep all the electronics together?

--finally, if I do go with SRs is there any example code around for setting individual bits in a byte which doesn't use bitwise stuff (or isn't too hard)? I am sequencing AC lights in this app and when I have done it with LEDs, I have just stored the state of the light as a 0 or 1 in an array with the length = the number of LEDs, then walked through the array using some code to translate the array into bytes to send to the MAXIM 7219 chip. That worked ok but I wonder if there is a better approach.

Anyway - partly thinking out loud here. This project has a bit more complexity than I have dealt with before and I am trying to avoid designing in something fatal (like wires being too long)

tx!

--Roy

hmm.. sounds like asking for trouble, since AC dimmers chop the AC line and make lots of noise. I would say avoid any extensions on the SR lines- nothing more than a foot is really a good idea. Ideally digital logic lines are as short as possible. At 14' you have a bunch of antennas that are going to pick up noise in that terrifically noisy environment, not to mention the fact that the inductance of the wires will have some effect on the response of the signals. I would say avoid at all costs, just to save yourself the headaches. If you have to do it, then use shielded cables.

The USB protocol page says you can use a 5M cable:

Q1: How long of a cable can I use to connect my device?
A1: In practice, the USB specification limits the length of a cable between full speed devices to 5 meters (a little under 16 feet 5 inches). For a low speed device the limit is 3 meters (9 feet 10 inches).

Another option would be using Xbee modules as a serial extender, or Ladyada's Ethernet shield.

D

PS this comes up on Google. With this, you could program from the Starbucks next door. You'd have to explain the ethernet cable though.

http://www.tigerdirect.ca/applications/searchtools/item-details.asp?EdpNo=165746

Thanks for the cautionary tips- I definitely don't need more complexity in this project(!!) I think I will forgo the SRs and just use the Wiring board and dedicate a pin to each AC controller (they are opto-isolated and just on/off - so there shouldn't be that much noise (guessing..))

I'm also using 24 Sharp GP2D12 infared sensors - multiplexed - and have enough of a tech challenge with those.

Guess I will stand on a ladder if I have to reprogram... :slight_smile:

tx!

--Roy

One idea might be to use a second Arduino on the ground actually running the main program, & sending the light state bytes via infrared to the one on the ceiling that handles the interface to the MAXIM device . I have some code to do such IR xmit/rcv, but it may not be fast enough for your purposes (able to send 32 bits of info about 10 times per second). Also, your IR transducers might interfere.