is there a way to do plugnplay for arduino?

79 views Asked by At

First Thanks in advance.

Is there a way for an Arduino board to detect what other boards are attached (such as infrared, or servo motor etc) or simple things such as led or push buttons? Basically is there a way to do Plug N Play?

I would like to design a system using an Arduino were the user can mix and match infrared sensors, motors, led. The script would recognize what is attached to the board and respond accordingly. Currently one is forced to hard code in the script identifying what pin is attached to what. Hence if the user pulls out a servo motor and adds an infrared, then the script must be rewritten. This is what I want to avoid.

Thanks.

1

There are 1 answers

1
Nino On BEST ANSWER

You started with

user mix and match sensors, motors, led. The script would recognize what is attached

and later added

Arduino for model railroads, to dynamically add servos, lights and sensors

These are not the same, narrowing the scope makes all the difference. See my comment for first option. As for building a specific model that will recognize elements, sure, this can be done in couple of ways depending on the topology you intend to implement and in that case the main concern should be:

How will elements/nodes be connected to each other and / or the main board?

If you intend to run seperate wires for each element you could identify them by dedicating one wire for ID and use a different resistor on each, That's complicated and limited and I wouldn't do that.

On the other end you could create a parallel bus that runs from node to node and can be extended as needed, it will have a small number of wires that will implement I2C for instance, and for identification but also as local drivers you would add an ATtiny on each node.