Question from a beginner about limits

Limits is often a balance of requirements. The clockspeed is the ultime limit, it is sort of speed of light barrier.

e.g. no processor can blink leds faster than its clockspeed.
More general, every interaction with a device/component uses time,

  • communication overhead - writing registers, reading status, signals becoming stable, serial output ,...
  • mechanical delays - servo's motors, switches, relays
  • physical delays - factual measurements of a sensor, storing data in memory/flash disks
  • limitations of RAM/FLASH => size of the state-space of a sketch (how much variables and code can it hold)
  • calculation time (executing code)
  • frequency of interaction - (per second)
  • ...

These properties are described in datasheets. But you need to interpret them.

E.g. a relay can switch position in 100 milliseconds does mean you can switch it max 10x per second. But sending the signal to the relay to switch position is just a digitalWrite(pin, HIGH/LOW) which executes in the order of microseconds. So in theory you could control 1 million relays per second. But that is where another limit comes in, The Arduino has not enough pins for 1 million relays, so one could decide to use the I2C bus as that allows up to 120+ chips, each controlling multiple relays. But I2C is much slower than a digitalWrite as you need an addressing scheme, reading/writing registers etc => factor 100-1000 (order of magnitude), dropping the number of relays with a ditto factor.

So in the end it is doing math about what you want, how often, how much times it takes and how all those limits come together in your sketch.

In practice if you want to control hundreds of components it might be good to make a distributed system with multiple (client) controllers, or "local intelligence" so a master processor can control the system on a higher level. It delegates the input and output and processing.

(just some thoughts)