loading

how can one incorporate multiple USB-like connections to/from an arduino?

Hello All,

I am hoping to create peer-to-peer connections (essentially a network) of multiple arduinos (or for that matter, ATMega's). However these do not have separate power supplies and each one will be powered up when connected to the other previously connected one. At the same time I would like these units to know about each other's existence when they connect (each chip should know if another chip is connected to it). I was told to think of a USB-like connection where you can share both the power and the data on the same, say, bus line. My question is how do I create multiples of this connections (more than one) and how could I make sure they work as OTG (e.g. hot plug) and can be used as both host or client at any given time?

Any help is much appreciated.

Thanks.
Karim.

Not with USB as there are no host capabilities that I know of but there are other ways of linking them:

https://www.instructables.com/id/I2C-between-Arduin...

karimskarim (author)  Downunder35m2 years ago
thank you; however does the schematic not show only linear connection? what if i have branches? also, for the USB i had the impression that USB Micro-AB has an extra pin (ID pin) that is used for host/client recognition. Is this not true?
Karim.

It looks linear but it is a "data connection" like any other bus system.
Home automation uses a similar suystem to address the different utilities.
You do go from one Arduino to the next, without "intersections" but the communication works in all direction.

The 5th pin on a micro USB really does nothing more than to detect a host connection if bridged with (or without) a resistor to the ground line.
So no ID identification through that.
Of course it is direct system, so you can identify each device connected.

The approach might be a bit differetn than waht you expected but you might actually find it easier to use than a USB connection (that would not work for this case anyway).

karimskarim (author)  Downunder35m2 years ago

Hello and thank you; yes it does sound simpler the way you explained it. Now i am wondering, following what i asked before, if i want to connect the MicroControllers (MC's) like a tree with one at the base and the others connected to the base, what would happen? haven't i used the analog pins 4 and 5 already for one connection? what if then one of those branches itself becomes a base for another tree? i guess in this sense i am going to have multiple paths through MCs.