Suitable cable to connect ds18b20?

What cable would be good to connect some of those sensors indoors? Either 3 or 4 wire cable, 4 wire could possible be used for i2c too? Length for the ds18b20 would be a few meters either / or both daisy chained / star config. Color white, to best match the walls.

I think you missed something, here is a picture.

Ds18b20 can use either 3 or only 2 wires. 2 wires is called "parasite power mode" or something.

No. You cannot share a wire between i2c and 1-wire devices.

I’ll go for 3 wires just to be safe.

I expressed my self misleading, it would be separate of course.

Not quite sure what you mean exactly.

Another thing to understand is that 1-wire is designed to work over longer distances, like 10 or 20 metres. I2C is designed for short distances on the same PCB. It often works up to 1 or 2 metres but for longer distances, you need special line drivers/signal boosters.

1 Like

Sure, if it makes you happy :grin:

From what I learned, 1-wire works with about any cable, no twisted pair or shielded. But if I buy cable it would be nice if it worked with i2c too, so maybe twisted pair is needed? And it would be totally separated from the 1-wire, and at shorter distance.

That is no help. The MCU is at place A, the display is at place A, the interface board is at place A. The thermometer is at place B and is connected to the interface board at place A.
Is that your plan?

My question was for the cabling in general. The thermometer status right now is at the breadboard state.

Edit: The wires for the sensor is wiggly, so minor movements of the contraption shows Err :upside_down_face:

Sounds like it is bad, did you buy the 5 pack?

If long wires and/or multiple sensors are involved, then consider small stand-alone WiFi boards and a central master.

I have several ESP32C3 boards with Temp/Humidity sensors around the house.
HomeAssistant, running on a tiny PC logs/displays all of them on WiFi devices, controls lights, the TV and does much more. Big step up from a display on a breadboard.
Leo..

2 Likes

Which wire specifically, you have sensor wires(3), and interface board to MCU wire.
Your picture which is unreadable appears to have many more for some reason.

The legs of the sensor are thin and doesn’t make good contact with the jumper wires..

Later on proper fitting will be done, with more sensors, and connection serial → Home Assistant.

It’s a Nano clone connected to a MAX7219 driving the display.

I agree, if you need to buy a reel of cable, pick one that is useful for other things as well.
2x twisted pair telephone/alarm cable for example is commonly available.

That’s my thinking too. Perhaps even Cat5, if there’s some thin variant.

For I2C use two twisted pair unshielded
How far yor you can go will depend on cable capacitance, bus speed and pull-up resistance.

Yep, there are surprisingly thin cat5/6 cables readily available.

Thanks, I figured TP is the right type to use for i2c. Would it be SCL and SDA over one pair and Vcc + GND, or signal + power? Or does it matter?

Many thin/cheap Cat5/6 is copper-clad and can't be soldered.
Leo..