I am looking to setup a system where I have a master Arduino polling a number of sensors.

The way I am thinking is hooking the master TX line to the sensors RX line(and the opposite for the other line)


  1. How long can the lines be?
  2. Can the lines branch?

2 Answers 2


I have a page about connecting Arduinos using RS485. You can connect multiple devices up like this:

RS485 setup

That has a reasonable range, 20 metres or more.

On that page I describe a Rolling-master system where each device takes turns to be the master and transmit information to the other devices. It also manages some devices not responding.

This screenshot shows the various devices "talking" during their timeslot:

Rolling master demo

In that particular case there were 3 devices active out of 4 configured.

I have a master ardunio polling a number of sensors.

I'm assuming in my answer that you have an Arduino at each sensor point (you could use a cheap ATtiny85 or something). That would be needed to run the rolling master code.

  • Does the bus need to be straight or can it branch?
    – Catprog
    Jan 27, 2016 at 2:57
  • I don't offhand see why you can't branch. The two wires are in parallel to each device, so I suppose you could take a branch off at some point.
    – Nick Gammon
    Jan 27, 2016 at 3:30
  • From what I can see RS485 does not like branches. However what I have come up with is running two twisted pairs. One being return and that allows me to have T junctions.
    – Catprog
    Feb 8, 2016 at 1:08

How many sensors and what kind are they? What Arduino do you have?

Basically you could use 1 Arduino Output per sensor if you have enough, or you are going to need to use a multiplex technique via additional electronic components.

The only other solution would be to use communication (I2C/Serial/etc) to receiving nodes at the sensor.

  • MPU 6050 with an Ardunio on each sensor to send the data onto the bus.
    – Catprog
    Jan 27, 2016 at 2:53
  • @Catprog Try and read up on SPI. You may not need the Arduinos at each MPU6050 if you use that protocol.
    – James
    Jan 27, 2016 at 3:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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