DS2482 I2C to 1-wire Library

The DS2482 is an I2C to 1-wire interface chip. It comes in two versions, the DS2482-100 (1-port) and DS2482-800 (8-port). Using an interface chip is helpful because most DS18B20/1-wire libraries use timing sensitive code and may run for extended periods with interrupts disabled. This can cause the rest of your program to have poor performance.

The library fully supports both single-drop and multi-drop modes, allowing many DS18B20 sensors on a single 1-wire bus. It also supports fast multi-drop mode where all of the DS18B20s do their temperature conversion (which takes 750 milliseconds at 12-bit resolution) at the same time.

The DS2482 library is completely asynchronous, never blocking for more than the time to do an I2C read or write. Interrupts are never disabled.

The DS2482 also has an internal transistor to pull the 1-wire bus high during temperature conversion and flash writes. This allows the use of parasitic power mode, requiring only two wires for sensors (DQ and GND), with no separate power line. The library supports this as well.

The full API documentation can be browsed here.

The official Github is here.

It’s in the Particle community libraries as DS2482-RK.


Thank you Rick!

Looks like amazing code quality Rick.

We use a much simpler implementation:

We just piggyback a OneWire conversion start after each sensor read, but this is handled int he DS18B20 library. We read once per second, so the conversion has always completed when the next read occurs.

Switching to your library will be a big rewrite, because we’ll need to switch to a callback approach on multiple levels of the code. The code quality makes it tempting though, even though what we have now has been running without issues for a long time.

I think your library will be also compatible with the DS2484, which is why I called mine DS248x.

It does seem that your library is a mix of a generic OneWire master and DS18B20 reading. This is probably fine for your use case, but it seems to me that splitting this functionality over multiple classes would be a more versatile approach.

We use a class for each DS18B20, which takes a pointer to a OneWire master. I understand that combining a multidrop read with this approach is hard.

1 Like

Hello Rick, I am using Ds18b20 10 temperature sensors using arduino and DS2482-100 , I am trying to use your library"DS2482-RK." but it gives me error like"Specified folder/zip file does not contain a valid library" and "Missing ‘maintainer’ from library
"I have tried each and everything to install it. can you please help me.Thank you

My DS2482-RK library is intended for use on Particle devices only. The library source is not laid out for use on Arduino, and it would certainly require at least minor modifications if not major modifications to make it work.

ohk Rick,Thank alot for quick reply.