Advice on serial comms over a distance please

This project is a signalling system involving 3 or 4 boxes with lights and buttons on. Pushing buttons will cause lights to go on or off on other boxes. The boxes will be up to about 30m apart, probably connected by CAT5 or 6.

Is I2C the best approach for this? I realise there are two problems to overcome: a) Distance - but I think something like the P82B96 chip can overcome that and b) I2C is a master/slave protocol but I guess the master one can just keep polling the others for any input from them.
Am I on the right track or is there a better approach?

I'd also like one box to power all the others using spare cores in the CAT5/6. Reasonable?

Thanks

I'd suggest RS485 serial for your Comms link. It's designed for distance and 30m is well inside its maximum range.

I'm not sure what voltage you would need to inject at the supply end to get enough volts at each station. If you were to put 12V in, then I think you would get enough volts out (taking into account the volts drop on the thin cable in a CAT5/6) to power the regulator on an Arduino UNO for example at the end of the cable.

RS485 using something like this - https://www.amazon.co.uk/DSD-TECH-SH-U12-MAX13487-Raspberry/dp/B07B667STP/
??

I have I2C working over about 25 to 30m without problems. The secret is to use a low clock speed and lowish value pull up resistors.

This comes up often on here, do some searching.

sclg:
RS485 using something like this - https://www.amazon.co.uk/DSD-TECH-SH-U12-MAX13487-Raspberry/dp/B07B667STP/
??

The type that I used look like these on ebay. The seller is offering 5 pieces for £3.73 inc free delivery.

Is I2C the best approach for this?

No.

The simplest approach is to use a normal serial signal but buffer it with an open collector transistor at the TX end.

At the RX end use another buffer transistor but with a pull up resistor going to 12V, and then clamping the input to 5V with diodes.

I have used this for wires as long as half a kilometre, when I was in the access control industry.

Another suggestion of approach is to use ESP32's and the wireless feature for communications.

Idahowalker:
Another suggestion of approach is to use ESP32’s and the wireless feature for communications.

Thanks for the thought but this is in a theatre where there are 15 - 20 radio mics, radio intercoms and all sorts of things that like to interfere with RF!!

Grumpy_Mike:
No.

The simplest approach is to use a normal serial signal but buffer it with an open collector transistor at the TX end.

At the RX end use another buffer transistor but with a pull up resistor going to 12V, and then clamping the input to 5V with diodes.

I have used this for wires as long as half a kilometre, when I was in the access control industry.

Thanks for the thought. If I use straight serial, presumably it can only talk to one other box as it's then not a bus-type system?? (Not necessarily a problem as I've got enough pins for multiple serial outputs!)

Avoid I2C. It was designed for chip to chip communications on a single PCB.

RS232 serial works fine for a master to talk to many slaves, over a large distance. Each message should have a slave address. For true multidrop, bidirectional bus configurations use RS485 adapters

For master to several slaves over large distances you can use the trick mentioned by Grumpy_Mike, or just lower the Baud rate to 1200 or less.

jremington:
Avoid I2C. It was designed for chip to chip communications on a single PCB.

RS232 serial works fine for a master to talk to many slaves, over a large distance. Each message should have a slave address. For true multidrop, bidirectional bus configurations use RS485 adapters

For master to several slaves over large distances you can use the trick mentioned by Grumpy_Mike, or just lower the Baud rate to 1200 or less.

Many thanks

jremington:
RS232 serial works fine for a master to talk to many slaves, over a large distance. Each message should have a slave address.

Well that is not strictly RS232 I think what you are talking about is putting a DMX protocol on top of an RS232 hardware. These tend to be chained to get the distance.

RS232 by itself according to RS-232 - Wikipedia

A widely used rule of thumb indicates that cables more than 15 m (50 ft) long will have too much capacitance, unless special cables are used.

But then this depends a bit on what baud rate you are using.

For true multidrop, bidirectional bus configurations use RS485 adapters

While it is bidirectional it is not a duplex interface, that is it can only be used in one direction at any one time. When I have used RS485 professionally there has always been problems switching over from transmit to receive somewhere along the development process which is software in origin.

sclg:
This project is a signalling system involving 3 or 4 boxes with lights and buttons on. Pushing buttons will cause lights to go on or off on other boxes. The boxes will be up to about 30m apart, probably connected by CAT5 or 6.

Is I2C the best approach for this? I realise there are two problems to overcome: a) Distance - but I think something like the P82B96 chip can overcome that and b) I2C is a master/slave protocol but I guess the master one can just keep polling the others for any input from them.
Am I on the right track or is there a better approach?

I'd also like one box to power all the others using spare cores in the CAT5/6. Reasonable?

Thanks

sclg:
This project is a signalling system involving 3 or 4 boxes with lights and buttons on. Pushing buttons will cause lights to go on or off on other boxes. The boxes will be up to about 30m apart, probably connected by CAT5 or 6.

Is I2C the best approach for this? I realise there are two problems to overcome: a) Distance - but I think something like the P82B96 chip can overcome that and b) I2C is a master/slave protocol but I guess the master one can just keep polling the others for any input from them.
Am I on the right track or is there a better approach?

I'd also like one box to power all the others using spare cores in the CAT5/6. Reasonable?

Thanks

I have found an article that probably helps to clear up some doubts. It is a basic tutorial on RS485, which uses the MAX485 chip to control the protocol. I hope it helps someone.

which uses the MAX485 chip to control the protocol.

No a max485 does not control the protocol it is simply the chip that converts the signals to the right levels. There is no one RS485 protocol it is down to the software to implement the protocol and send the right signals to the MAX485 chip.

https://www.maximintegrated.com/en/products/interface/transceivers/MAX485.html

Idahowalker:
Another suggestion of approach is to use ESP32's and the wireless feature for communications.

I was going to suggest ESP8266 boards ans MQTT.