PDA

View Full Version : What kind of data communication use?



microuser
- 19th November 2012, 12:07
I want to create a system where all devices are able to switch on/off a relay, read value from a sensor, read an input 0-1. Naturally each device will have its own ID and they will be managed by a PC software.
I have experience with serial communication (many times ago I got wired about 10 PICs with serial port distributed over 100m cable).
This time probably I will have more devices, maybe >100 and distance between one device and the other will be 2-3m.
The idea is to have max. 2 wires or do all with some RF modules. I also know that Microchip have many new solutions (LIN-WiFi modules...) for connectivity, in total I should cover more than 200 meters.
What kind of data communication do you suggest me to use?
Thanks, Regards

HenrikOlsson
- 19th November 2012, 13:40
Hi,
For the physical/electrical interface I'd use RS485, with a twisted pair cable and proper termination it'll easily handle the distance you mention. You could go the ethernet route but it adds complexity and cost - and requires at least 4 wires.
For the protocol I'd use MODBUS (RTU for RS485 or TCP for ethernet), it's a well established protocol with good (and free) documentation.

I don't have any experience with wireless so I won't comment on that.

/Henrik.

Jerson
- 20th November 2012, 05:14
Just a word of caution. Since you are talking of a Multi-master system here, you should be aware of something called CSMA-CD communications. Without implementing that, you will have a lot of trouble. FYI : it has more to do with hardware techniques to achieve that.

HenrikOlsson
- 20th November 2012, 07:06
I don't interpret the system in the original post as a multi-master system but IF that is the case I'll take back my advice regarding MODBUS since that is a single master/multiple slave protocol only.

/Henrik.