3
\$\begingroup\$

I am planning to make a prototype for wired home automation devices, and I am thinking of using CAN bus for communication between nodes and Gateway.

The way I am planning to build it, there is one gateway with CAN bus capabilities, let's say up to 4 CAN buses for extension, with only software running. No inputs or output, and up to the limited number of nodes per bus with up to 2 relays, or 4 sinking transistor outputs, and 5 V inputs to act as switch and sensor inputs. I also think of wiring each node connected to the same CAN bus with a single wire.

I was hoping to use up to 32 nodes per bus for a maximum distance of 500m per bus cable

My questions are as follows:

Should I use 24 VDC or 24 VAC for power supply to cover the distance between gateway and all nodes?

What kind of twisted pair shielded cable should I use to ensure both communication and power supply of the nodes?

Is there another bus that will be better in this use case?

\$\endgroup\$
23
  • 2
    \$\begingroup\$ @schnedan CAN is more rugged than Profibus on both short and long distances. Running Profibus at 187kbps @ 1000m copper will not end well no matter what various fishy Internet sites claim. The main problem is the crappy data link layer of UART - apart from that, RS485 and CAN are quite similar signal-wise. There is nothing in RS485 which would make it more suitable than CAN at higher baudrates - on the contrary. \$\endgroup\$
    – Lundin
    Commented Feb 10, 2022 at 7:42
  • 2
    \$\begingroup\$ Anyway the answer to the questions here entirely depend on what you have available and what current draw you expect. Assuming each node has a local regulator from 24V down to 5V and that the current draw is something sensible. However if you manage ~100mA per node and 32 nodes scattered across 500m, that's some serious potential voltage drop still. You'll need quite thick cables, AWG10 or something. All the theory and an online calculator can be found here: rapidtables.com/calc/wire/voltage-drop-calculator.html 4 signals at that and ideally shielded... it's not going to be cheap. \$\endgroup\$
    – Lundin
    Commented Feb 10, 2022 at 7:57
  • 2
    \$\begingroup\$ @schnedan Nothing in that comment explains why Profibus would be more suited. Which it isn't - compare for example the classic MAX485 transceiver with a modern CAN transceiver like MCP2562. MAX485 is nowhere near playing in the same league. It's like comparing a car from 1980 with a car from 2022 to see which one is safest. \$\endgroup\$
    – Lundin
    Commented Feb 10, 2022 at 8:38
  • 2
    \$\begingroup\$ @schnedan If you want to argue you need to provide actual arguments or facts. "High tolerance to common mode" how, exactly? Compare the mentioned transceivers, MAX485 can handle -8V to +12.5V absolute maximum, MCP2562 can handle -58V to +58V. Modern CAN transceivers has a SPLIT pin for increased common mode stabilization, RS485 transceivers lack one. Sorry but your car from 1980 is not safer than the one from 2022. \$\endgroup\$
    – Lundin
    Commented Feb 10, 2022 at 9:12
  • 3
    \$\begingroup\$ Hello, thank you for the insightful debat between the RS485 and CAN. I was concidering CAN for two main reasons: 1) broadcast communications and collision prevention and 2) Protocol and Addressing. As per @lundin reply, i was thinking of wiring through a wire with Thick wires AWG10 for powering, and thin ones for CAN communication. The board will have a 24v to 5v regulator for uC and transistor to control 2x 24vdc 220VAC/8A (9.2mA Omron) relay for switching in order to reduce current consumption. Also, nodes will be in sleep mode awaiting signal either from gateway or inputs. \$\endgroup\$
    – awakrim
    Commented Feb 10, 2022 at 19:46

0