Thread Summery (save you some reading time):
I would like to thank everyone for the great help :-)
It seem like something I thought to be simple (dc slow signaling over long wires) got too complex for my knowledge and skills to implement.
Normally we deal with small DC circuits of few centimeters, dealing with DC circuits size of house (20m) is a different game.
the RS485 seems to be the correct approach, the only *drawback with ATMEGA328p is that it has only one Rx/Tx usart which I am currently using for debug tracing.
(*drawback - you can use any available pin on the MCU for simple "high" / "low" signaling transmission)
There are many types of RS485 and they differ in the level of protection, isolation, bit rate etc.
The following MAXIM "parametric search" url is an interactive online page that ease the task choosing the correct RS485 IC (I haven't choose one yet)
Note: before you attempt to implement a RS485 network you should read the "Guidelines for Proper Wiring of an RS-485 (TIA/EIA-485-A) Network" by maxim.
Note, that I am still curios to understand how to protect the following components:
1. output pins - solution seems to involve "protected MOSFETS". there are many kinds and it is not easy to choose. (attached schema for output pin using RFP30N06LE N-Channel MOSFET)
2. Input pins - solution seems to involve diodes ( zener, TVS, ESD ), capacitors and resistors. (attached schema for "high" and "low" inputs from the digikey docs)
http://www.atmel.com/images/doc1619.pdf - (AVR040)
3. power supply and regulators (the wire loop).
Seems like methods used to protect "input pins" and "output pins" can be used to protect the "voltage regulator" inputs and outputs.
Interesting project "The Ruggeduino" by Rugged Circuits:
If there is an expert on forum that can share detailed schema for each item (1,2,3) it will be grate :-) thanks.
How to connect 2 MCU (ATMEGA328p) over cat5 30 meter wire using PC123 Photocoupler ( low frequency 1hz digital pin on / off ).
1. Each MCU have it's own regulated voltage 3.3v.
2. low frequency 1hz digital pin on / off.
3. using PC123 Photocoupler (can order any other part)
I have ordered several PC123 Photocoupler and read/watched several papers and videos in regards.
Open Questions (I still have):
1. the PC123 seems to have 5KV spike protection but for which direction (I need to protect both the input MCU and the output MCU) ?
a. led -> transistor
b. transistor -> led
c. both (will simplify my design).
2. Does my design really effective ? ( against ESD (Electrostatic discharge) , RF static noise ? )
see attached design image.
Sharing with you A cool optocoupler hack:
I have read about a cool optocoupler hack using a "green led ~540nm", "GL55 Series Photoresistor (540 nm 5k-50K ohm) " and sealed heat shrink.
*It not a proper solution and need to be protected as well but still cool idea
I have attached the design I made.
GL55 Series Photoresistor ( 540nm Spectrum peak value )
540nm is "Pure Green" Led
see: LED Color Chart