Best approach for three-wire, two-way remote?

I'm working on a project which involves a wired remote connected to an Arduino, with 3 conductors available for the wire (out of necessity for utilizing an existing infrastructure). The remote will have 7 buttons, and a bi-color LED. I'm debating the relative merits of two approaches, and was hoping for some input from you guys.

1) All analog. The wires to the remote are input, 3V3, and LED control. The LED control line is connected to an output which goes either high (5V) or low, and the LED is connected between that and the 3V3 supply, so it sees a relative -2V7 or +3V3 to go either red or green. The switches each connect 3V3 to the input line via a different value resistor, which returns to an analog input, and then the Arduino reads the analog input to determine which switch is pressed. Multiple simultaneous button presses aren't an issue in this application.

2) Digital. The remote has an Arduino Pro Mini, and directly processes the buttons, and controls the LED, and connects to the primary Arduino via I2C or some other method tbd.

Any thoughts on either approach? Clearly the analog method is more elegant and cost-effective, but I'm concerned about being able to get all 7 inputs that way. I see discussion here on doing this sort of "analog multiplexing" somewhat often, but always with just a mention of having to "carefully choose" values for the resistors, but never discussion of what to take into account when choosing them/what values to use. Clearly I'd use thresholds for the reads rather than discrete values, to allow for fluctuations in readings (and appropriately Aref to 3V3).

My other concern with this method is the stability of the analog inputs/their susceptibility to noise.

If I go the digital route, are there any suggestions for the best way to interface the two Arduinos? Or is there a simpler board, sort of a wired XBee, to use for the remote? I only need to pass which button is pressed, and ideally to control the LED in the other direction. Is I2C the best way to go? Roll my own through some other method?

Thanks, Andy

Considering that your remote has a Arduino Pro Mini, I would use serial communications between the two units. This would allow easy troubleshooting the units and give you maximum flexiblity for changes or additions in the future. 3 wires, gnd, send, rec works perfect ( woops, what about power?) and programmable baud rate would allow you to adapt it the lenght you might need in the future, slower = longer distance.

Lefty

Well, the remote doesn't have to be an Arduino at all, that's what I'm trying to decide :-) It could be something simpler, or, in the case of the analog route, no processor at all.

It could be something simpler, or, in the case of the analog route, no processor at all.

Of course, it's your project. Let us know what you decide on.

Good luck

Lefty

I hope you didn't take my reply as putting down your response, LOL, I was just clarifying that I'm not married to having the Arduino in the remote, I'm equally open to some sort of interface board or any other option that others might have to suggest.

I wasn't sure if your post was "well, if you're going to have an Arduino, then this is how I'd do it," or, "Well, since you'll have an Arduino in there anyway, you might as well..." so I figured I'd clarify that the Arduino in the remote was only an option, not a given :-)

--Andy

Andy,

Do you already have power and ground in that "existing infrastructure"? Or do you need to supply that in your 3 wires?

If the cable is long, and unshielded, you might pick up enough electrical noise from the environment to cause problems with the analog switch detection method. A long cable might rule out I2C, too, even if it's shielded.

You should look into the RBBB from moderndevice.com if you put an Arduino in the remote: it's not quite as compact as a Pro Mini, but it's cheaper, and has onboard voltage regulation.

If you use a remote Arduino, and have only the three wires for everything, you could use one wire for async serial communication bidirectionally, by driving it with an open collector/open drain output from each end. The software is trickier (e.g., it has to be smart enough to recognize and discard the data it's sent when it shows up at its own input), and I haven't done it with the Arduino's serial library, but it's do-able.

Ran

Hey Ran, No, no power existing, it has to be provided over the three conductors. It's actually a shielded twisted pair, a mic/line level cable with 3-pin XLR connectors, to be precise. Length isn't a huge issue, it only needs to be 10', although the ability to work over longer distances would be great.

--Andy