Hello i was wondering for SPI and I2C how far can i run a sensor without having some problems with it? I been searching online and getting some mix results online on how far i can run a Sensor on SPI or I2C. Can someone help me to figure this out.
P.s.s I'm running some temperature sensor Dht22. I need to run it upto 15Ft in any direction. Is this possible or would i have some problem with Data traveling that far?
Edit: I'm sorry i forgot to ask one Question. Would i need thing to run long distance Externally?
High speed SPI is definitely deisgn for the same PCB - like any high speed logic signal it
won't tolerate long runs.
I2C is typically used at a lowish bandwidth, and would tend to fare better as a result, but its
still designed for same PCB use.
long runs are best done with something tolerant of signal reflections such as serial which doesn't
use a clock line. Double-clocking is one of the first problems you are likely to encounter if
trying to run a logic signal too far, alongside crosstalk.
For very long runs an impedance matched connection, such as RS485, is recommended.
The DHT22 doesn't use SPI or I2C - in fact its protocol is explicitly designed for low bandwidth
and should be pretty robust over long runs.
Note that with long runs you need to be careful to protect the chips at either end from noise pulses
caused by mains switching and lightning - make sure the ground wire is solidly connected, and
adding a series resistor of 100 ohms or so to the signal line is useful both for protection and to
reduce reflections from the sending end.