3

Please, someone.

I want to use a temperature sensor (DS18B20) in an I2C only shield (Tentacle Mini), but this sensor is One Wire only. Can I write an I2C code to change the 1-Wire to I2C for this sensor? I think to use the (DS2482-800) bridge, but I don't know how to do...

Thanks!

3
  • 1
    Can't you connect the one-wire device (and if needed pullup resistor) to some other pin at the header rather than through the shield? Commented Oct 24, 2016 at 14:26
  • I recently wrote a Cosa TWI device driver for the DS2482. The example sketch actually uses a DS18B20. For further details please see github.com/mikaelpatel/Cosa/tree/master/libraries/DS2482. Commented Oct 24, 2016 at 14:27
  • An alternative is to use the I2C SDA pin to both I2C and 1-Wire. Commented Oct 22, 2017 at 21:30

1 Answer 1

2

As you said, the DS18B20 uses One-Wire interface. I2C is a Two-Wire interface. Pratically, you can't use the Arduino to translate that, BUT I found the DS28E17, a module that could translate the the 2 methods of communication. It should work but I havent tested it.

enter image description here

The DS28E17 is a 1-Wire slave to I2C master bridge device that interfaces directly to I2C slaves at standard (100kHz max) or fast (400kHz max). Data transfers serially by means of the 1-Wire® protocol, which requires only a single data lead and a ground return. Every DS28E17 is guaranteed to have a unique 64-bit ROM registration number that serves as a node address in the 1-Wire network. Multiple DS28E17 devices can coexist with other devices in the 1-Wire network and be accessed individually without affecting other devices. The DS28E17 allows using complex I2C devices such as display controllers, ADCs, DACs, I2C sensors, etc. in a 1-Wire environment. Each self-timed DS28E17 provides 1-Wire access for a single I2C interface.

Hope I helped you.

Not the answer you're looking for? Browse other questions tagged or ask your own question.