Help with sensor input and servo control

I need to know if i can connect multiple sensors to a single pin through multiplexing or expanding my intentions are to be able to control 50 servos on a singular board the servos need to operate at the same time as the input from a mix of physical sensors such as flex sensors and rotary incoders or would i be able to rig 2 or 3 arduinos together to accomplish this… Of not who makes a board with 100 inputs and outputs. I have read that the multiplexing makes the signal cut off while another item is sendingnits signal. I know i can use a servo board to operat all the servos but i need to know if there is something thatbwork on ths input side im new to arduino so alot of this is new to me.and the terms used for the thing i need are usually very specific so andy advicw would be awesome. However if someone can recommend a board that will make this easier like one with 100 inputs it would be great.

Hello @Diablogrimm and welcome to the RobotShop community!

I don’t think you will be able to connect that many servos to a single board but that would depend on the power requirements of the servos and how much voltage/current are the board pins able to handle. If you are using a servo controller for that and are just looking to expand the I/O pins then you could look for a sensor shield or I/O expansion shield, you can find some options here https://www.robotshop.com/en/arduino.html

About the multiplexing, I haven’t tried it myself but I’ve seen some tutorials that explain how to do it, like these:


Power to theservos isnt an issue as ill be using a seperatly powered servo board with individual adresses and only actin lg on a few puns these boards can be daisy chained to run 96 servos or something. The question i have is will multiplexing work send a signal from sensors to the servos being used. Or should i upgrade to a more advanced microcontroller with mor dirrect i/o pins i appreciate the tutroial links but im more or less wondering how many sensors i can use in real time on a mux and still have a smooth signal.

You could daisy chain many multiplexers to get as many input channels as you need but multiplexing reduces the rate at which data can be acquired from an individual channel because of the time-sharing strategy between channels so I don’t know about “real-time” measurements, you can read more about this here.

I also suggest checking out these blogs https://arduino.stackexchange.com/questions/21536/expanding-analog-inputs-to-the-arduino and https://forum.arduino.cc/index.php?topic=182366.0. A good solution mentioned in one of them is to:

Have multiple Arduinos (or other low-cost microcontrollers) each doing some of the sampling and then implementing some kind of communication method between them (or to a single master). This has the added advantage that it’s then possible to sample multiple channels at once (one per microcontroller) speeding up your operation somewhat.

@Diablogrimm You mentioned controlling 50 servos from a single line - have you considered smart servos?
https://www.robotshop.com/en/smart-servo-motors.html

For example Lynxmotion’s smar servos:
https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/

If you can describe your application more, perhaps we can better assess their suitability.

Unfortunately do to the small size required for the servos the smart servos aren yet an option at least not economically if at all… The project is semi protected but in essense i need to have 50 servos… That function some what smoothly when reciving signals from roughly 50 inputs either rotary incoders flex sensors or otherwise… These motors would need to work smoothly while being opperated simaltaniously. Understandably the top of each wave cets cut short when operating multiple sensor and the signal becomes mashed up. While running a mux (multiplexer) it allows for essentially swithing between the inputs as it signal ends so with an 8x mux would the signal smoothly if so i could in theory run a few muxes not daisy chained. Would this allow the motors movment or is it choppy signals i guess is the question. If i cant get an answer i will just mux it and order and ossiloscope just was hopefull not to have to cash out before i could be sure.

As you had indicated, an I2C servo controller should work nicely.

In order to answer your question I would need to know the speed of the multiplexer and the sampling rate you need in order to run the servos smoothly. But if you are planning on just using 8 sensors in one input I don’t think you’ll have an aliasing problem. Here they use one mux to read the value of 8 LDRs and print them on the serial monitor every second.