# Should I consider using RS-485 for my next project

I am planning on an automation project that will be using several different sensors including but not limited to: Temperature, Barometric Pressure, Air flow, Humidity, etc.

As I was talking with someone they mentioned that I should look into RS-485 as a means to connecting my sensors to my controller. Then ultimately to the PC.

After a quick search I gathered some information about RS-485 but now I am wondering if it's over kill or if it's even used now a days?

Couldn't I just use a microcontroller that has enough inputs and interface with the PC using USB?

Thoughts?

EDIT: Ok if distance to controller and environment (in my case an industrial application) then RS485 might be useful. Are there other bus alternatives that might be more useful?

• Are there other bus alternatives?: Consider CAN. It sorts out things like collisions, bus arbitration, checksums and addressing that you have to do yourself over RS-485. Most micros over $1.50 now have at least one port and the transceivers are cheap too at about$0.60. (Pricing is for 1K volumes, YMMV). Mar 9 '15 at 7:52

I've used RS485 to connect multiple data-loggers together over distances of up to 100m. In this application it worked perfectly.

I haven't used RS485 to connect sensors directly to a controller but if you have sensors with RS485 outputs + a controller that supports RS485 and you have more than 10 sensors or the sensors need to be more than a short distance from the controller I would definitely use RS485 instead of analogue wiring. I found that as you add more and more analogue sensors to a controller (in my case, a data-logger) small issues with power supply noise, wire impedance and environmental interference suddenly become big issues.

• Agreed, if you have an application with range on sensors, you should probably find a more intelligent way of data transfer. Dec 4 '09 at 7:23

I think the big difference has to do with how far away your sensors are on your network.

If they're close, and likely not to be affected by electrical noise, then I don't think it matters too much. USB, RS-232, SPI, I2C, parallel, Bluetooth... all would be good options.

If they're far away, and likely to be around electrical noise, a system that utilizes a differential communication scheme (like CAN, RS-485, Ethernet) is probably a better route to go.

I would say the short answer is sensors->micro-controller->USB But, you don't give us a lot of detail as to the environment you will be working in, or how robust the entire system needs to be. If you have a noisy environment, long distances between the sensors, or a requirement for high reliability then you might want to look at professionally built equipment and something like RS-485. If you want to track the micro-climate around your tomatoes then some sensors and an arduino might be all you need.

• I forgot to submit my response, so I will add a comment to avoid clutter. jkopel is correct here, you are better off with sensor->uC->USB, but the environment is key. If you need more pins you can get external ADC modules and interface to them through SPI or I2C protocol rather easily. Dec 4 '09 at 7:17

If your sensors are near the PC, then USB could be OK, but it's not always the case. I have an energy meter in my house basement, and the computer that reads energy values is in my apartment (4th floor) ... No problem with RS485 (or a CAN bus), but try this with USB :-)

• or wireless in that situation. Dec 4 '09 at 17:10

RS485 is the equivalent of I2C but in larger scale, both have bus architecture with node adresses:

• RS-485 is excellent out to 4000+ feet of sensor wire. You can implement it for anything you would use I2C for. It has a wide variety of EMF and optical isolation options. RS-485 need a signal adapter to work
• I2C is faster not adapted for long distance, don't need a line driver to work and therfore comsume less

i hope it's clearer now

What about dallas one wire? I think they have a lot of sensors and that the network is fairly long range. I have never used it but always thought it was interesting. If you already have you sensors this does not make as much sense.

RS-485 is very useful in situations where the devices (sensors in your case) need to be remote from the controller. In general it's used where the device has it's own brains (i.e. an on-board microcontroller) and it's reporting to a PC. You can get 232 to 485 adapters that will let your PC talk RS-485.

If you can get the sensors into the same box as the microcontroller, then you could use 485 to talk back to the PC. It's not high-speed, but it's very robust and well understood in a lot of situations, and it pretty easily allows for additional devices. If you just have the one device, then 232 will do you just fine.