What I am trying to do is to digitally send a signal through a cat5 cable. I wan't to send it digitally so people can't just come along and put a voltage on the wires to activate the circuit. I would like the signal to come from the main control board. Thanks.
closed as unclear what you're asking by Brian Carlton, duskwuff, Voltage Spike, PeterJ, Dave Tweed♦ Sep 30 '17 at 13:57
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Depending on your skills, budget and time schedule, then anything we suggest might be too complicated, expensive or time consuming etc. for you to use in your design. However I'll mention one technology which fits your stated desire to "send some bytes" through the cable, to operate the lamp attached to the "Main Box".
You could use the Holtek HT12E (encoder) and HT12D (decoder) to send a coded data stream along the CAT 5 cable. Obviously you would use a matching address selection (effectively that is your code) on both the encoder and the decoder.
Often the HT12E and HT12D are used for wireless links e.g. IR or wireless via OOK modulation modules. However, the "data out" pin of the HT12E encoder can be directly connected to the "data in" pin of the HT12D decoder.
The encoder would be in your "Portable Box", and the switch which you showed would need to also be either fitted to, or at least connected to, that box in order to trigger the encoder to send its coded data stream. A power source would either be in the "Portable Box" or power could be sent to the "Portable Box", along dedicated wires in the CAT 5 cable, from the "Main Box".
In the "Main Box" would be the decoder and, depending on the type of lamp, the exact behaviour desired (e.g. if the light should stay on only when the switch is operated, or whether it should "latch on" for some period etc.) and the power source you provide, then some ancillary components may be needed between the decoder and the lamp.
As a minimum, even if your "Portable Box" contained its own power source for the HT12E encoder, there would need to be two wires used in the CAT 5 cable - the "data wire" linking the encoder and the decoder, and a shared Gnd reference between the two boxes. If the power for the "Portable Box" was coming from the "Main Box", then another wire in the CAT 5 cable would need to be dedicated to that.
Depending on the length of the wire and therefore its capacitance, you would likely want to choose a slow oscillator frequency for both the encoder & decoder, as the data waveform will be distorted by the effects of the cable capacitance.
It might become necessary to add a differential driver (at the encoder) and receiver (at the decoder) - e.g. RS-422 or RS-485 - to increase the reliability of the data reception.
If someone can open either box, or can attach an oscilloscope or logic analyser to the cable, then the code can be discovered & defeated. However within the limit of "not expensive" then this approach is something to consider.
(There might be other encoder/decoder device pairs which are also suitable - I suggested that pair as they are well-known & have public datasheets.)
You don't want to actually use Ethernet signalling, just use the cable (unless you have some other requirement for Ethernet signalling)
Some simple serial scheme between minimal microcontrollers would work. Annoyingly propriety laptop supplies sometimes do this.
Note that short of a cryptographic scheme it can be reverse engineered easily.
On the simple end, require a known resistor much smaller than the cable resistance to be on an extra wire, or require pulses at a specific rate.