In our STM32L082 based board we use PCA9574, as we do not have enough pins in the micro-controller.
We have to use one of the IO pin of PCA9574 to establish communication with One Wire probe DS18B20.
I am facing challenges in establishing communication, as the default Arduino based One Wire library will not be helpful and I have developed similar library to use PCA9574 IO pin.
But that does not help in establishing communication.
Yes, we can connect number of OneWire device in a same pin as we have different address for each device. Trying to understand how it will be a challenge for using OneWire on an IO expander controlled via I2C ?
Because I were able to configure/control IO pin in the expander by writing a APIs (pinMode, digitalWrite and digitalRead) which made it easier for using in OneWire implementation.
You would need to write a new OneWire library, or change the existing OneWire library. This may be difficult even for an expert. It also may be difficult to achieve the correct signal timing that the OneWire protocol requires when using an external i2c i/o adapter chip.
I do not know for certain if this will work, but maybe you can consider a multiplexer like 74hc4067.
Yes you are right, it is challenging as OneWire is time sensitive, in this case, the timing for I2C operations should also be considered, and that cannot fit the time frame of OneWire protocol.
Are you saying only one sensor for the application or 1 pin each for more than one sensor. If it is the latter then you have a bad design. When designing you need to consider hardware, software and the interaction between them.