I'm working on a project of my home plants irrigation/hydroponic system(not cannabis!)) just chilies and other eatables). Also I'm trying to recycle modules, wires and other projects' leftovers such as Digispark ATtiny modules. I'd to use it as a slave controller to pass some sensors' data to master-controller. (Sensors are soil pH, moisture sensor, water counter, PIR as a cat detector). Now I'm looking for a way to reuse Digispark USB-connector(3 and 4 pins) as a communication bus. Those pins have pull-up resistors and diodes attached to, so that's why it could be difficult. My goal is to reduce extra components count, reuse old micro-usb wires, connect digispark slave controller using existing USB connector. And optionally save the ability to program digispark via the same connector. I'd like to use 1-wire/i2c protocols for communication, cause it would be better to connect multiple slave-devices on the same bus. So here are a few troubles:
- choose of the protocol. I2C sounds better, but the popular library TinyWireS use USI pins to communicate which are different to USB pins. 1-wire looks suitable, and it also have pullup resistors on the bus.
- voltage shift on these pins
How do you think Is it possible to connect multiple 1-wire slave digispark devices on the same bus. Do I need an optocoupler or logic level convertors?