1-wire communication

A while ago I was thinking about a communication method between arduinos using only 1 wire. I wanted to combine the bi-directional data line of I2C and the synchronous timer system used on the serial connection (TX/RX pins) so you won't need a clock line.

Instead of writing my own library (what I can't do now but will do in the future). I came with an other solution. I once wrote some code so that I could daisy chain the Tx/Rx pins to the following arduino. I hooked up 4 arduinos with LCDs like this. In my code I used an adress system. I could type a number 1-4 followed by text like 3hello world, arduino with adress 3 would display hello world. It worked flawless.

if an arduino got the wrong adress, it would read the message and relays the exact same message to the next arduino. The last arduino would be wired to the first so that every arduino could send a message to any other arduino. A ring of Tx-Rx connections

I am now thinking to connect every Tx/Rx pins I have to one single bi-directional data line. Then I want to use my adress system again so only the right arduino responds. The problem of this would be that every arduino which will send out a byte, would also fills his own serial buffer. I can solve this problem by calling Wire.flush() every time an arduino sends something out.

I can think of only two drawbacks.

  1. when 2 arduino's will transmit at the same time, shit will go bad (can be prevented in code though, master slave system)
  2. when an arduino sends something it might delete any potential message stored in the buffer (but can also be prevented in the code).

As the Rx is an input, and thus has high resistance, I don't think I have to put a resistor between an Tx and Rx pin of each arduino.

I hope my 1-wire interface will work. I'll let you know