remote sensors - wich (wired) connection is better?

Hi evrybody,

im a newbie so please forgive me for any mistake/missing info/wrong topic etc, ill do my best.

My aim is the following:

I want to build a DOMOTIC system based on a RASPBERRY PI (php server for interfacing all commands, i.e. close window, switch off lights etc) linket through UART to a ARDUINO MEGA (master, other arduinos will be connected later on but this is not the actual problem) with a GSM SHIELD (so that i can command all stuff also by means of a mobile phone)

in practice:

intenternet (router)-ETHERNET-raspberry-UART-mega-??????-all actuators and sensors and maybe some slaves

The problem is related to the connections between the mega and all sensors and actuators, potentially far tens of meters.

Due to the fact that the hause i would like to "domotize" is not totally built yet, i wanted to use as many wires as possible because im a little afraid of wireless systems: a twisted wire is working/not working and so it will be "forever" and also because im free to place as many "wire pipes" as i wish.

Here comes the problem: i cannot connect anything by means of simple wires farther then 50cm-1m.

The possible solution i analyzed:

-signal repeaters along the wire=>expensive, unefficient (pw dissipated), hard to implement (inside pipes i should place thousand of those)
-wirelessy sonnected remoted arduinos (xbee-like)=>expensive (one arduno+xbee evry group of I/O), unefficient & i like wires :slight_smile:
-wirelessy connected remoted sensors=>a little cheaper, unefficient (lots of power supplys), a mess to implement (70-80 wireless I/O?) & again i like wires :slight_smile:

Any suggestion?
Have anybody tried something similar?

P.S. sono italiano, scrivo in inglese perchè oramai sono abituato a cercare e chiedere così, ma una risposta è ovviamente la benvenuta in qualunque lingua sia, se volete una traduzione in ITA non avete che a chiedere :slight_smile:

If you use ethernet cable, cat5 or cat6, you can use RS485 signals.
The ethernet cable can also be used for some power (not too much).
If you use 12V .. 30V as power, and use DC/DC converters for each Arduino, the total current is limited.
I would use Arduino boards as remote I/O at the end of the cables.

internet (router) - ETHERNET - raspberry - UART - mega - RS485 - Arduino - remote actuators and sensors

If there are many power cables next to the ethernet cable, or the cable is very long, I would add optocouplers. That will prevent any grounding problems.

thank you for my first answer!
:slight_smile:

the problem is that i need to install switches (for light driving) pretty much "far from evrithing", and i would like to avoid using one adruino only for one button, if i understend correctly your answer

You wouldn't be using an "arduino" per se, you would be using an atmel chip at each light. This would be a barebones type board. An ATTINY 45/85 or 44/84 is perfect for this sort of thing.

laadams85:
You wouldn't be using an "arduino" per se, you would be using an atmel chip at each light. This would be a barebones type board. An ATTINY 45/85 or 44/84 is perfect for this sort of thing.

sorry, i cannot get it. (too newbie maybe)

Do you mean to use an ATTINY plugged into some sort of "ethernet shield"?

because that would require tens of "input" ethernet ports, i think

Suggested RS485 protocol is very good decision, you will need on distance places some Tiny Arduino like Board if you prefare Arduino, also You may use 1-Wire combination by MAXIM-Dallas . They have various range of IC-s .

I use both, and i am satisfied of they performance.

Regards,
DUbravko

What you could do is use some of these:

Each censor would have one of these radios with something like an attiny to handle the rf protocol. There would be one arduino connected to your PI to receive all the signals.

You don't need to have another arduino at the other end of your wires. The "RS485" part that is important is only the physical layer. You do not need the datalink layer.

Your hint was in using twisted wire. Twisted wire is used for differential signaling. So, all you need to do is convert your single-ended signaling (what you have now) into differential and then back to single-ended again. There are numerous drivers out there that do this. They are refered to as "Line Drivers" what would make one line driver RS485 and another RS422 is simply the voltages that are used. Any manchester encoding, protocoling, and all that other jazz is completely up to controller. All the line driver cares about is taking your single ended signal and converting it to a differential.

Retroplayer:
So, all you need to do is convert your single-ended signaling (what you have now) into differential and then back to single-ended again. +

do you think i need to do arduino->"rs485 encoder"->WIRE->"rs485 decoder"->switch->"rs485 encoder"->WIRE->"rs485 decoder"->arduino

or it is enough to do arduino->"rs485 encoder"->WIRE->switch->WIRE->"rs485 decoder"->arduino

can you please suggest me any connection drawing, so that i can better recongnize what you meant?

i also found this topic http://arduino.cc/forum/index.php?topic=19254.0 but it doesent seem to have a "general long wire" solution

Let's switch that around... what would be the ideal way for your you to hook things up? Meaning, how would YOU like them hooked up? And we will go from there.

thank you for your kind answer :slight_smile:

the best thing would be to find a way to amplify/encode the 5v signal close to the arduinos (so that i dont need to bring any extra power supply outside the "control box" where transformers, relays, controllers, pi and shields are settled), send them to any switch/sensor and then back into the "control box".

The idea was:

-PI, SHIELDS and ARDUINOS that drives all RELAYS that move the power that is "generated" from the TRANSFORMERS <--- all inside the "control box"

-signals wires from/toward the controllers to the sensors and switches

-"power wires" from the relays to any actuator (i.e. lights, window actuators and so on)

if i am not clear enaugh ill provide any drawing :slight_smile:

RS485 is a way to go along with Cat5 or Cat6 cables. Since your house has not been completed yet, it is much better to put in as much high quality cable as possible inside walls.

Also if total distance is not that much, you can also transmit 24V power over Cat5/Cat6 cable so that your switch or other remote devices does not have to be powered separately. Of course, do not transmit line power over it.

disclaimer: I am saying this because I have RS485 shield like that for sale so I am biased.

it seems to be a good idea, but my (ignorant) questions are:

-how do i connect any switch/sensor through a "ethernet" cable? may I send up to 7 signals? only digital ones are allowed?
-can i program my controller with the shield connected as if any inner wire is a "pin"?
-how many shields may i use for each arduino? may i leave the serial pins for other applications?

to be more specific about the sensors i will place:

-"rain" sensors http://cgi.ebay.it/ws/eBayISAPI.dll?VISuperSize&item=121067055196
-"hall" sensors http://cgi.ebay.it/ws/eBayISAPI.dll?VISuperSize&item=270984792461
-"light" sensors http://cgi.ebay.it/ws/eBayISAPI.dll?VISuperSize&item=271083725046
-some -not well defined- "ir/movement" sensors
-switches (normal or capacitive)
-temperature/humidity/pressure sensors

these are not the final choice obviously, and if required i can "cut" the analog ones and turn them into digital, i posted links only as "suggestions"

sorry for all those questions but it is hard for me to imagine this "connection" :slight_smile:

P.S. i dont think im going any farther then 50 m (probably 30m are enaugh)

Please post new links, those don't work.

RS485 Cable spec;-
Shielded: Yes
Impedance: 100-130 ohms
Distributed capacitance: <100 pF/m
Wire: AWG 18

Cat 5/6 Cable spec;-
Shielded:STP, ScTP, UTP
Impedance: 85-115 ohms
Distributed capacitance: <= 52 pf/m
Wire: 24–26 AWG/Cat5, 22–24 AWG/Cat6

2 catches for using Cat 5/6 Cable sub RS485 Cable;-

  1. Impedance, It could be fine tune the transceiver resistor to keep match.
  2. Only STP Shielded cable is compatible, order that type cable only.

Erdin:
Please post new links, those don't work.

true, sorry!
http://www.ebay.it/itm/280992276053?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
http://www.ebay.it/itm/271083725046?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
http://www.ebay.it/itm/270984792461?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

sonnyyu:
RS485 Cable spec;-
2. Only STP Shielded cable is compatible, order that type cable only.

may i ask you why? (just to know it)

sonnyyu:

  1. Impedance, It could be fine tune the transceiver resistor to keep match.

you mean it is "enough" or is it only better?

sotomaior:

Erdin:
Please post new links, those don't work.

true, sorry!
http://www.ebay.it/itm/280992276053?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
http://www.ebay.it/itm/271083725046?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
http://www.ebay.it/itm/270984792461?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

sonnyyu:
RS485 Cable spec;-
2. Only STP Shielded cable is compatible, order that type cable only.

may i ask you why? (just to know it)

sonnyyu:

  1. Impedance, It could be fine tune the transceiver resistor to keep match.

you mean it is "enough" or is it only better?

take a look picture, UTP is no shield then out. ScTP is shield all pairs then have to out. Only STP Shielded cable is compatible.

transmission line is require impedance match. RS485 transceiver IC is designed to work at Impedance: 100-130 ohms, now we feed it Impedance: 85-115 ohms cable, fine tune resistor to keep match.

all above is for keep system run at long distance, for short distance it does not matter.
but question if for short distance why you use RS485 anyway?

sonnyyu:
all above is for keep system run at long distance, for short distance it does not matter.
but question if for short distance why you use RS485 anyway?

What do you mean by "long distance"? im planning to do a 70 m^2 domotic house, so there isnt any long distance, but 20-30m are enough to kill my 5v dc signal i think...

im searching the easiest possible way to place sensors and switches into all rooms starting from a single "control box", possibly in a wired way, i understand that for serial communication the rs385 is a good idea, but is it useful and simple also for trasmitting a single 5v dc signal for a deviator for example?

1200m is max, say few hundred m to 1.2km is long distance.
20-30m, you do not need do anything, even it might work at UTP cable.

do you mean using rs485 data transmission or the "simple" 5v digital signal?