Working with several periphery elements

Dear Hackers,

I am a newbie in Arduino programming and started exercising the elegoo lessons “uno r3 project”.

In each lesson there is a different setup of sensors and motors etc. but while trying to establish my own setup design I quickly faced the problem that there is a limited amount of pins available.

What would be the best solution in order to extend the board (run several sensors an motors at the same time) in your opinion?


It depends what kind of sensors they are: if they run off I2C for instance, you can have over 100 on just the 2x I2C pins provided their addresses don't conflict. Or there are I2C extenders.

adafruit have a board that runs 16 servos off the I2C bus, as a for instance.

But for better help you should describe exactly what sensors and motors you anticipate using.

Typical ways to add more input and outpins are shift registers and IO expanders, but for some types of signals (Like leds and switches) you can also multiplex with a few Arduino pins.

for a beginner I guess it's the easiest to buy an Arduino Mega which offers a lot more GPIOs.
And by the way, 4 hardware serial come handy if you have modules which use serial communication (GPS, MP3, DMX, Modbus, ...)

Thank you for your quick and helpful answers!

I think 'multiplexing' and 'shift register' are the terms that has previously been missing in my web searches and I already found further information. But it looks as if I will go for a Arduino Mega anyways :slight_smile: