Hi,
I want to read 12 different DS18B20 with 10m long cable and send the data to the Thingsboard IoT Cloud to visualize it.
I first tested everything with just 3 DS18B20 and everything worked fine.
But as soon as I connect a fourth one, some sensors wont measure the correct temperature, they always measure -127°C, the same value the ESP gets when I measure a sensor that isnt connected.
The whole thing gets worse the more sensors are in the Network. I tried it with 6 Sensors and only 2 can give me good Data. (Always different ones)
All Sensors are in parallel, like in the schematic. There are only connectors for 3 DS18B20 to keep the Schematic simple.
I use a 5V, 2,4A Power Supply and an ESP32.
What can I do to get good readings on all Sensors ?
awneil
September 7, 2023, 1:46pm
2
Please post your code.
In particular, how are you addressing the sensors?
Also, what are the lengths of the wires involved?
Once upon a time, I mananged to operate only six DS18B20 in pararllel using UNO. I think, the situation depends on the correct value of the common pull-up rsistor. You can try using parasite power schemes for the sensors.
awneil
September 7, 2023, 1:52pm
4
The simple drive with just a passive pull-up is fine in simple cases - but maybe not so much when you come to large networks of many sensors.
Take a look at this:
IntroductionThe 1-Wire protocol was originally designed for communication with nearby devices on a short connection, such as adding auxiliary memory on a single microprocessor port pin. As the use of 1-Wire devices increased, methods were developed...
LarryD
September 7, 2023, 1:53pm
5
Why are you using a pull-up resistor going to 5v when you are using a 3v3 ESP ?
And, why 5v to the DS18B20 ?
1 Like
I did it like this guy: ESP32 with Multiple DS18B20 Temperature Sensors | Random Nerd Tutorials
First i got the address of each sensor. I also tried every sensor on its own already to make sure they are all working.
Each Sensor has 10 meter long wires.
awneil
September 7, 2023, 1:55pm
7
The AD 1-Wire spec does require a pull-up to 5V ...
LarryD:
you are using a 3v3 ESP
... but that will be a problem!
Its a ESP DevKit. It will be fine.
The DS18B20 can be powered with 3-5.5V.
awneil
September 7, 2023, 1:57pm
9
So a total of 120m of cable!
You definitely need to be looking at that App Note - I think that's going to be beyond the capability of a simple pull-up:
IntroductionThe 1-Wire protocol was originally designed for communication with nearby devices on a short connection, such as adding auxiliary memory on a single microprocessor port pin. As the use of 1-Wire devices increased, methods were developed...
You also have the problem, mentioned by @LarryD , that the 1-Wire works at 5V, while your ESP is only 3.3V...
LarryD
September 7, 2023, 1:59pm
10
No argument there.
However, the ESP32 inputs wants 3v3 and you are feeding the ESP 04 input 0-5v
1 Like
Well, I didnt thought about that.
Do you think 3.3V will work on 10 metres of wire ?
awneil
September 7, 2023, 2:06pm
12
If you read through the comments there, you'll see several other people having problems with lots of sensors and/or long cables...
I think I will try this.
Do I have to do this for every sensor or just once like the Pullup ?
awneil
September 7, 2023, 2:09pm
14
Your ESP may well be "clamping" the data line to 3.3V already - which probably adds to the problems.
Note that you don't just have 10m of wire: you have 10m of wire per sensor - so the pin has to drive a total of 120m!
awneil
September 7, 2023, 2:11pm
15
I rather doubt it.
Note that it's using a DS2480B master - which probably has a better driver than just a simple pullup.
I think you'll need to look at the "improved" driver for your ESP:
So I will try this. But instead of the 5V, I use 3,3V, right ?
awneil
September 7, 2023, 2:16pm
18
It would be a start.
I think you could adapt that to drive the 1-Wire bus at 5V from a 3V microcontroller...
awneil
September 7, 2023, 2:19pm
19
Would be worth searching the AD forum to see if they've already covered driving 1-Wire from lower-voltage microcontrollers.
If not, post the question there...
Alright, thank you for youre help