What RS485 options are available for linking lots of sensors and Arduino's?

Hi everyone...

I am working on a bunch of projects using Arduino's to collect environmental data and controlling it.

My biggest problem is connectivity at this stage. The distances between sensors and output devices
range from between 1 meter(3 feet) to +50 meters (+160 feet.). Number of devices also range from
5-20 per project.(Cost and electrically noisy environments(Factory Machines) are also factors)

My questions are:

  • Am I in the right direction looking at RS485 for connectivity?
  • What affordable and easy to implement options are available?
  • Should I consider designing an easy/affordable solution? Would this be useful to other people or am I reinventing the wheel?

I have looked a the following options:
SparkFun Transceiver Breakout - RS-485 - BOB-10124 - SparkFun Electronics? - Good option but it does not offer termination options. (Can only link 2 nodes.)
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=323 - Very cheap,little documentation and not sure about number of nodes.
Error, Electronic & Electronics Components Depot United States - Best option I could find. Has termination options,code. Using RJ45 connectors like the Sparkfun option would have been better,because finding twisted-pare network cables are easier to find.

I have looked at wireless options but as the sensors all need continuous power they will all need some kind of wire to power. Interference is also going to be an issue and because these projects will end-up as production systems it will need to be very robust.

Any help/input will be appreciated.

Protoneer:
My questions are:

  • Am I in the right direction looking at RS485 for connectivity?
  • What affordable and easy to implement options are available?
  • Should I consider designing an easy/affordable solution? Would this be useful to other people or am I reinventing the wheel?

The first option is the one I use. Do not forget that the 485 is a description of physical, electrical, NOT transmission protocol.

I use it with 15 devices, and it works fine .. however, the problems, it will always have the communication protocol ...
The only consideration to keep in mind is whether the transmission is half or full duplex .. 2 or 4 wire. You have described are all Half

Protoneer:
I have looked a the following options:
SparkFun Transceiver Breakout - RS-485 - BOB-10124 - SparkFun Electronics? - Good option but it does not offer termination options. (Can only link 2 nodes.)
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=323 - Very cheap,little documentation and not sure about number of nodes.

All models described, support multiple nodes. This in particular has built resistors alls, worst of not having them, you can put them.

Am I in the right direction looking at RS485 for connectivity?

Yes.

Should I consider designing an easy/affordable solution?

Yes.

Would this be useful to other people or am I reinventing the wheel?

I hope it would be useful because I'm spending a lot of time (re)inventing this particular wheel :slight_smile:

If you are not in a huge hurry (and I assume not as you are considering designing your own system) you may be interested in this

http://www.ardweenet.com/

It's still early days, prototype PCBs have been made but not loaded and a heck of a lot of code has to be written yet but this should give you up to 254 nodes each up to 1200 metres apart with each node being a Mega1294-based Arduino.


Rob

cueli:
The first option is the one I use. Do not forget that the 485 is a description of physical, electrical, NOT transmission protocol.

Yes.... It sit on the physical layer of the stack. I have ordered a few RS485 chips and will start playing around with them shortly.
I think I will end up going with a custom design in the end. All of my sensors will have an ATTiny84 to process sensor data and
transmit it on request. The ATTiny84's are cheap,has plenty of pins and can do Software-Serial.

Half-Duplex is fine as it will keep the costs down and the Master can be a bit more powerful MCU. The Master will upload data
to an internet hosted database and will receive commands from a web-api.

Graynomad:
I hope it would be useful because I'm spending a lot of time (re)inventing this particular wheel :slight_smile:

If you are not in a huge hurry (and I assume not as you are considering designing your own system) you may be interested in this

http://www.ardweenet.com/

Hi Rob,

Very interesting+complicated project you are working on. Interesting how total strangers can come up with
very similar thoughts. My thought was also to send the power over the the connection like power over Ethernet.

Makes it so much cleaner if you can send data and power over one physical cable.

Not sure if you have seen this post before:

Very clean and informative description of making it work. Will definitally be using it as an example with
my testing I will be doing shortly.

Yep seen that, Nick has a lot of good tutes on his site.

I originally had a multi-drop bus with a master, but changed it to the current redundant-ring-multi-master topology, I think it is potentially much more robust because even with 2 or 3 faults you still have a mostly (or even entirely) working network. Multi-drop-master only needs one small fault and the whole lot collapses in a heap. That said I guess it's been good enough for all manner of networks over the years.

In fact I had Attiny84s as well, but wanted to go faster than they could handle. At present I can get 500kbps which is getting close to what I'd like, admittedly that's not continuous throughput yet but it should work at that speed or better.

It sounds like your idea is very similar or even the same as my original design, with a very fine node granularity, ie one node one function. As you've seen I've moved away from that a bit because no matter now many things a node does it still needs the same network overhead. So I decided to amortise that overhead over multiple functions.

That said the APE chips will be capable of working stand alone, in which case we're back to a tiny 3-chip node for just a few $.

My thought was also to send the power over the the connection like power over Ethernet.

As I to have done, it's not always appropriate due to voltage drops, wire ampacity etc but when it is it saves a lot of mucking around.


Rob