Electronic – arduino – Best method of packet transmission between an array of sensor nodes

arduinoattinyattiny85communication

Currently I'm working on a project where I'll have an array of four sensor nodes, each with three sensors. These sensor nodes need to send their data back to an ATMega controlled board for processing, display, etc. I had the idea of using some ATTiny85s, one on each sensor node, and use those to collect the data from the various sensors, then package it for transmission. I would like to have only one data wire, one ground wire, and one voltage wire connecting each node.

My question is this: what would be the best protocol for sending these packets of data over one wire? Each sensor node doesn't need to communicate with one another, and the ATMega only needs to accept input from the sensors, not send output too. I have heard of using the OneWire library with ATMega chips before but never on something like an ATTiny85. Or, would it be best to just try and send each packet of data "manually" (they're very small, no bigger than 100 bytes)?

Best Answer

Best option would be either the onewire protocol or perhaps a half duplex UART. With half-duplex UART, all you do is connect all of the UART RX and TX pins to the wire and just keep all of the TX pins tristated except for the one microcontroller that's transmitting. You could run in to contention issues with the half-duplex UART method; onewire does not have this problem as it is open-drain. You shouldn't have any issues with onewire on an attiny85, aside from perhaps a bulky library implementation eating up all the program memory.