After reading our guide on How to Interface a Piano/Rocker Switch (SPST) With ESP32 Arduino, one reader has asked whether it is possible to keep all his ESP32 with relays and indicators at one room and connect the switches, sensors of the whole house via cables. That is possible to deploy but various hardware components will be required. Also, coding may need some change. I believe that so huge work is practical for one sensor but not for a bunch of switches. The software-based IoT hubs avoid the complexities of communication.
The length of the cable will depend on the type of signal transmitted such as whether it is analogue or digital, its frequency, low/high impedance of the signal source, the type of cable used and so on. For I²C, the length is better to be within 3 meters. The length can be made as long as 300 meters.
With a 22AWG cable length of 50 meters and a 100mA current, the voltage drop would be around 1 V. The capacitance of any cable will affect the rise and fall times of the signals. That can affect the measured duration of the pulse received from the sensor. As for the analogue signals, it may be important to add a capacitor to decouple the power to the sensor at its terminals. But, really I wouldn’t add capacitor alone to the sensor line. I will also add a resistor before the filter capacitor. In the case of an SPST switch, following this way you can practically use a 100 meter shielded cable (like CAT 5e cables or cables that are used for phone lines).
For longer distances, and to save from electrical noise, differential signalling is often used. RS-422 systems can transmit data at rates as high as 10 Mbit/s or may be sent on cables as long as 1,500 meters at lower rates. PES-2607 is an RS422/RS485 Expansion Board for Arduino Uno. There are few articles on this internet on how to interface RS485 modules with ESP32 and write the code. There are different error detection algorithms and schemes for such kind of setup. There is Reed–Solomon error correction library for Arduino/ESP32. I discussed about Kalman filter, which can be tested.
But, the space on ESP32 is too little. It is so small space that I had to edit the code for Detect Smartwatch With ESP32 on IBM Watson IoT Widget, even after Solving ESP32 Sketch Too Big Error. If you use a lot of pins then the code probably will become enough big not to fit on an ESP32. The idea was great but difficult to implement using wires. Instead, you can have a “physical control panel” connected over Wi-Fi or the internet.
Using one ESP32 per room is the usual norm. It is possible to use one ESP32 for two adjacent rooms, corridors etc as the length of the cable will not exceed 10 feet.Tagged With https://thecustomizewindows com/2021/04/what-is-the-maximum-cable-length-between-arduino-esp32-and-a-sensor/ , https://thecustomizewindows com/2021/04/what-is-the-maximum-cable-length-between-arduino-esp32-and-a-sensor/#:~:text=The length can be made pulse received from the sensor , Arduino fingerprint sensor maximum cable length , arduino sensor cable length , https://thecustomizewindows com/2021/04/what-is-the-maximum-cable-length-between-arduino-esp32-and-a-sensor/#:~:text=The length can be made fall times of the signals , https://thecustomizewindows com/2021/04/what-is-the-maximum-cable-length-between-arduino-esp32-and-a-sensor/#:~:text=The length can be made would be around 1 V , long cables for arduino