For a parking management system I am going to create an Arduino network.

An Arduino with an ultrasonic sensor will be placed above each parking space. If car is parked at specific location Arduino will inform master (PC) and also turn RED light ON.

I am not sure how I can make network with minimum wiring. I think RS485 will be suitable for this purpose.

There will be almost 200 Arduinos in a network. I have following questions in mind:

  1. Should I go for RS485 protocol or something else?
  2. Can RS485 support 200 devices as there will be only short communication (i.e device ID and parking status)?
  3. I am planning to lay CAT6 cable. Two pairs will be used for power transmission and two pairs will be available for communication.
  • Where is the question in the third point? Aug 7 '18 at 9:35
  • Cabling detail is provided so that if someone have better communication method over 4 wires, I can go with it easily
    – umair
    Aug 7 '18 at 9:42

This sounds, to me, like a job for CAN. It's the current de-facto standard for industrial inter-MCU cabled connections. It's used, not only in automobiles, but also to control elevators and almost all other modern industrial distributed applications.

Note that CAN is designed to only support up to 30 nodes, so you would need to split your network into sections and have groups of nodes amalgamated together into a single sub-network. For 200 nodes you may want 10 subnetworks - that is, 20 nodes connected together to one super-node, which is then connected to the "backbone" CAN bus.

However, CAN can be run at lower baud rates than normal, and that increases the number of nodes you can have on any one network segment. It potentially (bus capacitance permitting) support thousands of nodes.

Another option is to use CAN to connect multiple "master" nodes together into a backbone, and then those "master" nodes connect to a number of sub-nodes using LIN (which is cheaper to implement than CAN).

enter image description here

LIN can support a maximum of 15 nodes (plus one master node) per network, so you can get a theoretical maximum of 29*15 (assuming 1 CAN node is the connection to the PC), or 435 nodes.

You could also use RS-485, but that is also limited to around 30 "unit loads", and the number of nodes you could put on one segment is dependent on the "load" each node imposes. In practical terms it's rare to go over 30-40 nodes on a single segment, and grouping nodes together into sub-networks (as above with CAN/LIN) would be needed. So you may as well use the current standard for this kind of communication, and use CAN/LIN.

  • Note that whereas the limit on LIN nodes is a hard one, CAN will work fine with a ridiculously high number of nodes, if you pick an equally ridiculously low baudrate. Aug 7 '18 at 13:13
  • @DmitryGrigoryev I'm not familiar with the "standard" CAN protocol. Does that support more nodes, or would you have to use a non-standard protocol as well?
    – Majenko
    Aug 7 '18 at 13:16
  • CAN has an 11-bit address field (and extended CAN bumps it to 29), which is plenty for 200 devices. Standard CAN baudrates start with 125kbps (supporting ~30 nodes along ~500m of distance) but most transceivers can be configured to much lower baudrates like 16kbps. Aug 7 '18 at 13:23
  • @DmitryGrigoryev Sounds even more ideal.
    – Majenko
    Aug 7 '18 at 13:24
  • Hmmm it's sound great. I'm not much familiar with CAN network. I'll check on Google and come back soon. But looking briefly it looks like expense choice. As RS485 and CAN both can support almost same number of nodes depending upon load. Rs485 is much cheaper solution. But by the way now I'm very clear I have to divide my network in small parts. Thanks a lot man
    – umair
    Aug 7 '18 at 20:06

Regarding your third point, a CAT6 cable may not work as well as you expect for power delivery depending on the topology you choose. The most common variety of CAT6 uses AWG24 wires with a resistance about 0,085 Ohm/m, so a 100 m chunk of such cable will have a resistance of about 17 Ohms. Assuming a current of 100mA, you will lose 1.7V in the cable, so if you supply it with 5V, the load will only see 3.3V.

This is one more reason to split your network into segments. If I were to implement this project, I would power the "backbone" cable with higher voltage (12 - 24V) and install DC-DC converters producing 5V locally in each upper-level node.

It seems from the comments that you're looking into solutions which would allow you to use standard UARTs for communication. You can of course use RS485 (you will still need several segments). Otherwise, I advice you to look at how LIN is implemented: essentially, a 19200 bps UART signal is made open-drain (to combine all TX/RX pairs into a single wire) and amplified to 12V for noise immunity. Software-wise, a master sends a frame including slave's address and waits for a reply, then talks to the next slave and so on. Slaves only respond when they receive a frame with their address in it.

If you don't want to spend extra effort and implement something standard, at least looking into an existing spec while implementing your own solution will save you a lot of trouble.

  • Yes you are absolutely right. And i was also planning to supply 12V supply with voltage regulator. At different points.
    – umair
    Aug 7 '18 at 20:11
  • @umair please note that Dmitry suggested using "DC-DC converters"; don't go for a generic "voltage regulator" (which usually are linear), use a switching converter
    – frarugi87
    Aug 8 '18 at 12:33
  • @frarugi87 Unless the OP wants to defrost the parking lot in winter :) Aug 8 '18 at 13:03
  • @DmitryGrigoryev "it's not a bug, it's a feature" ;)
    – frarugi87
    Aug 8 '18 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.