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)
Questions
- How long can the lines be?
- Can the lines branch?
2 Answers 2
I have a page about connecting Arduinos using RS485. You can connect multiple devices up like this:
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:
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– Catprog2016年01月27日 02:57:06 +00:00Commented 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.2016年01月27日 03:30:30 +00:00Commented 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– Catprog2016年02月08日 01:08:13 +00:00Commented 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– Catprog2016年01月27日 02:53:20 +00:00Commented Jan 27, 2016 at 2:53
-