Aquarium controller - Communicating with remote modules

I have working away at building an Aquarium controller for the last year or so and have managed to get most of it to work. I now want to strengthen the design and move it onto PCBs. Here are the basic components:

I’m struggling with the best way to communicate with the external Input and Power Bars. From the research I have been doing I see the following options:

  1. Send the IO lines from the Arduino directly to each of the remote modules over the cat 5. Where there aren’t enough GPIO use a shift register or similar in the control unit to provide more.
  2. Use a BUS like I2C, SPI or CAN with corresponding IO expanders at each remote module. Eliminate all the direct wiring for a star or series topology and use buffers and amplifiers where necessary.
  3. Use a tiny Microcontroller or PIC (ATMega328) at each remote module. Connect with a bus technology or direct Serial.

So I’m looking for the best choice for reliability and stability. These things are directly connected to pumps and sensors that could worst case flood my house or kill everything in my tanks if they misbehave. During my testing I have had problems with EMI from the power bars so I’m thinking isolation will also be key there as well. If this were to be used in industry what would they do?

Thanks

Is that 1.5 m or 1 to 5 m?

I am tempted to suggest the RS485 electrical protocol because that is balanced and thus fairly immune to noise.

In conjunction you might want to have an error-detecting protocol so that, in the event of noise, you don't interpret some command as something else.

I have some info about RS485 and such a protocol here:

http://www.gammon.com.au/forum/?id=11428

Despite what I said above I have connected a RFID door system to the door reader and lock device, where the processor is a number of meters away from the lock/reader using only "speaker" cable without using RS485 or any protocols. I just used serial comms at TTL levels. However that isn't really "life or death" because the worst that would happen would be that the door wouldn't unlock, and you might try again (although that has never happened as far as I am aware).

Probably other people will have other (maybe better?) suggestions. I haven't personally tried to control an aquarium.

Thanks for the comments Nick. The length is 1 to 5 meters. I keep coming across RS232 or 485 as a recommended option. So I guess if I went RS232 or higher it would be best to use a UART GPIO Expander with some type of Multiplexer in the control unit so I can run 5+ RS232 channels?

I take it this would be a better solution then just sending raw GPIO high\low to those remote units?

Thanks

RS232 is not balanced. RS485 is. I would be going with RS485 as you need an external chip anyway for RS232, and the RS485 is more immune to noise.

Your Mega supports 4 x hardware serial channels (which could be piped to RS485 conversion chips) and you could conceivably have a 5th channel using software serial.

I take it this would be a better solution then just sending raw GPIO high\low to those remote units?

More immune to noise, both outgoing (to the remote unit) and picking up noise and feeding it back into your main processor.

Thanks for the feedback I will focus on RS485. I have been searching around and came across SC16IS750 http://www.nxp.com/documents/data_sheet/SC16IS740_750_760.pdf which looks like it will provide the necessary RS485 to GPIO bridge. I still have to do more reading on RS485; should I be using buffer\line drivers at the control unit? I'm thinking the more I can isolate the processor the better.

I'm also considering how to power those remote units. The first thought that comes to mind is to send VIN (12V) over the Cat5e than regulate it down to 3.3V at each of the remote SC16IS750 units.

I used the LTC1480 on the link above.

Yes you could send 12V down the Cat5 cable, I don't see any major problem with that.