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)?

  • \$\begingroup\$ How far apart are the sensor boards from the ATmega controller board? Do they really share a reasonable ground? \$\endgroup\$ – gbulmer Dec 8 '15 at 9:21
  • \$\begingroup\$ Approximately 6 inches between each, probably a little less \$\endgroup\$ – Alex Wulff Dec 8 '15 at 11:25
  • \$\begingroup\$ Okay, 6 inches is fine. I was worried that only one signal wire might not be enough. \$\endgroup\$ – gbulmer Dec 9 '15 at 2:50

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.

  • \$\begingroup\$ Thanks, that's an interesting idea with the rx and tx pins. I'll probably go with OneWire just because it sounds much easier to implement. \$\endgroup\$ – Alex Wulff Dec 8 '15 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.