Electronic – arduino – Long range sensor readings in a star network with Arduino

1-wirearduinors485sensor

I'm planning a project that requires me to have around a dozen temperature and humidity sensors placed around the house and the yard. These would connect to a central Arduino in the house that would log the data and send it to a database elsewhere.

I have browsed the internet for solutions that work for long cable runs. For temperature sensors I found 1-Wire, especially DS18B20 sensors. However, there doesn't seem to exist humidity and pressure sensors that utilize 1-Wire.

What is the easiest way to accomplish such network of sensors? RS485 seems to do great even with long cables (my longest run will be less than 50 meters, most in the 5-10 m range) but as far as I know it would require a microcontroller in each end, which would add complexity.

Best Answer

If you must use a wired option, then it sounds like you have lengthy cable lengths and you'll need to design for both a long-distance communication and long-distance DC power.

For wired communications, RS-485 as you mentioned is not bad and can be driven by a UART, which is easy in software. CAN is also a good candidate and brings some more benefits if you are willing to do more software (or not, depending on what code you can find off the shelf). I would avoid SPI or I2C - these are meant to be on a board and not travel such long distances.

For both RS-485 and CAN, it would be best if you could get your hands on twisted pair cable, and it would be a bonus if you could find a composite cable with a twisted pair and a DC power pair. Although, for home/hobby use, it would probably still work well enough if you didn't have twisted pair on the data lines.

For DC power, you will need to design for a voltage drop and also some protection for ESD, lightning-induced effects (you have a long antenna there) and also shorted conductors in case your cable gets damaged.

If wireless is in play, then a Zigbee network is the way to go. Digi's XBEE would be an excellent start. However, you'd need to power your remotes separately or with batteries, which can be done but is another design step. The XBEE network could be managed directly by your database PC via USB, thereby skipping the Arduino part.