I'm trying to come up with a way to drive multiple small DC motors, controlling their direction and power on / off independently using a Pi. The motors are rated 1.5-6.5V giving 1700-7300 RPM; I've measured ~12.5mA current draw when running free and ~100mA when fully stalled, both from a 1.5V AA battery as a supply. I need to run 16 of these; I don't need precision speed control, just on / off and direction at the lowest practical RPM. I also need to connect a bunch of other stuff to the Pi, so I can't really use up all my GPIOs on these. I would also very much like to stay low-budget (the motors cost about ~US$0.90 apiece).
My question is twofold:
- What to use to drive the motors?
- L293x is out of the question for budget reasons (it's around US$5 around here and I'd need 8 of them) as well as low RPM requirements (the lowest supply voltage it supports is 4.5V which in and of itself wouldn't give me low RPM and I don't want to have to deal with PWM on account of question 2).
- The L9110 seems like the best way so far - I can get it about as cheap as the motors themselves, it can go pretty low on the supply voltage (2.5V) which should hopefully result in reasonably low RPM. The issue is that I can't seem to find a lot of info about it.. the datasheet looks like it was translated by a very early non-public beta of google translate, but it seems to be saying that the input pins are each for one motor direction; but there's other information I was able to find about it online that says that there's one "enable" pin (which could even be fed a PWM if I were so inclined) and one "direction" pin; also I can't seem to find any reference as to what the output voltage will be relative to the supply voltage (I think I read somewhere it's around half Vcc). Is there anyone here who could shed some detailed info on this chip and its application?
- The third option I'm contemplating is going discrete. Basically I'd have a 1.5V supply rail hooked to one side of the motor and I'd use two transistors to connect the other side of the motor to either the ground or a 3V supply rail. It's a very naive solution and even the few problems that I can spot with my absolute lack of education in electronics tell me off of it; but out of a morbid curiosity, is there any way to make a super simple solution like that work at all?
- Who driveth the drivers? (cough, cough)
Given the fewest-possible-GPIOs-used requirement, how do I multiplex control from a pair of GPIOs on the Pi to 16 pairs of control inputs on the drivers? I know the general working principle of multiplexing, but again my actual knowledge in the field is very limited, so I don't really even know where to begin to look for suitable multiplexer ICs (or indeed how to know whether those I find are suitable or not), nor what other circuitry I might need between them and the drivers. So assuming I'll go with the L9110 which seems like the best option at the moment, how would I go about multiplexing control from 2 GPIOs onto 16 L9110s? Would for example a pair of 74HC4067s do the trick? If so, would it make sense to drive them using 6 GPIOs (ie. sharing the 4 channel select lines and having a separate GPIO drive each of the ICs enable pin)? Or is there another IC you'd recommend? And what other circuitry should go between the multiplexer and each motor driver? Should I put a condenser somewhere in there to "smooth out" the pulses received from the multiplexer?