0
\$\begingroup\$

I'm aiming to control 4 motorized faders with an Arduino. However, I'm still trying to figure out how to best multiplex all the inputs/outputs. Each fader has two potentionmeters and one touch capacitive sensor, and even if I discard the touch sensing pin I still need at least 4 inputs per fader (16 in total). On the other hand, I don't know if it would be possible to mux the four DC motors, but I wouldn't discard reserving 4 PWM pins for each indivual motor. I've read that it is possible to achieve this with either multiplexers or shift registers: but what would be the advantage of each approach? I predict each motor would be operating at 10V@0.8A max.

EDIT: I have no actual "fixed" requirements for how fast the motors should run, I'm trying to estimate what kind of speeds I would get with each approach, and if how much I would gain if used dedicated PWM pins for each motor (besides being able to control them "simultaneously")

\$\endgroup\$
  • \$\begingroup\$ Please add some informations about how fast you want to move the motors. You will need four motor drivers, 2 pins each (direction and pwm) plus 4 wires to read back the pot values. Grand total is 12, but you can go down to 11 multiplexing the pots or even down to 7 multiplexing the motors, but that would be difficult. Do you need to vary the motors speed? \$\endgroup\$ – Vladimir Cravero May 5 '14 at 10:21
  • \$\begingroup\$ @VladimirCravero I would like to have each potentiometer separate pins in order to be able to feedback the error between the two of them, and would also need the total resistance values of each one so that I could calibrate the system and avoid the fader to be driven against the edge. So that's 4 pins for each fader, considering they are multiplexer. \$\endgroup\$ – joaocandre May 5 '14 at 10:39
  • \$\begingroup\$ @VladimirCravero On another hand, if I wanted to have a feedback loop on the motor control, speed would depend on potentiometer multiplexing speed (am I right?) so that would probably make it redundant/unnecessary having motors on dedicated pins \$\endgroup\$ – joaocandre May 5 '14 at 10:44
  • \$\begingroup\$ At this point I believe that a deeper description of what you want to do would help. The potentiometer total resistance is not needed, and why do you need to compute the error between the pots? \$\endgroup\$ – Vladimir Cravero May 5 '14 at 12:34
  • \$\begingroup\$ @VladimirCravero electronics.stackexchange.com/questions/109264/… \$\endgroup\$ – joaocandre May 5 '14 at 13:27
1
\$\begingroup\$

Why do you need 4 inputs per fader? I presume that one is for sensing position, and one is for the actual gain of the fader (which is supposed to be analog) -- the Arduino only needs to read one of them. If that's a voltage divider between 5V and GND, you only get one analog input per fader for position.

If touch is a digital signal, or can be determined with a comparator, you can then use a digital input for that. Or, as you said, ignore touch.

Finally, you have 6 PWM outputs, but only need 4, and then another output each for direction, assuming you have a reasonable motor controller with enable/direction inputs.

So on an Arduino UNO:

  • position sensor: A0 through A3 (save A4 and A5 for I2C)
  • motor PWM (speed): four of the PWM digital outputs
  • motor direction: four of the non-PWM digital outputs
  • touch sense (if needed/implemented): four non-PWM digital inputs

Total, 12 digital pins, 4 analog pins. Leaves the serial port (D0/D1) free for programming, and I2C (A4/A5) free for I2C.

\$\endgroup\$
  • \$\begingroup\$ I've also reached the same conclusion that a single pin is enough to read the position of each sensor, however if I control the motors separately I would also need the enable pins. Right now I'm thinking it might be best to control motor speed separately but multiplex the other pins with shift registers. \$\endgroup\$ – joaocandre May 5 '14 at 19:04
  • \$\begingroup\$ If you have PWM and direction pins, the PWM pin can double as "enable" and you can tie enable high (or whatever direction enables it.) You shouldn't need more than two pins to drive a motor controller with PWM and direction. The specifics depend on your motor driver -- which driver are you using? \$\endgroup\$ – Jon Watte May 6 '14 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.