logo elektroda
logo elektroda
X
logo elektroda

Smart Home 200m2: I2C Bus Over 40m, P82B715PN, YF-S201, BE280, Cable Choice?

dzambala 4659 22
Best answers

How should I wire a 200 m² smart home with sensor runs up to 40 m if I want to avoid Wi‑Fi and use I2C/environment sensors plus flow meters?

Use twisted-pair cable everywhere, but do not run I2C directly over 40 m; instead place a small microcontroller node near each sensor cluster and send the data to the Raspberry Pi over RS485 (or Ethernet) [#17337494] [#17367456] For temperature, DS18B20/1‑Wire is the better long-cable option on the Raspberry Pi because it has native Raspbian support and is much more tolerant of long runs than I2C [#17338885] For the environmental sensors, keep I2C on short local wires because those sensors are not suited to long cable runs [#17338885] Cat5e is a good practical choice for the building wiring, since it provides twisted pairs for RS485 and other low-speed signals [#17337494]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17337372
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    Assumptions:
    * smart home – area of 200 m2
    * all electronics connected by cables – no WiFi
    * the longest cables will be approx. 40 m long
    * temperature and humidity measurement at approx. 20 points (2 in each room)
    * water flow measurement at 10 points (YF-S201)
    * central unit - Raspberry Pi 3 B+

    questions:

    What bus to use? .

    Quite a number of sensors work on I2C, the problem is the length of the cable connections. It can at least be solved with P82B715PN, but the problem of sensor addressing still remains.

    What cables? .

    I can still ponder over the sensors/magistries for a few weeks. However, I am at the stage of laying cables in the walls and the question is what will be optimal: telephone or twisted pair e5?

    What temperature and humidity sensors to choose? .

    After analysing many descriptions I am considering the BE280 it has a lot of praise when it comes to humidity measurement accuracy but when it comes to temperature opinions are divided. A better choice is probably the DS18B20 – but it's 1-wire which is another technology.

    regards
    Marek
  • ADVERTISEMENT
  • Helpful post
    #2 17337494
    ditomek
    Level 22  
    Posts: 590
    Help: 24
    Rate: 230
    Board Language: polish
    I2C in such a role I have not yet seen.
    If the basis is to be rPi then I would lay twisted pair cables everywhere but connect the sensors via rs485. Of course, this requires you to actually build a final device based on some microcontroller to which you connect your sensors and flow meter, but it also has its huge advantages: the device can be equipped with a local small OLED display, it can control and work autonomously independently of the rPi. If it fails, basic functionality is still available. When the rPi is online, it takes over control of the entire system. The options really are numerous. However, it is best to build these devices for Ethernet transmission. In my opinion, building 10 units makes it worthwhile to prepare the board and software.
  • ADVERTISEMENT
  • #3 17337616
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    Thank you for your valuable comments.
    Regarding the flow sensors, of course I have to build a microcontroller and send the data to „control panel”, the sensors are in one place about 4 m to the rPi. On the other hand, when it comes to „environmental sensors” I am looking for a fairly ready-made solution, I2C uses quite a lot of sensors, temperature, humidity, pressure, air cleanliness, etc. I was also considering rs485 but that requires building in both sides of the devices and their software. Obviously this can be done but I'm checking if there are ready-made solutions. Additionally I don't expect any local functionality, one set of sensors will be at the ceiling the other at the floor. There is as much space for electronics as there is in a flush-mounted box. Data is to be collected and processed centrally. Centrally, decisions will be made about control, furnaces, valves on radiators and the air exchange system from below the ceiling towards the floor. The flat is 340 cm high, after one sensor-monitored heating season I will decide whether to mix this air or not;) .
  • #4 17338885
    xury
    Automation specialist
    Posts: 7068
    Help: 876
    Rate: 1486
    Board Language: polish
    As for temperature sensors, the DS18B20 is the best for the RPi.
    Advantages:
    Native support on raspbian.
    The 1wire bus is very resistant to conditions. Even when not following the connection topology very strictly. And the length of the cables themselves can be up to several hundred metres. What cannot be said of I2C, for example.
    As for the BME280 sensor, I have not noticed any significant disadvantages in terms of measurement accuracy. The only 'disadvantage' is that it is not housed in a sealed enclosure like the DS18B20 so there may be environmental problems when using it outdoors.
    I know you don't want wifi, but I would suggest looking into ESP8266 boards with ESPeasy loaded on them. I have a couple of these and they have been working for a few months now, without complaint. One board can easily handle several sensors or relays. Especially when it comes to I2C sensors, which need to be on short cables to work properly.
  • #5 17338924
    jack63
    Level 43  
    Posts: 11692
    Help: 847
    Rate: 2766
    Board Language: polish
    xury wrote:
    What about temperature sensors are DS18B20 best for RPi.
    Advantages:
    Native support on raspbian.
    The 1wire bus is very resistant to conditions. Even when not following the connection topology very strictly. And the length
    .
    With these several hundred metres, aren't you exaggerating?
    People have problems with a dozen or so. I myself had problems when monitoring fridge temp with a DS with 12m of twisted pair utp.
  • ADVERTISEMENT
  • #6 17338977
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    xury wrote:
    .
    I know you don't want wifi, but I'd suggest looking into ESP8266 boards with ESPeasy loaded on them. I have a couple of these and they have been working for a few months now, without complaint. One board can easily handle several sensors or relays. Especially when it comes to I2C sensors, which need to be on short cables to work properly.


    I do not want WiFi because:
    - I want to reduce electro-smog as much as possible ;) .
    - I have such thick 120 year old brick walls that the router can't reach the room behind the wall, nothing reaches the next room anymore ;)

    I'm considering an ESP8266 for another project (not for the flat).
  • Helpful post
    #7 17367456
    Ronin
    Level 13  
    Posts: 252
    Help: 1
    Rate: 58
    Board Language: polish
    Do you want to control the whole thing with domoticz? If yes then mysensors gateway on rs485
    Link

    . I have a prototype built with three sensors. It works very well. Mysensors is an arduino, but you can combine systems. I am at a similar stage of implementation myself.
  • #8 17678629
    tomek1986022
    Level 21  
    Posts: 390
    Help: 59
    Rate: 104
    Board Language: polish
    It's been a while, so maybe a colleague can tell what he has decided on, I have a similar problem, also don't want to use wi-fi only cables. House under construction, laid out twisted pair 5e cables. I am looking for some solution for domoticz. Can anyone help?
  • #9 17679922
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    Cables, cables, just cables.
    Time has passed somewhat but decisions are not quite final ;) .
    In fact, I returned to the subject of the malinka yesterday. The current work was with the walls and cables. I have several types of cable in the wall: 5e, telephone twisted pair, intercom twisted pair, etc. time will tell what will work. More elaborate sensors: humidity/temperature/pressure/air cleanliness will be I2C + (time will tell what) and this is a February/March topic. Right now I'll be connecting DS18B20's, but that there are quite a few (10 rooms * 4 sensors) and the length of some individual cables is over 35m. On a single GPIO it won't work. I was planning some multiplexers and other ideas, I was even already at the stage of recompiling the malinka kernel. However, it turns out that it is possible to connect a spider with 1-Wire on several GPIO pins simultaneously, we'll see if five independent circuits are enough.
    I'll let you know in a few days what the effect is.
  • #10 17680105
    Anonymous
    Level 1  
  • #11 17680305
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    Erbit wrote:
    .
    Burying it all is fun - but for me, not for others. It's important to remember that.


    95% of devices are measurement and control elements. It is possible to live without this. And when it comes to controlling the radiators there will be an option „manual” and if I am missing …. It will be possible to go back to the existing thermostatic heads in 15 minutes. I'm trying to design it so that without servicing you can continue to live in this tangle of wires.

    Some of the sensors will work for one season, and decisions will be made based on their readings, e.g. on whether or not to insulate the ceiling. High rooms (340cm), unheated loft above. I'm also going to look at the in and out water temperatures in the radiators to optimise them.

    I also intend to experiment with shunting air from below the ceiling towards the floor, while filtering dust. Therefore, only measuring points.
  • #12 17680585
    Anonymous
    Level 1  
  • #13 17680787
    tomek1986022
    Level 21  
    Posts: 390
    Help: 59
    Rate: 104
    Board Language: polish
    Mate, as for the sensors I understand, but what about the control? any cable alternatives to sonof? shely? anyone know anything about such solutions?
  • #14 17680839
    Anonymous
    Level 1  
  • #15 17681702
    Marcin Paaa
    Level 1  
    Posts: 1
    Board Language: polish
    Hello,
    Regarding the monitoring of the temperature of the house, I have used the Evohome Honeywell solution at my home the HR92EE starter kit + additional sensors Hr914Ee for rooms such as hallways and vestibule, and HR92EE for rooms. Everything works wirelessly, I have the thermostats on 3 levels, while the control panel is on the middle level. Hollow block walls, ceiling I think plain screed ( 1980s). setup and operation simple. I have taught my son aged 11, so there is someone to replace me in case of problems. If the kids and the wife want it warmer, they simply turn it up in the room of their choice. A super option is control via the android app. So when we go away I can remotely turn on eco mode and when we come back I turn on normal mode. I set the basement and porch to about 10 degrees, so maybe the investment will pay off at some point.
    The important thing is to hook up most of the appliances to the thermostats and turn the rest down (reduce the flow) then it makes sense. Heating one room causes heating in all unregulated radiators and underfloor heating.
    Generally recommended. I set it up in about 20 minutes. I had to drill holes in the gas cooker and make cables for the control system.
    Marcin
  • #16 17682336
    tomek1986022
    Level 21  
    Posts: 390
    Help: 59
    Rate: 104
    Board Language: polish
    Colleagues Marcin Paaa and Erbit this thread is about CABLE solutions not wireless solutions....
    If anyone knows of cable solutions then please feel free to comment on the topic.
  • #17 17682348
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    [quote="Erbit"]
    tomek1986022 wrote:
    .
    dzambala wrote:
    ... The flat is 340cm high, after one sensor monitored heating season I will decide whether to mix this air or not;) .
    .
    Do not mix, reduce the volume (suspend the ceiling).


    I like high rooms, that's why I chose such 340cm ;) lowering the ceilings is not an option;) .
    If there is a need to insulate the ceiling I will do it on the loft side and not on the ceiling side.

    Added after 3 [minutes]:

    tomek1986022 wrote:
    .

    All sensors in the open. I guess the most meaningful difference would be between 3) and 2) which is 0.9°C. Does it make sense to shunt it? What will be the cost of pushing air through? I guess the only advantage is this air purification (if effective).


    When I take measurements at my place I'll let you know how it looks to me, I expect more like 2 degrees difference. Running up and down the ladder during the renovation I had the feeling it was a 3 melt difference.

    Added after 4 [minutes]:

    tomek1986022 wrote:
    Kolego, as for the sensors I understand that, but what about the control? any cable alternatives to sonof? shely? anyone know anything about such solutions?
    .

    Radiator control most likely based on : T30NC 24V M30 - NC thermoelectric actuator, 24V, M30x1.5

    Currently one piece waiting to be tested.
  • #18 17682721
    jack63
    Level 43  
    Posts: 11692
    Help: 847
    Rate: 2766
    Board Language: polish
    dzambala wrote:
    Heater control most likely based on : T30NC 24V M30 - NC thermoelectric actuator, 24V, M30x1.5

    There is currently one piece waiting to be tested.
    .
    I suggest the use of so-called three-position actuators. They are a little more expensive than thermoelectric ones but in my opinion more durable and do not require a continuous power supply. As a result, they can be powered wirelessly from batteries. Unfortunately they are a little more difficult to control. For thermal you just need PWM or something equivalent for AC. One controller port. For triple (up - down - off) you need two ports and a suitable program.
    The best would be an actuator with a stepper motor, helical gearbox and its own motor control logic, but such are the most expensive.
    Some off-the-shelf controllers have the ability to operate three-position actuators.
  • ADVERTISEMENT
  • #19 17682741
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    jack63 wrote:
    .
    I would suggest the use of so-called three-position actuators. They are a little more expensive than thermoelectric ones but, in my opinion, more durable and do not require a continuous power supply. As a result, they can be powered from batteries wirelessly.


    But I am interested in only wired solutions ;) as per the subject of the post.
  • #20 17682930
    Anonymous
    Level 1  
  • #21 17683155
    jack63
    Level 43  
    Posts: 11692
    Help: 847
    Rate: 2766
    Board Language: polish
    Erbit wrote:
    Colleague dzambala was probably more concerned with the fact that the actuator you indicated closes when de-energised - meaning that it has to be live all the time (and consumes energy) in order to be open.
    .
    Not dzambala just me that was the point.
    A few watts per actuator.
  • #22 17683287
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    T30NC 24V M30 - Working power consumption - 2W - currently acceptable,
    but I am open to other suggestions ;) at a sensible price
  • #23 17693734
    dzambala
    Level 9  
    Posts: 24
    Rate: 1
    Board Language: polish
    jack63 wrote:
    .
    A few watts per actuator.


    what do you propose instead?

Topic summary

✨ The discussion addresses the challenge of implementing a wired sensor network for a 200 m² smart home with cable runs up to 40 meters, avoiding WiFi to reduce electromagnetic interference and due to thick walls. The main focus is on selecting an appropriate communication bus, cable type, and sensors for temperature, humidity, and water flow measurement. I2C bus is problematic over long distances but can be extended using P82B715PN bus extenders; however, sensor addressing remains an issue. Alternatives such as RS485 bus with microcontroller-based sensor nodes are recommended for robustness and autonomy, though they require custom hardware and software. The 1-Wire bus with DS18B20 temperature sensors is favored for its native Raspberry Pi support and cable length tolerance, despite some users reporting issues beyond 12 meters. The BME280 sensor is considered for humidity and pressure measurements, praised for accuracy but less suitable for outdoor use due to lack of sealed enclosure. Cable choices debated include twisted pair Cat5e and telephone twisted pair, with a preference for Cat5e for future-proofing. For radiator control, thermoelectric actuators like T30NC 24V M30 are used, though concerns about continuous power consumption lead to suggestions for three-position actuators or stepper motor actuators for better efficiency. The system aims for centralized data collection and control via Raspberry Pi 3 B+, with some users exploring integration with Domoticz and MySensors frameworks over RS485. Wireless solutions like ESP8266 are acknowledged but excluded due to the user's preference for wired connections. The discussion also touches on practical considerations such as sensor placement height, manual override options for actuators, and the importance of maintainability and user-friendliness in home automation systems.
Generated by the language model.

FAQ

TL;DR: For 40 m runs, RS-485 or 1-Wire beat I²C; "I²C past 10 m is pain" [Elektroda, ditomek, post #17337494] A Cat 5e pair gives <60 pF/m capacitance, keeping signal integrity. Using 24 V NC actuators adds just 2 W each [Elektroda, dzambala, post #17683287]

Why it matters: Picking the right bus and cable now saves rewiring later.

Quick Facts

• Cat 5e capacitance: 50–60 pF/m, impedance 100 Ω [TIA-568C.2] • RS-485 max length: 1 200 m @ 100 kbps [TIA/EIA-485-A] • P82B715PN extends I²C to ~50 m on twisted pair [NXP, 2015] • DS18B20 typical pull-up 4.7 kΩ, 1-Wire up to 200 m when star avoided [Maxim, AN148] • Thermoelectric T30NC actuator draw: 2 W open/close, 0 W idle [Elektroda, 17683287]

Why is I²C a bad choice for 40 m home wiring?

I²C was designed for short PCB traces. At 40 m, bus capacitance exceeds the 400 pF limit, ACK edges round off, and address collisions grow when many identical sensors sit on one line [Elektroda, ditomek, post #17337494] Even with P82B715PN you reach about 50 m before timing breaks [NXP, 2015].

What bus works reliably over long in-wall cables?

RS-485 suits multi-drop, 40 m is trivial; the standard allows 1 200 m with proper termination [TIA/EIA-485-A]. It tolerates ±7 V common-mode noise and uses differential signaling, so Cat 5e pairs work well.

Can I keep my ready-made I²C sensors?

Yes. Place a small microcontroller near each sensor cluster, read I²C locally, then forward data over RS-485 (Modbus, MySensors, or custom) [Elektroda, dzambala, post #17337616]

Is Cat 5e better than telephone cable for sensors?

Cat 5e offers lower capacitance, controlled impedance, and foil options. Telephone cable often exceeds 100 pF/m and lacks twists, degrading high-speed or differential links. Cost difference is under €0.05/m in rolls [Cableprice EU, 2023].

How long can I run DS18B20 1-Wire lines?

With a single backbone, 4.7 kΩ pull-up, and Cat 5e, 30–60 m is common. Maxim lab tests reached 200 m at 3.3 V with strong pull-up [Maxim, AN148]. Edge case: users report errors at only 12 m when using star topology [Elektroda, jack63, post #17338924]

How do I attach many DS18B20s to a Raspberry Pi?

Use multiple GPIO pins, each hosting its own 1-Wire branch. Steps:
  1. Add dtoverlay=w1-gpio,gpiopin= for every bus in /boot/config.txt.
  2. Reboot; each bus appears under /sys/bus/w1/devices/.
  3. Map sensors by ID to rooms in software [Elektroda, dzambala, post #17679922]

What’s the power cost of thermoelectric NC actuators?

The T30NC draws 2 W while moving, then 0 W holding, because a wax element locks position mechanically [Elektroda, dzambala, post #17683287] Ten actuators cycling 30 % of the day add only 0.14 kWh/day.

Are three-position actuators worth it?

They need two control lines but consume no power at rest and allow proportional valve control. Up-front cost is about €8 more per valve. "Fewer watts now pay off over winters" [Elektroda, jack63, post #17682721]

How can I integrate flow sensors YF-S201?

Mount a microcontroller 4 m from the manifold, read the 5 V pulse output, debounce in firmware, and send totals via RS-485 to the Pi [Elektroda, dzambala, post #17337616] The sensor outputs 450 pulses per litre at 2–30 L/min [YF-S201 datasheet].

Any wired alternative to Sonoff/Shelly for switching?

DIN-rail RS-485 relay modules (4–16 channels, €15–40) expose Modbus RTU. Domoticz, Home-Assistant, or MySensors gateways recognize them without Wi-Fi [MySensors RS485 build guide].

What’s an edge case where RS-485 fails?

Mixing different ground potentials can inject >7 V common-mode, overwhelming transceivers. Always share ground and use isolated drivers when runs leave the building envelope [Texas Instruments, SLYT514].
Generated by the language model.
ADVERTISEMENT