The (cabled-) distance between the sensors and the ESP32 is about 10 meters, so I plan on using an UTP cable. Both sensors are powered by the ESP32 using 3.3 V, so I’m guessing that mixing power and data in the same UTP-cable will be OK (or am I going wrong here already?).
Searching the internet, the most common suggestion for wire allocation seems to try as much as possible to have the same current in both wires of a twisted pair (they experience the same external influences), so the wires of each data signal circuit (data and ground) in a twisted pair.
Using this rule of thumb leads to:
3 twisted pairs for the A02YYUW: power supply, TX and RX
2 twisted pairs for the DS18B20: power supply and data
Since an UTP cable has only 4 twisted pairs, I wonder if I can use 1 twisted pair to power both sensors, and use the remaining 3 twisted pairs for the data signals?
Having all ground wires connected on the sensor side (and EPS32-side obviously), it seems to me that the current has a lot of options when “choosing” this path, and thus not necessary have equivalent current in both wires of a twisted pair. But maybe that’s ok?
Summarizing:
1/ do I allocate twisted pairs as:
3.3 V & GND
TX (A02YYUW) & GND
RX (A02YYUW) & GND
data (DS18B20) & GND
2/ do I use only one UTP-cable, or do I need to use one for each sensor?
rather doubtful about reading these sensors over 10metres of cable - you will probably have to try it and see if it works
is there any particular reason why the ESP32 is 10 metres from the sensors
I use the same sensors connected to a TTGO LoRa32 SX1276 OLED for a river minitor
My setup will be used to monitor the water level in a rainwater reservoir located underground next to my house. The 10 meter is the length of the cable needed to connect the sensors (attached to the lid of the reservoir), to the ESP32 which is located inside for easy access and WiFi/Bluetooth access.
Later on, I would like to add flow sensor (YF-G1) getting data from my hydrophore pump to have a better estimate of my rain water usage. Since the pump is located inside, it’s an additional argument for installing the esp32 in my basement...
Cheat and copy a basic idea of POE (Power Over Ethernet) and send a higher voltage that you then use a SEPIC converter to convert to the voltage you need. A buck would work but I prefer SEPIC in my applications. This would then power everything down below. If it were me and I had room I would use a Nano and communicate with CAN to the onshore system. Then 100 meters or more of cable would be ok.
could you use a pair of ESP32 devices and transfer the data using WiFi using the ESP-NOW protocol?
so long as ther are no major objects between the transmitter and receiver 10 meters should work OK - you could use external antennas to improve range
Well, since the rain water reservoir islocated under ground, next to the basement where the esp32 is located, I'd say there are a few major objects between the transmitter and receiver end
Well, space is not the issue, it’s more the “unfriendly” environment of the rain water reservoir. For the first version of this project, I used a HC-SR04 (and an ESP8266 NodeMCU in the basement), but after a few months, the HC-SR04 failed due to corrosion, hence the waterproof A02YYUW.
Adding additional hardware on the sensor side, that needs to be shielded from the environment, is not impossible (it’s actually a nice generic solution), but makes for a more complex configuration. Using waterproof sensors with longer cables seemed a simple and elegant way out...
I actually am not that worried about the 10 m, but more about the possible impact of having the ground wires and Vcc wires connected at the sensor side.
using 2.5GHz WiFi to communicate with underground sensors is a problem - low frequency LoRa may be an a solution
an alternative may be to place a micro close to the senors (e.g. an ESP8266) to acquire the data and then transmit it using TTL serial to the ESP32 - if there are problems with noise on the TTL srerial use RS485